卡顿优化

pull/2/head
Milk 4 years ago
parent f4260320e6
commit 6ba6895785
  1. 23
      Bcore/src/main/java/top/niunaijun/blackbox/app/BActivityThread.java
  2. 1
      Bcore/src/main/java/top/niunaijun/blackbox/proxy/ProxyActivity.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,

@ -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 {

Loading…
Cancel
Save