6.7.0 - Alpha7 - 修复 ErrorDialogActivity 可能无法正常启动或短时间自动消失的问题
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
"打包应用无法正常使用 Paddle OCR 与 Rapid OCR 功能的问题",
|
||||
"版本历史页面部分系统因字体差别导致统计数据显示不完整的问题",
|
||||
"部分设备无法正常初始化 MLKit Google OCR 的问题 (试修) _[`issue #8`](http://issues.autojs6.com/8#issuecomment-3117061768)_",
|
||||
"ErrorDialogActivity 可能无法正常启动的问题 _[`issue #414`](http://issues.autojs6.com/414)_ _[`issue #340`](http://issues.autojs6.com/340#issuecomment-2973485826)_",
|
||||
"ErrorDialogActivity 可能无法正常启动或短时间自动消失的问题 _[`issue #414`](http://issues.autojs6.com/414)_ _[`issue #340`](http://issues.autojs6.com/340#issuecomment-2973485826)_",
|
||||
"崩溃报告页面复制详细信息功能失效的问题",
|
||||
"APK 文件类型信息对话框可能无法获取应用名称及 SDK 信息的问题",
|
||||
"构建工具启用 isCleanup[Paddle/Rapid]Ocr 配置选项时无法正常完成 Rebuild Project 任务的问题"
|
||||
|
||||
@@ -223,11 +223,8 @@
|
||||
android:targetActivity="org.autojs.autojs.ui.splash.SplashActivity">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="${intentCategory}" />
|
||||
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
@@ -244,11 +241,8 @@
|
||||
android:targetActivity="org.autojs.autojs.ui.splash.SplashActivity">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="${intentCategory}" />
|
||||
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
@@ -281,11 +275,8 @@
|
||||
android:taskAffinity="org.autojs.autojs.external.shortcut.ShortcutActivity"
|
||||
android:theme="@android:style/Theme.NoDisplay">
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -321,8 +312,18 @@
|
||||
android:name="org.autojs.autojs.ui.settings.DeveloperOptionsActivity"
|
||||
android:theme="@style/AppTheme.Settings" />
|
||||
|
||||
<!-- <activity android:name="org.autojs.autojs.ui.error.CrashReportActivity" android:process=":crash_report"/> -->
|
||||
<activity android:name="org.autojs.autojs.ui.error.CrashReportActivity" />
|
||||
<activity
|
||||
android:name="org.autojs.autojs.ui.error.CrashReportActivity"
|
||||
android:process=":crash_report"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity="${applicationId}.crash_report"
|
||||
android:excludeFromRecents="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="org.autojs.autojs.external.tasker.TaskerScriptEditActivity"
|
||||
@@ -378,11 +379,8 @@
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.CREATE_SHORTCUT" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
@@ -449,73 +447,41 @@
|
||||
android:exported="false">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
|
||||
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
|
||||
|
||||
<action android:name="android.intent.action.TIME_SET" />
|
||||
|
||||
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
|
||||
|
||||
<action android:name="android.intent.action.UID_REMOVED" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_SHUTDOWN" />
|
||||
|
||||
<action android:name="android.intent.action.ACTION_BATTERY_CHANGED" />
|
||||
|
||||
<action android:name="android.intent.action.DATE_CHANGED" />
|
||||
|
||||
<action android:name="android.intent.action.DREAMING_STARTED" />
|
||||
|
||||
<action android:name="android.intent.action.DREAMING_STOPPED" />
|
||||
|
||||
<action android:name="android.intent.action.HEADSET_PLUG" />
|
||||
|
||||
<action android:name="android.intent.action.INPUT_METHOD_CHANGED" />
|
||||
|
||||
<action android:name="android.intent.action.LOCALE_CHANGED" />
|
||||
|
||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||
|
||||
<action android:name="android.intent.action.MEDIA_CHECKING" />
|
||||
|
||||
<action android:name="android.intent.action.MEDIA_MOUNTED" />
|
||||
|
||||
<action android:name="android.intent.action.PACKAGE_FIRST_LAUNCH" />
|
||||
|
||||
<action android:name="android.intent.action.PROVIDER_CHANGED" />
|
||||
|
||||
<action android:name="android.intent.action.WALLPAPER_CHANGED" />
|
||||
|
||||
<action android:name="android.intent.action.USER_UNLOCKED" />
|
||||
|
||||
<action android:name="android.intent.action.USER_PRESENT" />
|
||||
|
||||
<action
|
||||
android:name="android.net.conn.CONNECTIVITY_CHANGE"
|
||||
tools:ignore="BatteryLife" />
|
||||
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.PACKAGE_ADDED" />
|
||||
|
||||
<action android:name="android.intent.action.PACKAGE_CHANGED" />
|
||||
|
||||
<action android:name="android.intent.action.PACKAGE_DATA_CLEARED" />
|
||||
|
||||
<action android:name="android.intent.action.PACKAGE_REMOVED" />
|
||||
|
||||
<action android:name="android.intent.action.PACKAGE_RESTARTED" />
|
||||
|
||||
<data android:scheme="package" />
|
||||
|
||||
</intent-filter>
|
||||
|
||||
</receiver>
|
||||
@@ -539,23 +505,14 @@
|
||||
android:exported="true"
|
||||
android:label="@string/text_edit_script">
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<action android:name="android.intent.action.EDIT" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="file" />
|
||||
|
||||
<data android:scheme="content" />
|
||||
|
||||
<data android:mimeType="application/x-javascript" />
|
||||
|
||||
<data android:mimeType="text/plain" />
|
||||
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -566,23 +523,14 @@
|
||||
android:taskAffinity="org.autojs.autojs.external.open.RunIntentActivity"
|
||||
android:theme="@android:style/Theme.NoDisplay">
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<action android:name="android.intent.action.EDIT" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="file" />
|
||||
|
||||
<data android:scheme="content" />
|
||||
|
||||
<data android:mimeType="application/x-javascript" />
|
||||
|
||||
<data android:mimeType="text/plain" />
|
||||
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -592,23 +540,14 @@
|
||||
android:label="@string/text_import_script"
|
||||
android:theme="@style/AppTheme.Transparent">
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<action android:name="android.intent.action.EDIT" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="file" />
|
||||
|
||||
<data android:scheme="content" />
|
||||
|
||||
<data android:mimeType="application/x-javascript" />
|
||||
|
||||
<data android:mimeType="text/plain" />
|
||||
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
@@ -82,7 +82,6 @@ abstract class AbstractAutoJs protected constructor(val application: Application
|
||||
addAccessibilityServiceDelegates()
|
||||
registerActivityLifecycleCallbacks()
|
||||
WrappedShizuku.onCreate()
|
||||
ThemeColorManager.init()
|
||||
}
|
||||
|
||||
private fun initContextFactory() {
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.autojs.autojs.external.receiver.DynamicBroadcastReceivers
|
||||
import org.autojs.autojs.ipc.InAppEventBus
|
||||
import org.autojs.autojs.leakcanary.LeakCanarySetup
|
||||
import org.autojs.autojs.pluginclient.DevPluginService
|
||||
import org.autojs.autojs.theme.ThemeColorManager
|
||||
import org.autojs.autojs.timing.TimedTaskManager
|
||||
import org.autojs.autojs.timing.TimedTaskScheduler
|
||||
import org.autojs.autojs.tool.CrashHandler
|
||||
@@ -58,21 +59,31 @@ class App : MultiDexApplication() {
|
||||
|
||||
GlobalAppContext.set(this)
|
||||
instance = WeakReference(this)
|
||||
devPluginService = DevPluginService(this)
|
||||
|
||||
setUpStaticsTool()
|
||||
setUpDebugEnvironment()
|
||||
setUpLeakCanary()
|
||||
when {
|
||||
":crash_report".matchesProcessNameSuffix() -> {
|
||||
ThemeColorManager.init()
|
||||
setUpDefaultNightMode()
|
||||
}
|
||||
else /* Main process. */ -> {
|
||||
devPluginService = DevPluginService(this)
|
||||
|
||||
AutoJs.initInstance(this)
|
||||
GlobalKeyObserver.initIfNeeded(applicationContext)
|
||||
setupDrawableImageLoader()
|
||||
TimedTaskScheduler.init(this)
|
||||
initDynamicBroadcastReceivers()
|
||||
initMlKitContext()
|
||||
Toaster.init(this)
|
||||
setUpStaticsTool()
|
||||
setUpDebugEnvironment()
|
||||
setUpLeakCanary()
|
||||
|
||||
setUpDefaultNightMode()
|
||||
AutoJs.initInstance(this)
|
||||
GlobalKeyObserver.initIfNeeded(applicationContext)
|
||||
setupDrawableImageLoader()
|
||||
TimedTaskScheduler.init(this)
|
||||
initDynamicBroadcastReceivers()
|
||||
initMlKitContext()
|
||||
Toaster.init(this)
|
||||
|
||||
ThemeColorManager.init()
|
||||
setUpDefaultNightMode()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun attachBaseContext(base: Context) {
|
||||
@@ -263,6 +274,10 @@ class App : MultiDexApplication() {
|
||||
val app: App
|
||||
get() = instance.get()!!
|
||||
|
||||
private fun String.matchesProcessNameSuffix(): Boolean {
|
||||
return getProcessNameCompat().endsWith(this)
|
||||
}
|
||||
|
||||
fun getProcessNameCompat(): String {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) getProcessName() else {
|
||||
try {
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.tencent.bugly.crashreport.CrashReport.CrashHandleCallback
|
||||
import org.autojs.autojs.app.GlobalAppContext
|
||||
import org.autojs.autojs.core.accessibility.AccessibilityService
|
||||
import org.autojs.autojs.runtime.ScriptRuntime
|
||||
import org.autojs.autojs.util.ClipboardUtils
|
||||
import org.autojs.autojs6.BuildConfig
|
||||
import org.mozilla.javascript.RhinoException
|
||||
import java.lang.Thread.UncaughtExceptionHandler
|
||||
@@ -46,12 +45,13 @@ class CrashHandler(private val errorReportClass: Class<*>) : CrashHandleCallback
|
||||
|
||||
override fun uncaughtException(thread: Thread, ex: Throwable) {
|
||||
Log.e(TAG, "Uncaught Exception", ex)
|
||||
ScriptRuntime.popException(ex.message ?: "Uncaught Exception")
|
||||
// ScriptRuntime.popException(ex.message ?: "Uncaught Exception")
|
||||
val latestMessage = ex.message ?: "[ No error message ]"
|
||||
if (mCachedExceptionMessage.size > 4) {
|
||||
if (mCachedExceptionMessage.all { it.get()?.message == latestMessage } || mCachedExceptionMessage.size > 20) {
|
||||
ScriptRuntime.popException(latestMessage)
|
||||
ClipboardUtils.setClip(GlobalAppContext.get(), ex.stackTraceToString())
|
||||
// ClipboardUtils.setClip(GlobalAppContext.get(), ex.stackTraceToString())
|
||||
startCrashReportActivity("Uncaught Exception", ex.stackTraceToString())
|
||||
exitProcess(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class CrashReportActivity : BaseActivity() {
|
||||
binding.restart.setOnClickListener { restart() }
|
||||
binding.exit.setOnClickListener { exit() }
|
||||
|
||||
savedInstanceState ?: copy()
|
||||
// savedInstanceState ?: copy()
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
|
||||
@@ -38,10 +38,9 @@ public class ErrorDialogActivity extends BaseActivity {
|
||||
.content(message)
|
||||
.positiveText(positiveButtonText)
|
||||
.positiveColorRes(R.color.dialog_button_default)
|
||||
.cancelable(true)
|
||||
.canceledOnTouchOutside(true)
|
||||
.cancelable(false)
|
||||
.canceledOnTouchOutside(false)
|
||||
.onPositive((dialog, which) -> finish())
|
||||
.dismissListener(dialog -> finish())
|
||||
.show();
|
||||
|
||||
MaterialDialogExtensions.makeTextCopyable(materialDialog, materialDialog.getContentView());
|
||||
|
||||
Reference in New Issue
Block a user