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

@@ -8,9 +8,19 @@ public class DynAPK {
private static File dynDir;
public static File current(Context context) {
if (dynDir == null)
dynDir = new File(context.getFilesDir().getParent(), "dyn");
return new File(dynDir, "current.apk");
private static File getDynDir(Context c) {
if (dynDir == null) {
dynDir = new File(c.getFilesDir().getParent(), "dyn");
dynDir.mkdir();
}
return dynDir;
}
public static File current(Context c) {
return new File(getDynDir(c), "current.apk");
}
public static File update(Context c) {
return new File(getDynDir(c), "update.apk");
}
}