Parcourir la source

修改合并后冲突添加半袋米相关代码

zengjiebin il y a 8 ans
Parent
commit
0498dddeb0

+ 28 - 33
app/build.gradle

@@ -66,33 +66,24 @@ android {
     }
     productFlavors {
         bandaimitest {
-            applicationId "com.sheep.jiuyan.samllsheep.test"
+            applicationId "com.sheep.jiuyan.samllsheep"
             manifestPlaceholders = [UMENG_CHANNEL_VALUE   : "bandaimitest",
                                     DUANDUAN_GRAPH        : "bandaimitest",
                                     DUANDUAN_DATASHARE    : "bandaimitest",
-                                    UMENG_APPKEY          : "58dc9509aed17959a3001bff",
+                                    UMENG_APPKEY          : "58edcfeb310c93091c000be2",
                                     JPUSH_PKGNAME : applicationId,
                                     JPUSH_APPKEY : "b8b5adf7d70d0c904d46d04c",
-                                    JPUSH_CHANNEL : "developer-default",
-                                    WX_ENTRY_ACTIVITY     : "com.kfzs.duanduan.bandaimi.wxapi.WXEntryActivity",
-                                    REACT_ACTIVITY_ACTION     : "com.kfzs.duanduan.bandaimi.jumpToReactActivity",
-                                    DUANDUAN_GAME_CATEGORY: "android.intent.category.LAUNCHER"]
+                                    JPUSH_CHANNEL : "developer-default"]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"bandaimitest"'
             buildConfigField "String", "DUANDUAN_GRAPH", '"bandaimitest"'
             buildConfigField "boolean", "KF_DEBUG", 'true'
 //            buildConfigField "String", "API_DOMAIN", '"10.8.210.229:8081"'
 //            buildConfigField "String", "RN_DOMAIN", '"10.8.210.229:8070"'
             buildConfigField "String", "API_DOMAIN", '"test.bdmapp.kfzs.com"'
-            buildConfigField "String", "RN_DOMAIN", '"test.shopapi.bandaimi.com"'
 //            buildConfigField "String", "API_DOMAIN", '"10.8.210.229:8081"'
             buildConfigField "String", "JFSC_DOMAIN", '"http://10.8.210.190:8080/"'//积分商城
             buildConfigField "String", "CAPTCHA_DOMAIN", '"captcha.kuaifazs.com"'
             buildConfigField "String", "umeng_appkey", '"58dc9509aed17959a3001bff"'
-            buildConfigField "String", "WX_APPID", '"wx1af78a79dd7d4a45"'
-            buildConfigField "String", "WX_APPSECRET", '"f183b5e8c4a5f91a9ce23bacb5094b1d"'
-            buildConfigField "String", "WB_APPID", '"285907821"'
-            buildConfigField "String", "WB_APPSECRET", '"771a81389c60bcedd1a517dbe65977d6"'
-            buildConfigField "String", "DUANDUAN_GAME_CATEGORY", '"android.intent.category.LAUNCHER"'
             signingConfig signingConfigs.config
         }
         bandaimi {
@@ -101,29 +92,19 @@ android {
             manifestPlaceholders = [UMENG_CHANNEL_VALUE   : "bandaimi",
                                     DUANDUAN_GRAPH        : "bandaimi",
                                     DUANDUAN_DATASHARE    : "bandaimi",
-                                    UMENG_APPKEY          : "58dc9509aed17959a3001bff",
+                                    UMENG_APPKEY          : "58edcfeb310c93091c000be2",
                                     JPUSH_PKGNAME : applicationId,
                                     JPUSH_APPKEY : "b8b5adf7d70d0c904d46d04c",
-                                    JPUSH_CHANNEL : "developer-default",
-                                    WX_ENTRY_ACTIVITY     : "com.kfzs.duanduan.bandaimi.wxapi.WXEntryActivity",
-                                    REACT_ACTIVITY_ACTION     : "com.kfzs.duanduan.bandaimi.jumpToReactActivity",
-                                    DUANDUAN_GAME_CATEGORY: "android.intent.category.LAUNCHER"]
+                                    JPUSH_CHANNEL : "developer-default"]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"bandaimi"'
             buildConfigField "String", "DUANDUAN_GRAPH", '"bandaimi"'
             buildConfigField "boolean", "KF_DEBUG", 'false'
             buildConfigField "String", "API_DOMAIN", '"app.bandai.yunduanzs.cn"'
-            buildConfigField "String", "RN_DOMAIN", '"shopapi.bandaimi.com"'
             buildConfigField "String", "JFSC_DOMAIN", '"http://jf.bandaimi.com/"'//积分商城
 //            buildConfigField "String", "API_DOMAIN", '"app.bdmoem.kfzs.com"'
-//            buildConfigField "String", "RN_DOMAIN", '"shopapi.bdmoem.kfzs.com"'
 //            buildConfigField "String", "JFSC_DOMAIN", '"http://jf.bdmoem.kfzs.com/"'//积分商城
             buildConfigField "String", "CAPTCHA_DOMAIN", '"captcha.kuaifazs.com"'
             buildConfigField "String", "umeng_appkey", '"58dc9509aed17959a3001bff"'
-            buildConfigField "String", "WX_APPID", '"wx1af78a79dd7d4a45"'
-            buildConfigField "String", "WX_APPSECRET", '"f183b5e8c4a5f91a9ce23bacb5094b1d"'
-            buildConfigField "String", "WB_APPID", '"285907821"'
-            buildConfigField "String", "WB_APPSECRET", '"771a81389c60bcedd1a517dbe65977d6"'
-            buildConfigField "String", "DUANDUAN_GAME_CATEGORY", '"android.intent.category.LAUNCHER"'
             signingConfig signingConfigs.config
         }
     }
