diff --git a/app/src/main/java/net/bible/android/BibleApplication.kt b/app/src/main/java/net/bible/android/BibleApplication.kt index de69229ff2..293ec777de 100644 --- a/app/src/main/java/net/bible/android/BibleApplication.kt +++ b/app/src/main/java/net/bible/android/BibleApplication.kt @@ -96,7 +96,6 @@ open class BibleApplication : Application() { val defaultExceptionHandler = Thread.getDefaultUncaughtExceptionHandler() Thread.setDefaultUncaughtExceptionHandler { t, e -> BugReport.saveScreenshot() - logBasicInfo() BugReport.saveLogcat() CommonUtils.realSharedPreferences.edit().putBoolean("app-crashed", true).commit() defaultExceptionHandler.uncaughtException(t, e) @@ -112,7 +111,8 @@ open class BibleApplication : Application() { LocaleProviderManager.setLocaleProvider(MyLocaleProvider) - logBasicInfo() + logSqliteVersion() + // This must be done before accessing JSword to prevent default folders being used SwordEnvironmentInitialisation.initialiseJSwordFolders() @@ -133,15 +133,6 @@ open class BibleApplication : Application() { localeOverrideAtStartUp = LocaleHelper.getOverrideLanguage(this) } - private fun logBasicInfo() { - Log.i(TAG, "OS:" + System.getProperty("os.name") + " ver " + System.getProperty("os.version")) - Log.i(TAG, "Java:" + System.getProperty("java.vendor") + " ver " + System.getProperty("java.version")) - Log.i(TAG, "Java home:" + System.getProperty("java.home")!!) - Log.i(TAG, "User dir:" + System.getProperty("user.dir") + " Timezone:" + System.getProperty("user.timezone")) - logSqliteVersion() - Log.i(TAG, BugReport.createErrorText()) - } - var sqliteVersion = "" private fun logSqliteVersion() { diff --git a/app/src/main/java/net/bible/android/control/report/ErrorReportControl.kt b/app/src/main/java/net/bible/android/control/report/ErrorReportControl.kt index f2f7b1c10e..15c5199629 100644 --- a/app/src/main/java/net/bible/android/control/report/ErrorReportControl.kt +++ b/app/src/main/java/net/bible/android/control/report/ErrorReportControl.kt @@ -117,7 +117,7 @@ object ErrorReportControl { const val SCREENSHOT_FILE = "screenshot.webp" object BugReport { - fun createErrorText(exception: Throwable? = null) = try { + private fun createErrorText(exception: Throwable? = null) = try { StringBuilder().run { append("Version: ").append(applicationVersionName).append("\n") append("Android version: ").append(Build.VERSION.RELEASE).append("\n") @@ -169,8 +169,18 @@ object BugReport { private val logDir get() = File(application.filesDir, "/log") + private fun logBasicInfo() { + Log.i(TAG, "logBasicInfo") + Log.i(TAG, "OS:" + System.getProperty("os.name") + " ver " + System.getProperty("os.version")) + Log.i(TAG, "Java:" + System.getProperty("java.vendor") + " ver " + System.getProperty("java.version")) + Log.i(TAG, "Java home:" + System.getProperty("java.home")!!) + Log.i(TAG, "User dir:" + System.getProperty("user.dir") + " Timezone:" + System.getProperty("user.timezone")) + Log.i(TAG, createErrorText()) + } + fun saveLogcat() { Log.i(TAG, "Trying to save logcat") + logBasicInfo() val f = File(logDir, "logcat.txt.gz") val log = StringBuilder() try {