Update dependencies, AGP, and SDK level

This commit is contained in:
topjohnwu
2023-08-11 09:38:59 -07:00
parent b5b14ce343
commit 93876b5fd3
6 changed files with 19 additions and 15 deletions

View File

@ -60,9 +60,11 @@ public class DynLoad {
try {
File external = new File(context.getExternalFilesDir(null), "magisk.apk");
if (external.exists()) {
apk.delete();
try {
var in = new FileInputStream(external);
var out = new FileOutputStream(apk);
apk.setReadOnly();
try (in; out) {
APKInstall.transfer(in, out);
}
@ -79,6 +81,7 @@ public class DynLoad {
}
if (apk.exists()) {
apk.setReadOnly();
return new AppClassLoader(apk);
}
@ -86,8 +89,10 @@ public class DynLoad {
if (!context.getPackageName().equals(APPLICATION_ID)) {
try {
var info = context.getPackageManager().getApplicationInfo(APPLICATION_ID, 0);
apk.delete();
var src = new FileInputStream(info.sourceDir);
var out = new FileOutputStream(apk);
apk.setReadOnly();
try (src; out) {
APKInstall.transfer(src, out);
}