ソースを参照

修改app无法自动升级问题

weizhengliang 3 年 前
コミット
d6f0be1ad0

+ 3 - 2
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/helper/AppUpdateHelper.java

@@ -25,7 +25,7 @@ public class AppUpdateHelper {
     /**
      * 下载的APK文件绝对路径
      */
-    public static final String FILE_APK_PATH = Environment.getExternalStorageDirectory() + "/CallingBed";
+    public static final String FILE_APK_PATH = "storage/sdcard0/CallingBed";
     /**
      * 下载的APK文件的文件名
      */
@@ -44,6 +44,7 @@ public class AppUpdateHelper {
 
         String path = FILE_APK_PATH + "/" + FILE_APK_NAME;
         //if (installApp(context.getPackageName(), path)) {
+        Log.d(TAG, "update apk path: " + path);
         if (rootSilenceInstall(path)) {
             Log.d(TAG, "安装成功");
             if (callBack != null) {
@@ -134,7 +135,7 @@ public class AppUpdateHelper {
         Process process;
         PrintWriter printWriter;
         try {
-            process = Runtime.getRuntime().exec("su");
+            process = Runtime.getRuntime().exec("sh");
             printWriter = new PrintWriter(process.getOutputStream());
             printWriter.println("pm install -r " + path);
             printWriter.flush();

+ 1 - 1
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/helper/HttpHelper.java

@@ -93,7 +93,7 @@ public class HttpHelper {
                         //int progress = (int) (sum * 1.0f / total * 100);
                         float sp = (float) sum / (float) total;
                         int progress = (int) (sp * 100);
-                        Log.d("download", "progress==" + progress);
+                        //Log.d("download", "progress==" + progress);
                         if (listener != null) {
                             listener.onDownloading(progress);// 下载中
                         }

callingbed/src/main/java/com/wdkl/app/ncs/callingbed/sip/SipHelper.java → callingbed/src/main/java/com/wdkl/app/ncs/callingbed/sip/SipHelper.java.bak


+ 2 - 2
common/src/main/code/com/wdkl/ncs/android/lib/utils/UUID.kt

@@ -34,7 +34,7 @@ class UUID {
         @SuppressLint("MissingPermission", "WifiManagerLeak", "HardwareIds")
         private fun get() : String{
             //refreshUUID("abcd1234")
-            var macAddress = ACache.get(BaseApplication.appContext).getAsString("UUID")
+            /*var macAddress = ACache.get(BaseApplication.appContext).getAsString("UUID")
             if (macAddress == null){
                 val wifiManager :WifiManager? = BaseApplication.appContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
                 val info = wifiManager?.connectionInfo
@@ -46,7 +46,7 @@ class UUID {
                 if (null != info) {
                     macAddress = info.macAddress
                 }
-            }
+            }*/
             return "0123456789"
         }