mirror of https://github.com/M66B/NetGuard.git
Report unhandled exceptions for Play store installs only
This commit is contained in:
parent
c97958c072
commit
eb4a7ff1f9
|
@ -47,7 +47,10 @@ public class ApplicationEx extends Application {
|
|||
@Override
|
||||
public void uncaughtException(Thread thread, Throwable ex) {
|
||||
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
||||
System.exit(1);
|
||||
if (Util.isPlayStoreInstall(ApplicationEx.this))
|
||||
mPrevHandler.uncaughtException(thread, ex);
|
||||
else
|
||||
System.exit(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -415,7 +415,12 @@ public class Util {
|
|||
}
|
||||
|
||||
public static boolean isPlayStoreInstall(Context context) {
|
||||
return "com.android.vending".equals(context.getPackageManager().getInstallerPackageName(context.getPackageName()));
|
||||
try {
|
||||
return "com.android.vending".equals(context.getPackageManager().getInstallerPackageName(context.getPackageName()));
|
||||
} catch (Throwable ex) {
|
||||
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasPlayServices(Context context) {
|
||||
|
|
Loading…
Reference in New Issue