mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-25 19:47:25 +00:00
Do not crash root service in stub
This commit is contained in:
parent
a54114f149
commit
38ab6858f0
@ -60,20 +60,24 @@ public class DynLoad {
|
|||||||
|
|
||||||
// Copy from external for easier development
|
// Copy from external for easier development
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
File external = new File(context.getExternalFilesDir(null), "magisk.apk");
|
try {
|
||||||
if (external.exists()) {
|
File external = new File(context.getExternalFilesDir(null), "magisk.apk");
|
||||||
try {
|
if (external.exists()) {
|
||||||
var in = new FileInputStream(external);
|
try {
|
||||||
var out = new FileOutputStream(apk);
|
var in = new FileInputStream(external);
|
||||||
try (in; out) {
|
var out = new FileOutputStream(apk);
|
||||||
APKInstall.transfer(in, out);
|
try (in; out) {
|
||||||
|
APKInstall.transfer(in, out);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(DynLoad.class.getSimpleName(), "", e);
|
||||||
|
apk.delete();
|
||||||
|
} finally {
|
||||||
|
external.delete();
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
|
||||||
Log.e(DynLoad.class.getSimpleName(), "", e);
|
|
||||||
apk.delete();
|
|
||||||
} finally {
|
|
||||||
external.delete();
|
|
||||||
}
|
}
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
// Do not crash in root service
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user