File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
VirtualApp/app/src/main/java/io/virtualapp Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 22
33import android .content .Context ;
44import android .content .SharedPreferences ;
5+ import android .os .Looper ;
56import android .support .multidex .MultiDexApplication ;
67import android .util .Log ;
78
89import com .flurry .android .FlurryAgent ;
10+ import com .lody .virtual .client .core .CrashHandler ;
911import com .lody .virtual .client .core .InstallStrategy ;
1012import com .lody .virtual .client .core .VirtualCore ;
1113import com .lody .virtual .client .stub .VASettings ;
@@ -125,6 +127,17 @@ public void onVirtualProcess() {
125127 virtualCore .setPhoneInfoDelegate (new MyPhoneInfoDelegate ());
126128 //fake task description's icon and title
127129 virtualCore .setTaskDescriptionDelegate (new MyTaskDescriptionDelegate ());
130+ virtualCore .setCrashHandler (new CrashHandler () {
131+ @ Override
132+ public void handleUncaughtException (Thread t , Throwable e ) {
133+ Log .i (TAG , "uncaught :" + t , e );
134+ if (t == Looper .getMainLooper ().getThread ()) {
135+ System .exit (0 );
136+ } else {
137+ Log .e (TAG , "ignore uncaught exception of thread: " + t );
138+ }
139+ }
140+ });
128141 // ensure the logcat service alive when every virtual process start.
129142 LogcatService .start (VApp .this , VEnvironment .getDataUserPackageDirectory (0 , XPOSED_INSTALLER_PACKAGE ));
130143 }
You can’t perform that action at this time.
0 commit comments