@@ -154,8 +135,10 @@ dependencies {
     compile 'org.greenrobot:eventbus:3.1.1'
     compile 'com.zhy:base-adapter:3.0.3'
     compile 'com.liulishuo.filedownloader:library:1.6.9'
-    compile 'com.tencent.bugly:crashreport_upgrade:latest.release'//其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
-    compile 'com.tencent.bugly:nativecrashreport:latest.release' //其中latest.release指代最
+    compile 'com.tencent.bugly:crashreport_upgrade:latest.release'
+    //其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
+    compile 'com.tencent.bugly:nativecrashreport:latest.release'
+    //其中latest.release指代最
     compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
     debugCompile 'com.readystatesoftware.chuck:library:1.1.0'
     compile 'de.hdodenhof:circleimageview:2.2.0'
@@ -223,14 +206,26 @@ dependencies {
     compile 'org.greenrobot:eventbus:3.0.0'
     compile 'com.yalantis:ucrop:2.2.0'
     //    compile files('libs/SocialSDK_QQ_Simplify.jar')
-    compile files('libs/SocialSDK_Sina_Simplify.jar')
-    compile files('libs/SocialSDK_WeChat_Simplify.jar')
-    compile files('libs/umeng_shareboard_widget.jar')
-    compile files('libs/umeng_social_api.jar')
-    compile files('libs/umeng_social_net.jar')
-    compile files('libs/umeng_social_shareboard.jar')
-    compile files('libs/umeng_social_shareview.jar')
+
+//    compile files('libs/SocialSDK_Sina_Simplify.jar')
+//    compile files('libs/SocialSDK_WeChat_Simplify.jar')
+//    compile files('libs/umeng_shareboard_widget.jar')
+//    compile files('libs/umeng_social_api.jar')
+//    compile files('libs/umeng_social_net.jar')
+//    compile files('libs/umeng_social_shareboard.jar')
+//    compile files('libs/umeng_social_shareview.jar')
+//    compile files('libs/umeng_social_tool.jar')
+
+    compile files('libs/open_sdk_r5923_lite.jar')
+    compile files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
     compile files('libs/umeng_social_tool.jar')
+    compile files('libs/umeng_social_shareboard.jar')
+    compile files('libs/umeng_social_net.jar')
+    compile files('libs/umeng_social_api.jar')
+    compile files('libs/umeng_shareboard_widget.jar')
+    compile files('libs/SocialSDK_WeiXin_Full.jar')
+    compile files('libs/SocialSDK_QQ_Full.jar')
+
     compile 'com.zhy:okhttputils:2.6.2'
     compile files('libs/alipaySdk-20170922.jar')
     compile 'com.github.bumptech.glide:glide:3.5.2'

+ 0 - 218
app/src/main/java/com/kfzs/duanduan/ActSetting.java

@@ -1,218 +0,0 @@
-package com.kfzs.duanduan;
-
-import android.content.pm.PackageManager;
-import android.os.Bundle;
-import android.support.v7.app.ActionBar;
-import android.support.v7.widget.Toolbar;
-import android.util.Log;
-import android.util.TypedValue;
-import android.view.Gravity;
-import android.view.Window;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.kfzs.appstore.utils.restful.KFZSNetwork;
-import com.kfzs.appstore.utils.string.HexUtils;
-import com.kfzs.duanduan.bll.UrlBll;
-import com.kfzs.duanduan.db.DataSave;
-import com.kfzs.duanduan.utils.ApkUtils;
-import com.kfzs.duanduan.proto.ApiResponseOuterClass;
-import com.kfzs.duanduan.proto.UpdateContentOuterClass;
-import com.kfzs.duanduan.utils.dlg.TitleBarUtils;
-import com.kfzs.duanduan.utils.net.ResponseNetworkTask;
-import com.kfzs.duanduan.utils.DateFormatUtils;
-import com.kfzs.duanduan.utils.dlg.UpdateUtils;
-import com.kfzs.duanduan.utils.net.APIRequest;
-import com.kfzs.duanduan.utils.net.APIRequestInstance;
-import com.kfzs.duanduan.view.DialogUpdateFragment;
-import com.sheep.jiuyan.samllsheep.R;
-import com.zhy.http.okhttp.OkHttpUtils;
-import com.zhy.http.okhttp.callback.StringCallback;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-import java.util.HashMap;
-
-import butterknife.BindView;
-import butterknife.ButterKnife;
-import butterknife.OnClick;
-import go.kfzssafe.Kfzssafe;
-import okhttp3.Call;
-
-public class ActSetting extends BaseCompatActivity {
-
-    @BindView(R.id.tv_act_setting_version_info)
-    TextView tvActSettingVersionInfo;
-    @BindView(R.id.txt_content_setting_tips)
-    TextView mTxtTips;
-
-    @BindView(R.id.ll_contant)
-    LinearLayout llContact;
-    private String strUpdateDesc;
-    private UpdateContentOuterClass.UpdateContent mUpdateContent;
-    private Boolean mIsNeedUpdate = null;//null是未检测,其实是是否需要更新
-
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_setting);
-        TitleBarUtils.getInstance().setTitleFinish(this)
-                .setTitle(this,
-                        getString(R.string.title_activity_setting));
-        ButterKnife.bind(this);
-        String currentPkgVersionName = ApkUtils.getCurrentPkgVersionName(app);
-
-        String strVersion = "V".concat(currentPkgVersionName) + "(" + DataSave.getInstance().getChannelName() + ")";
-        tvActSettingVersionInfo.setText(strVersion);
-        checkUpdate();
-        initData();
-    }
-
-    private void checkUpdate() {
-        HashMap<String, String> params = new HashMap<>();
-        params.put("cp_id", DataSave.getInstance().getChannelName());
-        APIRequest bannerRequest = APIRequestInstance.getReqUrl(TAG, UrlBll.VersionControlApi.APP_VERSION_INFO, params, new ResponseNetworkTask() {
-
-            @Override
-            public void onSuccess(ApiResponseOuterClass.ApiResponse apiResponse) {
-                if (apiResponse.getUpdateContentsList().isEmpty()) {
-                    mTxtTips.setText(R.string.already_lastest_version);
-                    return;
-                }
-                handleVersionCallBack(apiResponse.getUpdateContentsList().get(0));
-            }
-
-            @Override
-            public void onFail(int code, String msg) {
-                mTxtTips.setText(R.string.already_lastest_version);
-            }
-        }, null);
-        KFZSNetwork.addRequest(bannerRequest);
-    }
-
-    /**
-     * 检测到有版本列表后的回调
-     *
-     * @param updateContent
-     */
-    private void handleVersionCallBack(UpdateContentOuterClass.UpdateContent updateContent) {
-
-        strUpdateDesc = updateContent.getContent();
-        mUpdateContent = updateContent;
-        Boolean force = updateContent.getForce() == 1;
-        UpdateUtils.getInstance(this).setmUpdateSetting(updateSetting)
-                .setmIsForceUpdate(force)
-                .update(updateContent.getPackageName()
-                        , updateContent.getApkUrl(), updateContent.getVersionNum());
-    }
-
-    private void showForciblyUpdateUI(String strUpdateDesc, boolean isForceUpdate) {
-        String update_time_date = DateFormatUtils.doSecondDate(mUpdateContent.getCreatedTime());
-        new DialogUpdateFragment().init(isForceUpdate,
-                strUpdateDesc,
-                mUpdateContent.getVersionName(),
-                update_time_date,
-                mUpdateContent.getSize(),
-                new DialogUpdateFragment.CancelCallback() {
-                    @Override
-                    public void onCancel() {
-                    }
-                })
-                .show(getSupportFragmentManager(), "update");
-    }
-
-
-    private UpdateUtils.UpdateSetting updateSetting = new UpdateUtils.UpdateSetting() {
-
-        @Override
-        public void updateForce() {
-            mIsNeedUpdate = true;
-            mTxtTips.setText(R.string.found_new_version);
-            showForciblyUpdateUI(strUpdateDesc, true);
-        }
-
-        @Override
-        public void updateSilent() {
-            mIsNeedUpdate = true;
-            mTxtTips.setText(R.string.found_new_version);
-            showForciblyUpdateUI(strUpdateDesc, false);
-        }
-
-        @Override
-        public void updateNormal() {
-            mIsNeedUpdate = true;
-            mTxtTips.setText(R.string.found_new_version);
-            showForciblyUpdateUI(strUpdateDesc, false);
-        }
-
-        @Override
-        public void updateNo() {
-            mIsNeedUpdate = false;
-            mTxtTips.setText(R.string.already_lastest_version);
-        }
-
-        @Override
-        public void udateProcess(int process) {
-
-        }
-
-        @Override
-        public void updateComplete() {
-
-        }
-    };
-
-    private void initData() {
-        OkHttpUtils
-                .get()
-                .url(UrlBll.ReactNtiveApi.RN_SYS_CONF)
-                .build()
-                .execute(new StringCallback() {
-                    @Override
-                    public void onError(Call call, Exception e, int id) {
-                        //                        L.e("onError");
-                    }
-
-                    @Override
-                    public void onResponse(String response, int respenseId) {
-                        if (!response.startsWith("{")) {
-                            byte[] bytes = HexUtils.hexStr2Bytes(response);
-                            byte[] byteDecode = Kfzssafe.XByteDecode(bytes);
-                            response = new String(byteDecode);
-                        }
-                        Log.e("version_update", "response = " + response);
-                        try {
-                            JSONObject jsonObject = new JSONObject(response);
-                            int code = jsonObject.optInt("code");
-                            if (code == 200) {
-                                JSONArray dataObject = jsonObject.optJSONArray("data");
-                                if (dataObject != null && dataObject.length() > 0) {
-                                    for (int i = 0; i < dataObject.length(); i++) {
-                                        JSONObject obj = dataObject.getJSONObject(i);
-                                        TextView textView = new TextView(ActSetting.this);
-                                        textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
-                                        textView.setGravity(Gravity.CENTER);
-                                        textView.setTextColor(getResources().getColor(R.color.tv_about_text));
-                                        textView.setText(obj.optString("contact_type") + ":" + obj.optString("description"));
-                                        llContact.addView(textView);
-                                    }
-
-                                }
-                            }
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                    }
-                });
-
-    }
-
-
-    @OnClick(R.id.layout_content_setting_update)
-    public void onClick() {
-        checkUpdate();
-    }
-}

+ 19 - 18
app/src/main/java/com/kfzs/duanduan/KFZSApp.java

@@ -87,6 +87,7 @@ public class KFZSApp extends MultiDexApplication{
     }
 
     private void initUtils(boolean debug) {
+        KFZSNetwork.init(application);
         if (debug) {
             ALog.initTag();
         } else {
@@ -100,11 +101,11 @@ public class KFZSApp extends MultiDexApplication{
         DataSave dataSave = DataSave.getInstance();
         String umengKey = dataSave.getUmengKey();
         String channelName = dataSave.getChannelName();
-        Log.w("DDINIT", "API_VERSION: " + UrlBll.API_VERSION + " |CAPTCHA: " + UrlBll.CAPTCHA_DOMAIN);
-        Log.w("DDINIT", "GRAPH" + BuildConfig.DUANDUAN_GRAPH + " |GRAPH" + BuildConfig.DUANDUAN_GRAPH);
-        Log.w("DDINIT", "umengKey: " + umengKey + " |channelName: " + channelName + " |debug: " + debug);
-        Log.w("DDINIT", "wxAppId: " + BuildConfig.WX_APPID + " |wxAppSecret: " + BuildConfig.WX_APPSECRET + " |debug: " + debug);
-        Log.w("DDINIT", "wbAppId: " + BuildConfig.WB_APPID + " |wbAppSecret: " + BuildConfig.WB_APPSECRET + " |debug: " + debug);
+//        Log.w("DDINIT", "API_VERSION: " + UrlBll.API_VERSION + " |CAPTCHA: " + UrlBll.CAPTCHA_DOMAIN);
+//        Log.w("DDINIT", "GRAPH" + BuildConfig.DUANDUAN_GRAPH + " |GRAPH" + BuildConfig.DUANDUAN_GRAPH);
+//        Log.w("DDINIT", "umengKey: " + umengKey + " |channelName: " + channelName + " |debug: " + debug);
+//        Log.w("DDINIT", "wxAppId: " + BuildConfig.WX_APPID + " |wxAppSecret: " + BuildConfig.WX_APPSECRET + " |debug: " + debug);
+//        Log.w("DDINIT", "wbAppId: " + BuildConfig.WB_APPID + " |wbAppSecret: " + BuildConfig.WB_APPSECRET + " |debug: " + debug);
         MobclickAgent.UMAnalyticsConfig umAnalyticsConfig = new MobclickAgent.UMAnalyticsConfig(application, umengKey, channelName);
         MobclickAgent.startWithConfigure(umAnalyticsConfig);
         MobclickAgent.setDebugMode(debug);
@@ -113,20 +114,20 @@ public class KFZSApp extends MultiDexApplication{
         //Log.e("JPushRegzid", JPushInterface.getRegistrationID(this));
         MobclickAgent.setCatchUncaughtExceptions(!debug);
         MobclickAgent.enableEncrypt(true);
-        //um Share
-        Config.DEBUG = true;
-        QueuedWork.isUseThreadPool = false;
-        UMShareAPI.get(this);
-        //end
-        KFZSNetwork.init(application);
-        initShareSDK();
-    }
 
-    //各个平台的配置,建议放在全局Application或者程序入口
-    private void initShareSDK() {
-        PlatformConfig.setWeixin(BuildConfig.WX_APPID, BuildConfig.WX_APPSECRET);
-        PlatformConfig.setSinaWeibo(BuildConfig.WB_APPID, BuildConfig.WB_APPSECRET, "http://sns.whalecloud.com");
-        PlatformConfig.setQQZone("100424468", "c7394704798a158208a74ab60104f0ba");
+//        //um Share
+//        Config.DEBUG = true;
+//        QueuedWork.isUseThreadPool = false;
+//        UMShareAPI.get(this);
+//        //end
+//        initShareSDK();
+//    }
+//
+//    //各个平台的配置,建议放在全局Application或者程序入口
+//    private void initShareSDK() {
+//        PlatformConfig.setWeixin(BuildConfig.WX_APPID, BuildConfig.WX_APPSECRET);
+//        PlatformConfig.setSinaWeibo(BuildConfig.WB_APPID, BuildConfig.WB_APPSECRET, "http://sns.whalecloud.com");
+//        PlatformConfig.setQQZone("100424468", "c7394704798a158208a74ab60104f0ba");
     }
 
     /**

+ 0 - 11
app/src/main/java/com/kfzs/duanduan/bll/UrlBll.java

@@ -56,14 +56,8 @@ public final class UrlBll {
      */
     public static final String API_DOMAIN = PROTOCOL_HTTP + BuildConfig.API_DOMAIN;
 
-    public static final String API_RN_HOST = PROTOCOL_HTTP + BuildConfig.RN_DOMAIN;
-
-    public static final String API_RN_VERSION = API_RN_HOST + "/v1";
-
     public static final String API_VERSION = API_DOMAIN + "/v1";
 
-    public static final String API_RN_VERSION_V2 = API_RN_HOST + "/v2";
-
     public static final String API_VERSION_V2 = API_DOMAIN + "/v2";
 
     public final class IntentKey {
@@ -160,11 +154,6 @@ public final class UrlBll {
         public static final String GAME_ALL_BOOK = API_VERSION + "/bookgame/all";
     }
 
-    public static class ReactNtiveApi {
-        public static final String RN_VERSION_INFO = API_RN_VERSION + "/version";
-        public static final String RN_SYS_CONF = API_RN_VERSION + "/system_conf";
-    }
-
     public static class GameApi {
         public static final String GAME = API_VERSION + "/game/";
         public static final String GAME_GUESS = API_VERSION + "/game/guess?";

+ 0 - 62
app/src/main/java/com/kfzs/duanduan/fragment/FgContinuePlay.java

@@ -53,68 +53,6 @@ public class FgContinuePlay extends BaseCompatFragment {
 
         emptyFg = mContentView.findViewById(R.id.empty_fg);
         fgtContinuePlayTv = mContentView.findViewById(R.id.fgt_continue_play_tv);
-
-        if (!CheckUtils.getInstance().isLogin()) {
-//            G.showToast(R.string.toast_user_login_pre);
-//            SkipUtils.getInstance().goLogin(getActivity());
-            return;
-        }
-        initData(gameId);
-
-    }
-
-    /**
-     *
-     * @param gameId
-     */
-    private void initData(String gameId){
-
-        doNetworkBorrowContext(gameId);
-    }
-
-    /**
-     * 游戏详情请求借着玩
-     * @param sGameId
-     */
-    private void doNetworkBorrowContext(String sGameId) {
-
-        String reqUrl = UrlBll.API_RN_VERSION + "/game/" + "integral"+ "/" + sGameId;
-
-        APIRequestV2 apiRequestV2 = APIRequestInstance.getReqUrlV2(reqUrl,
-                reqUrl, null, new Response.Listener<BaseMsg>() {
-                    @Override
-                    public void onResponse(BaseMsg baseMsg) {
-                        String s = baseMsg.getMsg();
-                        int code = baseMsg.getCode();
-                        switch (code){
-                            case 400:
-//                                G.showToast("请绑定手机号");
-                                emptyFg.setVisibility(View.VISIBLE);
-                                return;
-                            case 200:
-                                BorrowPlayIntegral u = baseMsg.getData(BorrowPlayIntegral.class);
-                                if(u != null){
-                                    StringBuffer stringBuffer = new StringBuffer();
-                                    stringBuffer.append("积分返还规则:"+"\n\n")
-                                            .append("充"+u.getFirstGearPay()+"元,")
-                                            .append("送"+u.getFirstGearReturn()+"积分"+"\n\n")
-                                            .append("充"+u.getSecondGearPay()+"元,")
-                                            .append("送"+u.getSecondGearReturn()+"积分"+"\n\n")
-                                            .append("充"+u.getThirdGearPay()+"元,")
-                                            .append("送"+u.getThirdGearTeturn()+"积分"+"\n\n");
-                                    fgtContinuePlayTv.setText(stringBuffer.toString()+"");
-                                    emptyFg.setVisibility(View.GONE);
-                                }
-                                break;
-                            default:
-                                emptyFg.setVisibility(View.VISIBLE);
-
-                                break;
-                        }
-                    }
-                }, null);
-        KFZSNetwork.addRequest(apiRequestV2);
-
     }
 
 

+ 1 - 4
app/src/main/java/com/kfzs/duanduan/fragment/FgtMainMine.java

@@ -12,12 +12,10 @@ import com.bumptech.glide.Glide;
 import com.kfzs.android.view.KFGlideRoundTransform;
 import com.kfzs.duanduan.ActFeedback;
 import com.kfzs.duanduan.ActPersonPage;
-import com.kfzs.duanduan.ActSetting;
 import com.kfzs.duanduan.ActSimple;
 import com.kfzs.duanduan.BaseCompatFragment;
 import com.kfzs.duanduan.G;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
-import com.kfzs.duanduan.KFZSApp;
 import com.sheep.jiuyan.samllsheep.R;
 import com.kfzs.duanduan.data.graph.provider.current.Current;
 import com.kfzs.duanduan.datashare.DDProviderHelper;
@@ -176,8 +174,7 @@ public class FgtMainMine extends BaseCompatFragment implements View.OnClickListe
                 goRn("我的奖励");
                 break;
             case R.id.lay_fgt_main_mine_about:
-                intent = new Intent(getActivity(), ActSetting.class);
-                startActivity(intent);
+                G.showToast("该功能正在开发中");
                 break;
             case R.id.lay_fgt_main_mine_advice:
                 // 意见反馈

+ 0 - 251
app/src/main/java/com/kfzs/duanduan/react/version/VersionUpdate.java

@@ -1,251 +0,0 @@
-package com.kfzs.duanduan.react.version;
-
-import android.app.Instrumentation;
-import android.content.Context;
-import android.util.Log;
-import android.util.Patterns;
-import android.view.KeyEvent;
-import android.webkit.URLUtil;
-
-import com.kfzs.appstore.utils.string.HexUtils;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
-import com.kfzs.duanduan.KFZSApp;
-import com.kfzs.duanduan.bll.UrlBll;
-import com.kfzs.duanduan.utils.dlg.FileUtils;
-import com.zhy.http.okhttp.OkHttpUtils;
-import com.zhy.http.okhttp.callback.StringCallback;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import go.kfzssafe.Kfzssafe;
-import okhttp3.Call;
-import rx.Observable;
-import rx.functions.Action1;
-import rx.schedulers.Schedulers;
-
-
-/**
- * Created by Administrator on 2017/5/25.
- */
-
-public class VersionUpdate {
-    /**
-     * 检查并更新游戏交易号rn项目的bundle文件
-     */
-    public void updateRnBundle() {
-        OkHttpUtils
-                .get()
-                .url(UrlBll.ReactNtiveApi.RN_VERSION_INFO+"?flag=2")
-//                .url("http://test.shopapi.shouyouquan.com/v1/version")//测试,正式服用测试服来更新
-                .build()
-                .execute(new StringCallback() {
-                    @Override
-                    public void onError(Call call, Exception e, int id) {
-//                        L.e("onError");
-                    }
-
-                    @Override
-                    public void onResponse(String response, int respenseId) {
-                        if(!response.contains("{")) {
-                            byte[] bytes = HexUtils.hexStr2Bytes(response);
-                            byte[] byteDecode = Kfzssafe.XByteDecode(bytes);
-                            response = new String(byteDecode);
-                        }
-                        Log.e("version_update", "response = " + response);
-                        try {
-                            JSONObject jsonObject = new JSONObject(response);
-                            int code = jsonObject.optInt("code");
-                            if (code == 200) {
-                                JSONObject dataObject = jsonObject.optJSONObject("data");
-                                if (dataObject != null) {
-                                    String url = dataObject.optString("url");
-                                    int id = dataObject.optInt("id");
-                                    int version = dataObject.optInt("version");
-                                    if (checkVersion(id, version, url)) {
-                                        downloadFile(url, id, version);
-                                    } else {
-                                        Log.e("version_update", "不更新");
-                                    }
-                                    Log.e("version_update", "url = " + url);
-                                }
-                            }
-                        } catch (JSONException e) {
-                            e.printStackTrace();
-                        } catch (Exception e){
-                            e.printStackTrace();
-                        }
-                    }
-                });
-    }
-
-    private long time;
-
-    private void downloadFile(final String url, final int id, final int version) {
-        DownloadUtil.get().download(url, KFZSApp.getInstance().getExternalCacheDir().getAbsolutePath(), new DownloadUtil.OnDownloadListener() {
-            @Override
-            public void onDownloadSuccess(final String filePath) {
-                Log.e("version_update", filePath);
-                Observable.just(1).observeOn(Schedulers.io()).subscribe(new Action1<Integer>() {
-                    @Override
-                    public void call(Integer integer) {
-//                        System.out.println("onDownloadSuccess在线程" + Thread.currentThread().getName() + "中");
-                        decompression(filePath, KFZSApp.getInstance().getExternalCacheDir().getAbsolutePath());
-                        if (VersionUpdate.hasBundleFile()) {
-        //                    EventBus.getDefault().post(BigEvent.get().setEventTypes(EventTypes.WEB_UPDATE_RN));
-                            //保存最新版本信息
-                            android.content.SharedPreferences sp = KFZSApp.getInstance().getSharedPreferences("rn_version", Context.MODE_PRIVATE);
-                            android.content.SharedPreferences.Editor edit = sp.edit();
-                            edit.putInt("id", id);
-                            edit.putInt("version", version);
-                            edit.putString("url", url);
-                            edit.apply();
-                        } else {
-                            Log.e("version_update", "解压失败");
-                        }
-                    }
-                });
-            }
-
-            @Override
-            public void onDownloading(int progress) {
-
-            }
-
-            @Override
-            public void onDownloadFailed() {
-
-            }
-        });
-    }
-
-
-    /**
-     * 解压
-     */
-    private void decompression(String filePath, String dirPath) {
-        decompression(filePath, dirPath, true);
-    }
-
-
-    /**
-     * 解压
-     *
-     * @param filePath
-     * @param dirPath
-     * @param isNotCover 是否不覆盖相同名字且大小一样的文件
-     */
-    private void decompression(String filePath, String dirPath, boolean isNotCover) {
-        time = System.currentTimeMillis();
-        try {
-            ZipInputStream inZip = new ZipInputStream(new FileInputStream(filePath));
-            ZipEntry zipEntry;
-            String szName;
-            try {
-                while ((zipEntry = inZip.getNextEntry()) != null) {
-                    szName = zipEntry.getName();
-                    if (zipEntry.isDirectory()) {
-                        szName = szName.substring(0, szName.length() - 1);
-                        File folder = new File(dirPath, szName);
-                        folder.mkdirs();
-                    } else {
-                        File file1 = new File(dirPath, szName);
-                        long length = file1.length();
-                        long size = zipEntry.getSize();
-//                        long l3 = zipEntry.getCompressedSize();
-                        if (isNotCover && length == size) {
-                            continue;
-                        }
-                        file1.deleteOnExit();
-                        boolean s = file1.createNewFile();
-                        FileOutputStream fos = new FileOutputStream(file1);
-                        int len;
-                        byte[] buffer = new byte[1024];
-                        while ((len = inZip.read(buffer)) != -1) {
-                            fos.write(buffer, 0, len);
-                            fos.flush();
-                        }
-                        fos.close();
-                    }
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-            inZip.close();
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        long newTime = System.currentTimeMillis();
-        Log.e("---zzz---", "time = " + time + ",newTime = " + newTime + "," + (newTime - time));
-    }
-
-    /**
-     * 返回false代表不是最新版本
-     *
-     * @param id
-     * @param version
-     * @return
-     */
-    private boolean checkVersion(int id, int version, String url) {
-        if(!Patterns.WEB_URL.matcher(url).matches() && !URLUtil.isValidUrl(url)){//无效的url
-            return false;
-        }
-        android.content.SharedPreferences sp = KFZSApp.getInstance().getSharedPreferences("rn_version", Context.MODE_PRIVATE);
-        int oldId = sp.getInt("id", -1);
-        int oldVersion = sp.getInt("version", -1);
-        String oldUrl = sp.getString("url", "");
-        return BuildConfig.DEBUG || id != oldId || oldVersion != version || !oldUrl.equals(url);
-//        return true;
-    }
-
-    public static final String BUNDLE_FILE_NAME = "index.android.bundle";
-
-    public static boolean hasBundleFile() {
-        File file = new File(KFZSApp.getInstance().getExternalCacheDir(), BUNDLE_FILE_NAME);
-        return file.exists() && file.length() > 0;
-    }
-
-    public static String getJSBundleFile() {
-        File file = new File(KFZSApp.getInstance().getExternalCacheDir(), BUNDLE_FILE_NAME);
-        return file.getAbsolutePath();
-    }
-    //删除rn包
-    public static void clearRnBundle() {
-        Observable.just(1).observeOn(Schedulers.io()).subscribe(new Action1<Integer>() {
-                    @Override
-                    public void call(Integer integer) {
-//                        System.out.println("clearRnBundle在线程" + Thread.currentThread().getName() + "中");
-                        String[] dirNames = {"drawable-xxxhdpi","drawable-xxhdpi","drawable-xhdpi","drawable-mdpi","drawable-hdpi"};
-                        for (String dirName : dirNames) {
-                            File dir = new File(KFZSApp.getInstance().getExternalCacheDir(), dirName);
-//                            print(dir);
-                            FileUtils.deleteFiles(dir);
-//                            print(dir);
-                        }
-                        String[] fileNames = {"index.android.bundle.meta","index.android.bundle"};
-                        for (String fileName : fileNames) {
-                            File file = new File(KFZSApp.getInstance().getExternalCacheDir(), fileName);
-//                            print(file);
-                            file.delete();
-//                            print(file);
-                        }
-                    }
-                });
-
-    }
-
-    private static void print(File dir) {
-        System.out.println("文件"+dir.getAbsoluteFile()+(dir.exists()?"存在":"不存在"));
-    }
-}

+ 0 - 3
app/src/main/java/com/kfzs/duanduan/utils/dlg/UpdateUtils.java

@@ -7,7 +7,6 @@ import android.net.Uri;
 import android.os.Environment;
 import android.text.TextUtils;
 
-import com.kfzs.duanduan.react.version.VersionUpdate;
 
 import java.io.BufferedInputStream;
 import java.io.File;
@@ -138,8 +137,6 @@ public class UpdateUtils {
      * @return 是否启动此任务
      */
     public boolean startTask() {
-        //删除rn包,这样,即使安装成功后,app没有更新到最新的rn包,也不会使用到旧的rn包
-        VersionUpdate.clearRnBundle();
         if (mIsNeedUpdate) {
             mIntProcess = 0;
             new Thread(new Runnable() {

+ 0 - 12
app/src/main/java/com/kfzs/duanduan/wxapi/WXEntryActivity.java

@@ -1,12 +0,0 @@
-package com.kfzs.duanduan.wxapi;
-
-
-import com.umeng.weixin.callback.WXCallbackActivity;
-
-//import com.umeng.socialize.weixin.view.WXCallbackActivity;
-
-public class WXEntryActivity extends WXCallbackActivity {
-
-
-
-}

+ 0 - 2
app/src/main/java/com/sheep/jiuyan/samllsheep/BaseApplication.java

@@ -1,7 +1,5 @@
 package com.sheep.jiuyan.samllsheep;
 
-import android.app.Application;
-import android.support.multidex.MultiDexApplication;
 
 import com.kfzs.duanduan.KFZSApp;
 import com.umeng.commonsdk.UMConfigure;

+ 6 - 0
app/src/main/res/values/dd_styles.xml

@@ -354,4 +354,10 @@
         <item name="android:textSize">@dimen/app_size_tv_small</item>
     </style>
 
+    <style name="mine_interval">
+        <item name="android:layout_marginLeft">8dp</item>
+    </style>
+    <style name="TablLayoutTextStyle">
+        <item name="android:textSize">14sp</item>
+    </style>
 </resources>

+ 16 - 15
app/src/main/res/values/umeng_socialize_colors.xml

@@ -1,18 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?><resources>
 
-
-
-	<!--<color name="umeng_socialize_list_item_bgcolor">#FFFFFF</color>-->
-	<!--<color name="umeng_socialize_divider">#E6E6E6</color>-->
-	<!--<color name="umeng_socialize_text_time">#999999</color>-->
-	<!--<color name="umeng_socialize_text_title">#464f61</color>-->
-	<!--<color name="umeng_socialize_text_friends_list">#959696</color>-->
-	<!--<color name="umeng_socialize_text_share_content">#666666</color>-->
-	<!--<color name="umeng_socialize_ucenter_bg">#EEEEEE</color>-->
-	<!--<color name="umeng_socialize_text_ucenter">#595959</color>-->
-	<!--<color name="umeng_socialize_edit_bg">#C4C4C4</color>-->
-	<!--<color name="umeng_socialize_grid_divider_line">#F8F8F8</color>-->
-	<!--<color name="umeng_socialize_web_bg">#F4F4F4</color>-->
-	<!--<color name="umeng_socialize_shareactivity">#D4E0E5</color>-->
-	<!--<color name="umeng_socialize_shareactivitydefault">#ffffff</color>-->
+	<color name="umeng_socialize_comments_bg">#F4F4F4</color>
+	<color name="umeng_socialize_color_group">#2c3035</color>
+	<color name="umeng_socialize_list_item_textcolor">#333333</color>
+	<color name="umeng_socialize_list_item_bgcolor">#FFFFFF</color>
+	<color name="umeng_socialize_divider">#E6E6E6</color>
+	<color name="umeng_socialize_text_time">#999999</color>
+	<color name="umeng_socialize_text_title">#464f61</color>
+	<color name="umeng_socialize_text_friends_list">#959696</color>
+	<color name="umeng_socialize_text_share_content">#666666</color>
+	<color name="umeng_socialize_ucenter_bg">#EEEEEE</color>
+	<color name="umeng_socialize_text_ucenter">#595959</color>
+	<color name="umeng_socialize_edit_bg">#C4C4C4</color>
+	<color name="umeng_socialize_grid_divider_line">#F8F8F8</color>
+	<color name="umeng_socialize_web_bg">#F4F4F4</color>
+	<color name="umeng_socialize_shareactivity">#D4E0E5</color>
+	<color name="umeng_socialize_shareactivitydefault">#ffffff</color>
 </resources>