Write crash log only when not installed from the Play store

This commit is contained in:
M66B 2018-12-18 17:06:54 +01:00
parent cec0d1032c
commit 3ae2d51643
2 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,9 @@ public class ApplicationEx extends Application {
public void uncaughtException(Thread thread, Throwable ex) {
if (ownFault(ex)) {
Log.e(Helper.TAG, ex + "\r\n" + Log.getStackTraceString(ex));
writeCrashLog(ApplicationEx.this, ex);
if (!Helper.isPlayStoreInstall(ApplicationEx.this))
writeCrashLog(ApplicationEx.this, ex);
if (prev != null)
prev.uncaughtException(thread, ex);
@ -91,9 +93,6 @@ public class ApplicationEx extends Application {
}
public boolean ownFault(Throwable ex) {
//if (!Helper.isPlayStoreInstall(this))
// return true;
if (ex instanceof OutOfMemoryError)
return false;

View File

@ -189,7 +189,8 @@ public class Helper {
}
static void unexpectedError(final Context context, final LifecycleOwner owner, final Throwable ex) {
ApplicationEx.writeCrashLog(context, ex);
if (!isPlayStoreInstall(context))
ApplicationEx.writeCrashLog(context, ex);
if (owner.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED))
new DialogBuilderLifecycle(context, owner)