JonaNorman 1 tahun lalu
induk
melakukan
45a2342c47

+ 4 - 0
app/build.gradle

@@ -18,6 +18,10 @@ android {
         }
     }
 
+    aaptOptions {
+        noCompress "apk"
+    }
+
     buildTypes {
         release {
             minifyEnabled true

+ 54 - 14
app/src/main/java/com/norman/webviewup/demo/MainActivity.java

@@ -3,7 +3,6 @@ package com.norman.webviewup.demo;
 import android.app.Activity;
 import android.content.DialogInterface;
 import android.content.Intent;
-import android.content.pm.PackageInfo;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.util.Log;
@@ -13,10 +12,13 @@ import android.widget.TextView;
 import android.widget.Toast;
 
 
+import androidx.annotation.Nullable;
 import androidx.appcompat.app.AlertDialog;
 
 import com.norman.webviewup.lib.UpgradeCallback;
 import com.norman.webviewup.lib.WebViewUpgrade;
+import com.norman.webviewup.lib.source.UpgradeAssetSource;
+import com.norman.webviewup.lib.source.UpgradeSource;
 import com.norman.webviewup.lib.source.download.UpgradeDownloadSource;
 import com.norman.webviewup.lib.util.ProcessUtils;
 
@@ -37,23 +39,33 @@ public class MainActivity extends Activity implements UpgradeCallback {
                 new UpgradeInfo(
                         "com.google.android.webview",
                         "122.0.6261.64",
-                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.google.android.webview_122.0.6261.64_armeabi-v7a.zip"),
+                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.google.android.webview_122.0.6261.64_armeabi-v7a.zip",
+                        "网络"),
                 new UpgradeInfo(
                         "com.android.webview",
                         "113.0.5672.136",
-                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.android.webview_113.0.5672.13_armeabi-v7a.zip"),
+                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.android.webview_113.0.5672.13_armeabi-v7a.zip",
+                        "网络"),
                 new UpgradeInfo(
                         "com.huawei.webview",
                         "14.0.0.331",
-                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.huawei.webview_14.0.0.331_arm64-v8a_armeabi-v7a.zip"),
+                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.huawei.webview_14.0.0.331_arm64-v8a_armeabi-v7a.zip",
+                        "网络"),
                 new UpgradeInfo(
                         "com.android.chrome",
                         "122.0.6261.43",
-                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.android.chrome_122.0.6261.64_armeabi-v7a.zip"),
+                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.android.chrome_122.0.6261.64_armeabi-v7a.zip",
+                        "网络"),
 
                 new UpgradeInfo("com.amazon.webview.chromium",
                         "118-5993-tv.5993.155.51",
-                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.amazon.webview.chromium_118-5993-tv.5993.155.51_armeabi-v7a.zip")
+                        "https://mirror.ghproxy.com/https://raw.githubusercontent.com/JonaNorman/ShareFile/main/com.amazon.webview.chromium_118-5993-tv.5993.155.51_armeabi-v7a.zip",
+                        "网络"),
+
+                new UpgradeInfo("com.amazon.webview.chromium",
+                        "118-5993-tv.5993.155.51",
+                        "com.webview.chromium_118-5993-tv.5993.155.51_armeabi-v7a.apk",
+                        "内置")
 
 
         ));
@@ -140,7 +152,7 @@ public class MainActivity extends Activity implements UpgradeCallback {
     @Override
     public void onUpgradeError(Throwable throwable) {
         Toast.makeText(getApplicationContext(), "webView upgrade fail", Toast.LENGTH_SHORT).show();
-        Log.v("MainActivity", "message:" + throwable.getMessage() + "\nstackTrace:" + Log.getStackTraceString(throwable));
+        Log.e("MainActivity", "message:" + throwable.getMessage() + "\nstackTrace:" + Log.getStackTraceString(throwable));
         updateUpgradeWebViewStatus();
     }
 
@@ -164,12 +176,11 @@ public class MainActivity extends Activity implements UpgradeCallback {
                 } else {
                     UpgradeInfo upgradeInfo = upgradeInfoList.get(which);
                     selectUpgradeInfo = upgradeInfo;
-                    UpgradeDownloadSource upgradeDownloadSource = new UpgradeDownloadSource(
-                            getApplicationContext(),
-                            upgradeInfo.url,
-                            new File(getApplicationContext().getFilesDir(), upgradeInfo.packageName + "/" + upgradeInfo.versionName + ".apk")
-                    );
-                    WebViewUpgrade.upgrade(upgradeDownloadSource);
+                    UpgradeSource upgradeSource = getUpgradeSource(upgradeInfo);
+                    if (upgradeSource == null){
+                        return;
+                    }
+                    WebViewUpgrade.upgrade(upgradeSource);
                     updateUpgradeWebViewPackageInfo();
                     updateUpgradeWebViewStatus();
                 }
@@ -179,6 +190,25 @@ public class MainActivity extends Activity implements UpgradeCallback {
         dialog.show();
     }
 
+    @Nullable
+    private UpgradeSource getUpgradeSource(UpgradeInfo upgradeInfo) {
+        UpgradeSource upgradeSource = null;
+        if (upgradeInfo.extraInfo.equals("网络")){
+            upgradeSource = new UpgradeDownloadSource(
+                    getApplicationContext(),
+                    upgradeInfo.url,
+                    new File(getApplicationContext().getFilesDir(), upgradeInfo.packageName + "/" + upgradeInfo.versionName + ".apk")
+            );
+        }else if (upgradeInfo.extraInfo.equals("内置")){
+            upgradeSource = new UpgradeAssetSource(
+                    getApplicationContext(),
+                    upgradeInfo.url,
+                    new File(getApplicationContext().getFilesDir(), upgradeInfo.packageName + "/" + upgradeInfo.versionName + ".apk")
+            );
+        }
+        return upgradeSource;
+    }
+
 
     private void updateSystemWebViewPackageInfo() {
         String systemWebViewPackageName = WebViewUpgrade.getSystemWebViewPackageName();
@@ -232,18 +262,28 @@ public class MainActivity extends Activity implements UpgradeCallback {
 
     static class UpgradeInfo {
 
-        public UpgradeInfo(String packageName, String versionName, String url) {
+        public UpgradeInfo(String packageName, String versionName, String url, String extraInfo) {
             this.title = packageName + "\n" + versionName;
+            this.extraInfo = !TextUtils.isEmpty(extraInfo)?extraInfo:"";
+            if (!extraInfo.isEmpty()) {
+                this.title = this.title + "\n" + extraInfo;
+            }
             this.url = url;
             this.packageName = packageName;
             this.versionName = versionName;
         }
 
+        public UpgradeInfo(String packageName, String versionName, String url) {
+
+            this(packageName, versionName, url, "");
+        }
+
         String title;
         String url;
         String packageName;
 
         String versionName;
+        String extraInfo;
     }
 
 

+ 2 - 2
core/src/main/java/com/norman/webviewup/lib/WebViewReplace.java

@@ -25,7 +25,7 @@ public class WebViewReplace {
 
     private static PackageInfo REPLACE_WEB_VIEW_PACKAGE_INFO;
 
-    public synchronized static void replace(Context context, String apkPath) throws WebViewReplaceException {
+    public synchronized static void replace(Context context, String apkPath,String libsPath) throws WebViewReplaceException {
         PackageManagerServiceHook managerHook = null;
         WebViewUpdateServiceHook updateServiceHook = null;
         try {
@@ -54,7 +54,7 @@ public class WebViewReplace {
                     throw new WebViewReplaceException("current system version " + sdkVersion + " is smaller than the minimum version " + applicationInfo.minSdkVersion + " required by the apk  " + apkPath);
                 }
             }
-            managerHook = new PackageManagerServiceHook(context, packageInfo.packageName, apkPath);
+            managerHook = new PackageManagerServiceHook(context, packageInfo.packageName, apkPath,libsPath);
             updateServiceHook = new WebViewUpdateServiceHook(context, packageInfo.packageName);
             managerHook.hook();
             updateServiceHook.hook();

+ 3 - 1
core/src/main/java/com/norman/webviewup/lib/WebViewUpgrade.java

@@ -90,7 +90,9 @@ public class WebViewUpgrade {
                 public void onPrepareSuccess(UpgradeSource webViewSource) {
                     HandlerUtils.runInMainThread(() -> {
                         try {
-                            WebViewReplace.replace(webViewSource.getContext(), webViewPathSource.getPath());
+                            WebViewReplace.replace(webViewSource.getContext(),
+                                    webViewPathSource.getApkPath(),
+                                    webViewPathSource.getLibsPath());
                             callProcessCallback(1.0f);
                             callCompleteCallback();
                         } catch (WebViewReplaceException e) {

+ 32 - 27
core/src/main/java/com/norman/webviewup/lib/hook/PackageManagerServiceHook.java

@@ -22,9 +22,11 @@ import com.norman.webviewup.lib.service.interfaces.IPackageManager;
 import com.norman.webviewup.lib.service.interfaces.IServiceManager;
 import com.norman.webviewup.lib.service.binder.ProxyBinder;
 import com.norman.webviewup.lib.service.proxy.PackageManagerProxy;
+import com.norman.webviewup.lib.util.FileUtils;
 import com.norman.webviewup.lib.util.ProcessUtils;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -40,15 +42,19 @@ public class PackageManagerServiceHook extends BinderHook {
 
     private final String apkPath;
 
+    private final String libsPath;
+
     private Map<String, IBinder> binderCacheMap;
 
 
     public PackageManagerServiceHook(@NonNull Context context,
                                      @NonNull String packageName,
-                                     @NonNull String apkPath) {
+                                     @NonNull String apkPath,
+                                     @NonNull String libsPath) {
         this.context = context;
         this.webViewPackageName = packageName;
         this.apkPath = apkPath;
+        this.libsPath = libsPath;
     }
 
     private final PackageManagerProxy proxy = new PackageManagerProxy() {
@@ -76,49 +82,48 @@ public class PackageManagerServiceHook extends BinderHook {
                     flags &= ~PackageManager.GET_SIGNATURES;
                     packageInfo = context.getPackageManager().getPackageArchiveInfo(apkPath, flags);
                 }
+                if (packageInfo == null) {
+                    throw new RuntimeException("apkPath is not valid  " + apkPath);
+                }
                 boolean is64Bit = ProcessUtils.is64Bit();
                 String[] supportBitAbis = is64Bit ? Build.SUPPORTED_64_BIT_ABIS : Build.SUPPORTED_32_BIT_ABIS;
                 Arrays.sort(supportBitAbis, Collections.reverseOrder());
                 String nativeLibraryDir = null;
+
+                File libsDir = new File(libsPath);
+                if (!FileUtils.exist(libsDir)) {
+                    throw new RuntimeException("libsDir not exist  " + libsPath);
+                }
+                String[] list = libsDir.list();
+                if (list == null){
+                    throw new RuntimeException("abi dir  not exist in " + libsPath);
+                }
                 String cpuAbi = null;
-                ZipFile zipFile;
-                try {
-                    zipFile = new ZipFile(new File(apkPath));
-                    Enumeration<? extends ZipEntry> entries = zipFile.entries();
-                    while (entries.hasMoreElements()) {
-                        ZipEntry entry = entries.nextElement();
-                        String entryName = entry.getName();
-                        if (entryName.contains("../") || entry.isDirectory()) {
-                            continue;
-                        }
-                        if (!entryName.startsWith("lib/") && !entryName.endsWith(".so")) {
-                            continue;
-                        }
-                        String[] split = entry.getName().split("/");
-                        if (split.length < 2) {
-                            continue;
-                        }
-                        String abi = split[1];
-                        if (Arrays.binarySearch(supportBitAbis, abi) >= 0) {
-                            nativeLibraryDir = apkPath + "!/lib/" + abi;
-                            cpuAbi = abi;
-                            break;
-                        }
+                for (String name : list) {
+                    if (Arrays.binarySearch(supportBitAbis, name) >= 0) {
+                        cpuAbi = name;
+                        nativeLibraryDir = new File(libsDir, name).getAbsolutePath();
+                        break;
                     }
-                } catch (Throwable ignore) {
-
                 }
 
                 if (nativeLibraryDir == null) {
                     throw new NullPointerException("unable to find supported abis "
                             + Arrays.toString(supportBitAbis)
-                            + " in apk " + apkPath);
+                            + " in dir " + libsPath);
                 }
                 try {
                     IApplicationInfo iApplicationInfo = RuntimeAccess.objectAccess(IApplicationInfo.class, packageInfo.applicationInfo);
                     iApplicationInfo.setPrimaryCpuAbi(cpuAbi);
                 } catch (Throwable ignore) {
 
+                }
+
+                try {
+                    IApplicationInfo iApplicationInfo = RuntimeAccess.objectAccess(IApplicationInfo.class, packageInfo.applicationInfo);
+                    iApplicationInfo.setNativeLibraryRootDir(libsPath);
+                } catch (Throwable ignore) {
+
                 }
                 packageInfo.applicationInfo.nativeLibraryDir = nativeLibraryDir;
                 if (TextUtils.isEmpty(packageInfo.applicationInfo.sourceDir)) {

+ 3 - 0
core/src/main/java/com/norman/webviewup/lib/service/interfaces/IApplicationInfo.java

@@ -7,4 +7,7 @@ import com.norman.webviewup.lib.reflect.annotation.Field;
 public interface IApplicationInfo {
     @Field("primaryCpuAbi")
     void setPrimaryCpuAbi(String cpuAbi);
+
+    @Field("nativeLibraryRootDir")
+    void setNativeLibraryRootDir(String nativeLibraryRootDir);
 }

+ 5 - 22
core/src/main/java/com/norman/webviewup/lib/source/UpgradeAssetSource.java

@@ -6,6 +6,7 @@ import android.content.res.AssetManager;
 
 import androidx.annotation.NonNull;
 
+import com.norman.webviewup.lib.util.ApksUtils;
 import com.norman.webviewup.lib.util.FileUtils;
 
 import java.io.File;
@@ -17,25 +18,11 @@ import java.nio.channels.FileChannel;
 public class UpgradeAssetSource extends UpgradePathSource {
 
     private final String assetName;
-    private final String path;
 
 
-    private final boolean mainThread;
-
     public UpgradeAssetSource(Context context, @NonNull String assetName, @NonNull File file) {
-        this(context, assetName, file, false);
-    }
-
-    public UpgradeAssetSource(Context context, @NonNull String assetName, @NonNull File file, boolean mainThread) {
-        super(context);
+        super(context,file.getPath());
         this.assetName = assetName;
-        this.path = file.getPath();
-        this.mainThread = mainThread;
-    }
-
-    @Override
-    public String getPath() {
-        return path;
     }
 
     private final Runnable copyAssetRunnable = new Runnable() {
@@ -44,8 +31,8 @@ public class UpgradeAssetSource extends UpgradePathSource {
             FileOutputStream outputStream = null;
             FileInputStream inputStream = null;
             try {
-                FileUtils.createFile(path);
-                outputStream = new FileOutputStream(path);
+                FileUtils.createFile(getApkPath());
+                outputStream = new FileOutputStream(getApkPath());
                 FileChannel dstChannel = outputStream.getChannel();
                 AssetManager assetManager = getContext().getAssets();
                 AssetFileDescriptor assetFileDescriptor = assetManager.openFd(assetName);
@@ -64,7 +51,7 @@ public class UpgradeAssetSource extends UpgradePathSource {
                 }
                 success();
             } catch (Throwable e) {
-                FileUtils.delete(path);
+                FileUtils.delete(getApkPath());
                 error(e);
             } finally {
                 if (outputStream != null) {
@@ -87,10 +74,6 @@ public class UpgradeAssetSource extends UpgradePathSource {
 
     @Override
     protected void onPrepare(Object params) {
-        if (mainThread) {
-            copyAssetRunnable.run();
-            return;
-        }
         new Thread(copyAssetRunnable).start();
     }
 }

+ 12 - 8
core/src/main/java/com/norman/webviewup/lib/source/UpgradeFileSource.java

@@ -9,20 +9,24 @@ import java.io.File;
 import java.io.IOException;
 
 public class UpgradeFileSource extends UpgradePathSource {
-    private final String path;
 
     public UpgradeFileSource(Context context, File file) {
-        super(context);
-        this.path = file != null ? file.getPath() : null;
+        super(context, file.getPath());
     }
 
-    @Override
-    public synchronized String getPath() {
-        return path;
-    }
 
     @Override
     protected void onPrepare(Object params) {
-        error(new IOException("file not exist, path is " + path));
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                if (!FileUtils.existFile(getApkPath())) {
+                    error(new IOException("file not exist, path is " + getApkPath()));
+                } else {
+                    success();
+                }
+            }
+        }).start();
+
     }
 }

+ 19 - 7
core/src/main/java/com/norman/webviewup/lib/source/UpgradePathSource.java

@@ -5,27 +5,39 @@ import android.content.SharedPreferences;
 
 import androidx.annotation.NonNull;
 
+import com.norman.webviewup.lib.util.ApksUtils;
 import com.norman.webviewup.lib.util.FileUtils;
 
 public abstract class UpgradePathSource extends UpgradeSource {
     private static final String PREFERENCE_NAME = "UPGRADE_PATH_SOURCE";
+    private final SharedPreferences sharedPreferences;
 
+    private final String libsPath;
 
-    private final SharedPreferences sharedPreferences;
+    private final String path;
 
-    public UpgradePathSource(@NonNull Context context) {
+    public UpgradePathSource(@NonNull Context context, String path) {
         super(context);
+        this.path = path;
+        this.libsPath = path + "-libs";
         this.sharedPreferences = context
                 .getSharedPreferences(PREFERENCE_NAME,
                         Context.MODE_PRIVATE);
     }
 
-    public abstract String getPath();
+    public String getApkPath() {
+        return path;
+    }
+
+    public String getLibsPath() {
+        return libsPath;
+    }
 
     @Override
     protected void onSuccess() {
         super.onSuccess();
-        sharedPreferences.edit().putBoolean(getPath(), true).commit();
+        ApksUtils.extractNativeLibrary(path, libsPath);
+        sharedPreferences.edit().putBoolean(getApkPath(), true).commit();
     }
 
     @Override
@@ -33,12 +45,12 @@ public abstract class UpgradePathSource extends UpgradeSource {
         if (super.isSuccess()) {
             return true;
         }
-        if (sharedPreferences.getBoolean(getPath(), false)) {
-            if (FileUtils.isNotEmpty(getPath())) {
+        if (sharedPreferences.getBoolean(getApkPath(), false)) {
+            if (FileUtils.isNotEmpty(getApkPath())) {
                 success();
                 return true;
             }
-            sharedPreferences.edit().putBoolean(getPath(), false).commit();
+            sharedPreferences.edit().putBoolean(getApkPath(), false).commit();
         }
         return false;
     }

+ 57 - 0
core/src/main/java/com/norman/webviewup/lib/util/ApksUtils.java

@@ -0,0 +1,57 @@
+package com.norman.webviewup.lib.util;
+
+import android.text.TextUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+public class ApksUtils {
+
+
+    public static void extractNativeLibrary(String apkPath, String libsDir) {
+        ZipFile zipFile = null;
+        try {
+            if (TextUtils.isEmpty(apkPath)) {
+                throw new NullPointerException("apkPath is empty");
+            }
+            if (TextUtils.isEmpty(libsDir)) {
+                throw new NullPointerException("apkPath is empty");
+            }
+            zipFile = new ZipFile(new File(apkPath));
+            Enumeration<? extends ZipEntry> entries = zipFile.entries();
+            List<ZipEntry> libsEntryList = new ArrayList<>();
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = entries.nextElement();
+                String entryName = entry.getName();
+                if (entryName.contains("../") || entry.isDirectory()) {
+                    continue;
+                }
+                if (!entryName.startsWith("lib/") && !entryName.endsWith(".so")) {
+                    continue;
+                }
+                libsEntryList.add(entry);
+            }
+            for (ZipEntry zipEntry : libsEntryList) {
+                String[] split = zipEntry.getName().split("/");
+                File targetFile = new File(libsDir, split[1] + "/" + split[split.length - 1]);
+                FileUtils.copyFile(zipFile.getInputStream(zipEntry), targetFile, true);
+            }
+        } catch (IOException ioException) {
+            FileUtils.cleanDirectory(libsDir);
+            throw new RuntimeException(ioException);
+        } finally {
+            if (zipFile != null) {
+                try {
+                    zipFile.close();
+                } catch (IOException ignore) {
+
+                }
+            }
+        }
+    }
+}

+ 7 - 0
core/src/main/java/com/norman/webviewup/lib/util/FileUtils.java

@@ -181,6 +181,13 @@ public class FileUtils {
         return file.isFile() && file.exists();
     }
 
+    public static boolean exist(File file) {
+        if (file  == null) {
+            return false;
+        }
+        return file.exists();
+    }
+
     public static boolean isNotEmpty(String path) {
         if (TextUtils.isEmpty(path)) {
             return false;

+ 11 - 15
download-source/src/main/java/com/norman/webviewup/lib/source/download/UpgradeDownloadSource.java

@@ -26,10 +26,8 @@ import java.util.zip.ZipFile;
 
 public class UpgradeDownloadSource extends UpgradePathSource implements DownloadTaskListener {
 
-    public static final int MAX_DOWNLOAD_THREAD_NUM = 20;
+    public static final int MAX_DOWNLOAD_THREAD_NUM = 10;
     private final String url;
-
-    private final String path;
     private final int threadNum;
 
     private DownloadReceiver downloadReceiver;
@@ -40,9 +38,8 @@ public class UpgradeDownloadSource extends UpgradePathSource implements Download
 
 
     public UpgradeDownloadSource(Context context, String url, File file, int threadNum) {
-        super(context);
+        super(context,file.getPath());
         this.url = url;
-        this.path = file.getPath();
         this.threadNum = threadNum;
     }
 
@@ -58,7 +55,7 @@ public class UpgradeDownloadSource extends UpgradePathSource implements Download
         downloadConfig.setThreadNum(threadNum);
         downloadReceiver = Aria.download(this);
         downloadEntity = downloadReceiver.getFirstDownloadEntity(url);
-        tempPath = path + ".tmp";
+        tempPath = getApkPath() + ".tmp";
         this.downloadReceiver.register();
         if (downloadEntity == null ||
                 downloadEntity.getState() == IEntity.STATE_CANCEL) {
@@ -96,13 +93,13 @@ public class UpgradeDownloadSource extends UpgradePathSource implements Download
                     bufferedInput = findStreamInZip(zipFile);
                 }
                 Objects.requireNonNull(bufferedInput);
-                FileUtils.createFile(path);
-                bufferedOutput = new BufferedOutputStream(new FileOutputStream(path));
+                FileUtils.createFile(getApkPath());
+                bufferedOutput = new BufferedOutputStream(new FileOutputStream(getApkPath()));
                 copyBufferStream(bufferedInput, bufferedOutput);
                 success();
                 deleteDownload();
             } catch (Throwable e) {
-                FileUtils.delete(path);
+                FileUtils.delete(getApkPath());
                 error(e);
             } finally {
                 try {
@@ -208,7 +205,11 @@ public class UpgradeDownloadSource extends UpgradePathSource implements Download
 
     @Override
     public void onTaskFail(DownloadTask task, Exception e) {
-        error(e);
+        if (e == null){
+            error(new RuntimeException("download fail"));
+        }else {
+            error(e);
+        }
     }
 
     @Override
@@ -228,11 +229,6 @@ public class UpgradeDownloadSource extends UpgradePathSource implements Download
 
     }
 
-    @Override
-    public synchronized String getPath() {
-        return path;
-    }
-
 
     private boolean isValidApk(String path) {
         try {