|
@@ -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();
|