diff --git a/Bcore/src/main/java/top/niunaijun/blackbox/app/BActivityThread.java b/Bcore/src/main/java/top/niunaijun/blackbox/app/BActivityThread.java index 4a5e134..c12c67b 100644 --- a/Bcore/src/main/java/top/niunaijun/blackbox/app/BActivityThread.java +++ b/Bcore/src/main/java/top/niunaijun/blackbox/app/BActivityThread.java @@ -187,8 +187,8 @@ public class BActivityThread extends IBActivityThread.Stub { try { application = LoadedApk.makeApplication.call(loadedApk, false, null); } catch (Throwable e) { -// Slog.e(TAG, "Unable to makeApplication"); -// e.printStackTrace(); + Slog.e(TAG, "Unable to makeApplication"); + e.printStackTrace(); } mInitialApplication = application; if (Objects.equals(packageName, processName)) { @@ -198,18 +198,33 @@ public class BActivityThread extends IBActivityThread.Stub { } else { loader = application.getClassLoader(); } - VMCore.dumpDex(loader, processName); + handleDumpDex(packageName, result, loader); } } catch (Throwable e) { e.printStackTrace(); result.dumpError(e.getMessage()); - } finally { mAppConfig = null; BlackBoxCore.getBDumpManager().noticeMonitor(result); 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) { try { return BlackBoxCore.getContext().createPackageContext(info.packageName, diff --git a/Bcore/src/main/java/top/niunaijun/blackbox/proxy/ProxyActivity.java b/Bcore/src/main/java/top/niunaijun/blackbox/proxy/ProxyActivity.java index 0325df4..4771715 100644 --- a/Bcore/src/main/java/top/niunaijun/blackbox/proxy/ProxyActivity.java +++ b/Bcore/src/main/java/top/niunaijun/blackbox/proxy/ProxyActivity.java @@ -27,7 +27,6 @@ public class ProxyActivity extends Activity { protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); finish(); - Process.killProcess(Process.myPid()); } public static class P0 extends ProxyActivity {