Support stub APK upgrades

This commit is contained in:
topjohnwu
2019-10-16 05:07:29 -04:00
parent 43bda2d4a4
commit a910c8ccd8
4 changed files with 31 additions and 8 deletions

View File

@ -37,7 +37,9 @@ public class DelegateApplication extends Application {
// If 9.0+, try to dynamically load the APK
DelegateComponentFactory factory = (DelegateComponentFactory) this.factory;
MANAGER_APK = DynAPK.current(this);
MANAGER_APK.getParentFile().mkdir();
File update = DynAPK.update(this);
if (update.exists())
update.renameTo(MANAGER_APK);
if (MANAGER_APK.exists()) {
ClassLoader cl = new DynamicClassLoader(MANAGER_APK, factory.loader);
try {