From 9fa704eaee2882c11bfc6df87bfa9ae0567015a2 Mon Sep 17 00:00:00 2001 From: "Mr. Dragon" Date: Sun, 21 Jan 2018 01:34:54 +0530 Subject: [PATCH] Remove bugreport activity --- .../yeriomin/yalpstore/BugReportActivity.java | 75 ------------------ .../yeriomin/yalpstore/YalpStoreActivity.java | 3 - .../yalpstore/YalpStoreApplication.java | 1 - .../YalpStoreUncaughtExceptionHandler.java | 56 ------------- .../res/drawable-anydpi-v21/ic_bug_report.xml | 9 --- app/src/main/res/drawable/ic_bug_report.png | Bin 231 -> 0 bytes .../res/layout/bugreport_activity_layout.xml | 72 ----------------- app/src/main/res/menu/menu_main.xml | 4 - app/src/main/res/values-ar/strings.xml | 28 ++----- app/src/main/res/values-ast/strings.xml | 13 +-- app/src/main/res/values-cs/strings.xml | 28 ++----- app/src/main/res/values-de/strings.xml | 28 ++----- app/src/main/res/values-el/strings.xml | 28 ++----- app/src/main/res/values-es/strings.xml | 28 ++----- app/src/main/res/values-eu/strings.xml | 28 ++----- app/src/main/res/values-fr-rBE/strings.xml | 13 +-- app/src/main/res/values-fr/strings.xml | 28 ++----- app/src/main/res/values-it/strings.xml | 28 ++----- app/src/main/res/values-ja/strings.xml | 28 ++----- app/src/main/res/values-kk/strings.xml | 28 ++----- app/src/main/res/values-ko/strings.xml | 28 ++----- app/src/main/res/values-nl/strings.xml | 28 ++----- app/src/main/res/values-pl/strings.xml | 28 ++----- app/src/main/res/values-pt-rBR/strings.xml | 28 ++----- app/src/main/res/values-pt/strings.xml | 28 ++----- app/src/main/res/values-ru/strings.xml | 14 ---- app/src/main/res/values-sk/strings.xml | 28 ++----- app/src/main/res/values-uk/strings.xml | 28 ++----- app/src/main/res/values-zh/strings.xml | 28 ++----- app/src/main/res/values/color.xml | 2 - app/src/main/res/values/strings.xml | 14 ---- 31 files changed, 132 insertions(+), 648 deletions(-) delete mode 100644 app/src/main/java/com/github/yeriomin/yalpstore/BugReportActivity.java delete mode 100644 app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreUncaughtExceptionHandler.java delete mode 100644 app/src/main/res/drawable-anydpi-v21/ic_bug_report.xml delete mode 100644 app/src/main/res/drawable/ic_bug_report.png delete mode 100644 app/src/main/res/layout/bugreport_activity_layout.xml diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/BugReportActivity.java b/app/src/main/java/com/github/yeriomin/yalpstore/BugReportActivity.java deleted file mode 100644 index 9e1a1d731..000000000 --- a/app/src/main/java/com/github/yeriomin/yalpstore/BugReportActivity.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.github.yeriomin.yalpstore; - -import android.app.Activity; -import android.content.ActivityNotFoundException; -import android.content.Intent; -import android.os.Bundle; -import android.text.TextUtils; -import android.view.View; -import android.widget.EditText; -import android.widget.TextView; - -import com.github.yeriomin.yalpstore.bugreport.BugReportService; - -public class BugReportActivity extends Activity { - - private String stackTrace; - private boolean triggeredByCrash; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.bugreport_activity_layout); - onNewIntent(getIntent()); - } - - @Override - protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - setIntent(intent); - stackTrace = intent.getStringExtra(BugReportService.INTENT_STACKTRACE); - triggeredByCrash = !TextUtils.isEmpty(stackTrace); - setTitle(triggeredByCrash ? R.string.dialog_title_application_crashed : R.string.action_bug_report); - ((TextView) findViewById(R.id.explanation)).setText(triggeredByCrash ? R.string.bug_report_explanation_crash : R.string.bug_report_explanation_bug_report); - if (!PreferenceActivity.getBoolean(this, PlayStoreApiAuthenticator.PREFERENCE_APP_PROVIDED_EMAIL)) { - ((EditText) findViewById(R.id.identification)).setText(PreferenceActivity.getString(this, PlayStoreApiAuthenticator.PREFERENCE_EMAIL)); - } - } - - public void sendBugReport(View view) { - ContextUtil.toastShort(getApplicationContext(), getString(R.string.thank_you)); - startService(getBugReportIntent( - stackTrace, - ((EditText) findViewById(R.id.message)).getText().toString(), - ((EditText) findViewById(R.id.identification)).getText().toString() - )); - finishAndGoToHomeScreen(view); - } - - public void finishAndGoToHomeScreen(View view) { - finish(); - if (triggeredByCrash) { - goToHomeScreen(); - } - } - - private void goToHomeScreen() { - Intent intent = new Intent(Intent.ACTION_MAIN); - intent.addCategory(Intent.CATEGORY_HOME); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - try { - startActivity(intent); - } catch (ActivityNotFoundException e) { - // No home screen? - } - } - - private Intent getBugReportIntent(String stackTrace, String message, String identification) { - Intent intentBugReport = new Intent(getApplicationContext(), BugReportService.class); - intentBugReport.setAction(BugReportService.ACTION_SEND_FTP); - intentBugReport.putExtra(BugReportService.INTENT_STACKTRACE, stackTrace); - intentBugReport.putExtra(BugReportService.INTENT_MESSAGE, message); - intentBugReport.putExtra(BugReportService.INTENT_IDENTIFICATION, identification); - return intentBugReport; - } -} diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreActivity.java b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreActivity.java index aeaadeeba..e0f058e5c 100644 --- a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreActivity.java +++ b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreActivity.java @@ -104,9 +104,6 @@ public abstract class YalpStoreActivity extends Activity { case R.id.action_about: startActivity(new Intent(this, AboutActivity.class)); break; - case R.id.action_bug_report: - startActivity(new Intent(this, BugReportActivity.class)); - break; case R.id.filter_system_apps: case R.id.filter_apps_with_ads: case R.id.filter_paid_apps: diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreApplication.java b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreApplication.java index 2fde782c2..60ffc74e3 100644 --- a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreApplication.java +++ b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreApplication.java @@ -66,7 +66,6 @@ public class YalpStoreApplication extends Application { } } PreferenceManager.setDefaultValues(this, R.xml.settings, false); - Thread.setDefaultUncaughtExceptionHandler(new YalpStoreUncaughtExceptionHandler(getApplicationContext())); registerDownloadReceiver(); registerInstallReceiver(); } diff --git a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreUncaughtExceptionHandler.java b/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreUncaughtExceptionHandler.java deleted file mode 100644 index 258370247..000000000 --- a/app/src/main/java/com/github/yeriomin/yalpstore/YalpStoreUncaughtExceptionHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.github.yeriomin.yalpstore; - -import android.content.Context; -import android.content.Intent; - -import com.github.yeriomin.yalpstore.bugreport.BugReportService; - -class YalpStoreUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { - - private Context context; - - public YalpStoreUncaughtExceptionHandler(Context context) { - this.context = context; - } - - @Override - public void uncaughtException(Thread t, final Throwable e) { - e.printStackTrace(); - Intent errorIntent = new Intent(context.getApplicationContext(), BugReportActivity.class); - errorIntent.putExtra(BugReportService.INTENT_STACKTRACE, getStackTraceString(e)); - errorIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); - context.getApplicationContext().startActivity(errorIntent); - System.exit(0); - } - - private String getStackTraceString(Throwable e) { - StringBuilder stackTrace = new StringBuilder(); - Throwable ex = e; - while (null != ex) { - stackTrace - .append(ex.getClass().getName()) - .append(": \"") - .append(ex.getMessage()) - .append("\"\n") - ; - for (StackTraceElement element: ex.getStackTrace()) { - stackTrace - .append("\tat ") - .append(element.getClassName()) - .append(".") - .append(element.getMethodName()) - .append("(") - .append(element.getFileName()) - .append(":") - .append(element.getLineNumber()) - .append(")\n") - ; - } - ex = ex.getCause(); - if (null != ex) { - stackTrace.append("Caused by: "); - } - } - return stackTrace.toString(); - } -} diff --git a/app/src/main/res/drawable-anydpi-v21/ic_bug_report.xml b/app/src/main/res/drawable-anydpi-v21/ic_bug_report.xml deleted file mode 100644 index 2a18afef9..000000000 --- a/app/src/main/res/drawable-anydpi-v21/ic_bug_report.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_bug_report.png b/app/src/main/res/drawable/ic_bug_report.png deleted file mode 100644 index 7a73d78821a8f5036f7f93d5f0871c6a0ab37c83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-s`~f~8uI>dsjg5^BFc2?)?=4V@ zr6kBNm?8T4>So6s4M2Xgr;B5V$MLsQz4;C(aJaBO`vE+xai4N4pWm)CRLT4l8{T4|z4sgp!P=12EOQ(l%c&)ol!ldtJLgZLVQFYFHX zmewuZwug)xrZ)sW`>=7_uKmX}iVIpD($DN@&QYBdZMgN#g46oF+1-6RmK$7M$-1bK V+tp6`mp{-s44$rjF6*2Ung9ofSzG`B diff --git a/app/src/main/res/layout/bugreport_activity_layout.xml b/app/src/main/res/layout/bugreport_activity_layout.xml deleted file mode 100644 index 9d277a04c..000000000 --- a/app/src/main/res/layout/bugreport_activity_layout.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -