Browse Source

no message

wjk 4 years ago
parent
commit
a9612c71e9

+ 1 - 1
home/src/main/code/com/wdkl/ncs/android/component/home/activity/WatchHome2Activity.kt

@@ -121,7 +121,7 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
         Constants.imei = Util().getIMEI(this)
         Constants.imei = Util().getIMEI(this)
         Log.i(TAG, "IMEI " + Util().getIMEI(this))
         Log.i(TAG, "IMEI " + Util().getIMEI(this))
 
 
-        Constants.mac = NetHelper.getInstance().macAddress
+//        Constants.mac = NetHelper.getInstance().macAddress
         //Constants.mac = "4C:C0:0A:8E:D6:BB"
         //Constants.mac = "4C:C0:0A:8E:D6:BB"
         Log.i(TAG, "mac " + Constants.mac)
         Log.i(TAG, "mac " + Constants.mac)
         tv_mac_addr.text = "MAC地址: " + Constants.mac + "\n" + "IMEI号:" + Constants.imei
         tv_mac_addr.text = "MAC地址: " + Constants.mac + "\n" + "IMEI号:" + Constants.imei

+ 21 - 16
home/src/main/code/com/wdkl/ncs/android/component/home/helper/AppUpdateHelper.java

@@ -18,6 +18,8 @@ import java.io.PrintWriter;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.Method;
 
 
+import static com.blankj.utilcode.util.ActivityUtils.startActivity;
+
 public class AppUpdateHelper {
 public class AppUpdateHelper {
     private final static String TAG = "AppUpdate";
     private final static String TAG = "AppUpdate";
 
 
@@ -53,31 +55,34 @@ public class AppUpdateHelper {
 
 
 
 
 //        if (installApp(context.getPackageName(), path)) {
 //        if (installApp(context.getPackageName(), path)) {
-        if (rootSilenceInstall(path)) {
-            Log.d(TAG, "安装成功");
-            if (callBack != null) {
-                callBack.onSuccess();
-            }
-        } else {
-            Log.d(TAG, "安装失败");
-            if (callBack != null) {
-                callBack.onFailed();
-            }
-        }
-
-//        if (silentInstall(context, path)) {
-//            Log.d(TAG, "app 安装成功");
+//        if (rootSilenceInstall(path)) {
+//            Log.d(TAG, "安装成功");
 //            if (callBack != null) {
 //            if (callBack != null) {
 //                callBack.onSuccess();
 //                callBack.onSuccess();
 //            }
 //            }
+//        } else {
+//            Log.d(TAG, "安装失败");
+//            if (callBack != null) {
+//                callBack.onFailed();
+//            }
 //        }
 //        }
 
 
-//        if (installAPP(path)) {
-//            Log.d(TAG, "安装成功");
+//        if (silentInstall(context, path)) {
+//            Log.d(TAG, "app 安装成功");
 //            if (callBack != null) {
 //            if (callBack != null) {
 //                callBack.onSuccess();
 //                callBack.onSuccess();
 //            }
 //            }
 //        }
 //        }
+        Uri uri = Uri.fromParts("package", "com.wdkl.app.ncs", null);
+        Intent intent = new Intent(Intent.ACTION_DELETE, uri);
+        startActivity(intent);
+
+        if (installAPP(path)) {
+            Log.d(TAG, "安装成功");
+            if (callBack != null) {
+                callBack.onSuccess();
+            }
+        }
     }
     }