|
|
@ -187,8 +187,8 @@ public class BActivityThread extends IBActivityThread.Stub { |
|
|
|
try { |
|
|
|
try { |
|
|
|
application = LoadedApk.makeApplication.call(loadedApk, false, null); |
|
|
|
application = LoadedApk.makeApplication.call(loadedApk, false, null); |
|
|
|
} catch (Throwable e) { |
|
|
|
} catch (Throwable e) { |
|
|
|
// Slog.e(TAG, "Unable to makeApplication");
|
|
|
|
Slog.e(TAG, "Unable to makeApplication"); |
|
|
|
// e.printStackTrace();
|
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
mInitialApplication = application; |
|
|
|
mInitialApplication = application; |
|
|
|
if (Objects.equals(packageName, processName)) { |
|
|
|
if (Objects.equals(packageName, processName)) { |
|
|
@ -198,18 +198,33 @@ public class BActivityThread extends IBActivityThread.Stub { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
loader = application.getClassLoader(); |
|
|
|
loader = application.getClassLoader(); |
|
|
|
} |
|
|
|
} |
|
|
|
VMCore.dumpDex(loader, processName); |
|
|
|
handleDumpDex(packageName, result, loader); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Throwable e) { |
|
|
|
} catch (Throwable e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
result.dumpError(e.getMessage()); |
|
|
|
result.dumpError(e.getMessage()); |
|
|
|
} finally { |
|
|
|
|
|
|
|
mAppConfig = null; |
|
|
|
mAppConfig = null; |
|
|
|
BlackBoxCore.getBDumpManager().noticeMonitor(result); |
|
|
|
BlackBoxCore.getBDumpManager().noticeMonitor(result); |
|
|
|
BlackBoxCore.get().uninstallPackage(packageName); |
|
|
|
BlackBoxCore.get().uninstallPackage(packageName); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void handleDumpDex(String packageName, DumpResult result, ClassLoader classLoader) { |
|
|
|
|
|
|
|
new Thread(() -> { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
Thread.sleep(500); |
|
|
|
|
|
|
|
} catch (InterruptedException ignored) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
VMCore.dumpDex(classLoader, packageName); |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
mAppConfig = null; |
|
|
|
|
|
|
|
BlackBoxCore.getBDumpManager().noticeMonitor(result); |
|
|
|
|
|
|
|
BlackBoxCore.get().uninstallPackage(packageName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).start(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Context createPackageContext(ApplicationInfo info) { |
|
|
|
private Context createPackageContext(ApplicationInfo info) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
return BlackBoxCore.getContext().createPackageContext(info.packageName, |
|
|
|
return BlackBoxCore.getContext().createPackageContext(info.packageName, |
|
|
|