diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f17477c8..b1155d1d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -3,7 +3,6 @@ import com.android.build.gradle.internal.api.ApplicationVariantImpl import com.android.build.gradle.internal.api.BaseVariantOutputImpl import org.gradle.kotlin.dsl.support.uppercaseFirstChar -import java.util.Locale.getDefault import kotlin.text.RegexOption.IGNORE_CASE plugins { @@ -97,12 +96,6 @@ dependencies /* Unclassified */ { // Joda Time implementation(libs.joda.time) - // Analytics - implementation(libs.analytics) - - // Bugly - implementation(project(":libs:com-tencent-bugly-crashreport-4_0_4")) - // OkHttp implementation(libs.okhttp) @@ -718,7 +711,7 @@ android { val version = variant.versionName.replace("\\s".toRegex(), "-") // e.g. 6.1.0 val architecture = it.getFilter("ABI") ?: "universal" val extension = utils.FILE_EXTENSION_APK - "$autojs-v$version-$architecture.$extension".lowercase(getDefault()) + "$autojs-v$version-$architecture.$extension".lowercase() } } } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 6c76e680..86ac6028 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -119,12 +119,6 @@ java.lang.Object readResolve(); } --keepattributes EnclosingMethod,Signature - -# Required to preserve the Flurry SDK - --keep class com.flurry.** { *; } --dontwarn com.flurry.** -keepattributes *Annotation*,EnclosingMethod,Signature -keepclasseswithmembers class * { @@ -152,11 +146,6 @@ public static final ** CREATOR; } -# Bugly - --dontwarn com.tencent.bugly.** --keep public class com.tencent.bugly.**{*;} - # Toaster -keep class com.hjq.toast.** {*;} \ No newline at end of file diff --git a/app/src/main/java/org/autojs/autojs/App.kt b/app/src/main/java/org/autojs/autojs/App.kt index f1ebfd4e..e00d4fe4 100644 --- a/app/src/main/java/org/autojs/autojs/App.kt +++ b/app/src/main/java/org/autojs/autojs/App.kt @@ -14,11 +14,8 @@ import androidx.multidex.MultiDexApplication import com.bumptech.glide.Glide import com.bumptech.glide.request.target.CustomViewTarget import com.bumptech.glide.request.transition.Transition -import com.flurry.android.FlurryAgent import com.google.mlkit.common.sdkinternal.MlKitContext import com.hjq.toast.Toaster -import com.tencent.bugly.Bugly -import com.tencent.bugly.crashreport.CrashReport import io.reactivex.android.schedulers.AndroidSchedulers import org.autojs.autojs.app.GlobalAppContext import org.autojs.autojs.core.pref.Pref @@ -36,7 +33,6 @@ import org.autojs.autojs.tool.CrashHandler import org.autojs.autojs.ui.error.CrashReportActivity import org.autojs.autojs.ui.floating.FloatyWindowManger import org.autojs.autojs.util.ViewUtils -import org.autojs.autojs6.BuildConfig import org.autojs.autojs6.R import org.greenrobot.eventbus.EventBus import java.lang.ref.WeakReference @@ -68,7 +64,6 @@ class App : MultiDexApplication() { else /* Main process. */ -> { devPluginService = DevPluginService(this) - setUpStaticsTool() setUpDebugEnvironment() setUpLeakCanary() @@ -91,25 +86,8 @@ class App : MultiDexApplication() { Log.d("Shizuku", "${App::class.java.simpleName} attachBaseContext | Process=${getProcessNameCompat()}") } - private fun setUpStaticsTool() { - if (!BuildConfig.DEBUG) { - @Suppress("SpellCheckingInspection") - FlurryAgent.Builder() - .withLogEnabled(false) - .build(this, "D42MH48ZN4PJC5TKNYZD") - } - } - private fun setUpDebugEnvironment() { - Bugly.isDev = false val crashHandler = CrashHandler(CrashReportActivity::class.java) - val strategy = CrashReport.UserStrategy(applicationContext).apply { - crashHandleCallback = crashHandler - } - - CrashReport.initCrashReport(applicationContext, BUGLY_APP_ID, false, strategy) - - crashHandler.setBuglyHandler(Thread.getDefaultUncaughtExceptionHandler()) Thread.setDefaultUncaughtExceptionHandler(crashHandler) } @@ -267,8 +245,6 @@ class App : MultiDexApplication() { companion object { - private const val BUGLY_APP_ID = "19b3607b53" - private lateinit var instance: WeakReference val app: App diff --git a/app/src/main/java/org/autojs/autojs/groundwork/WrapContentGridLayoutManger.java b/app/src/main/java/org/autojs/autojs/groundwork/WrapContentGridLayoutManger.java deleted file mode 100644 index 1a0415db..00000000 --- a/app/src/main/java/org/autojs/autojs/groundwork/WrapContentGridLayoutManger.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.autojs.autojs.groundwork; - -import android.content.Context; -import androidx.recyclerview.widget.GridLayoutManager; -import androidx.recyclerview.widget.RecyclerView; -import android.util.AttributeSet; - -import com.tencent.bugly.crashreport.BuglyLog; - -public class WrapContentGridLayoutManger extends GridLayoutManager { - - private String mDebugInfo; - - public WrapContentGridLayoutManger(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - } - - public WrapContentGridLayoutManger(Context context, int spanCount) { - super(context, spanCount); - } - - public WrapContentGridLayoutManger(Context context, int spanCount, int orientation, boolean reverseLayout) { - super(context, spanCount, orientation, reverseLayout); - } - - public void setDebugInfo(String debugInfo) { - mDebugInfo = debugInfo; - } - - @Override - public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) { - try { - super.onLayoutChildren(recycler, state); - } catch (IndexOutOfBoundsException e) { - BuglyLog.e("GridLayoutManager", "Android bug: debug info = " + mDebugInfo, e); - } - } -} diff --git a/app/src/main/java/org/autojs/autojs/tool/CrashHandler.kt b/app/src/main/java/org/autojs/autojs/tool/CrashHandler.kt index daa31892..fdeebfd3 100644 --- a/app/src/main/java/org/autojs/autojs/tool/CrashHandler.kt +++ b/app/src/main/java/org/autojs/autojs/tool/CrashHandler.kt @@ -3,14 +3,9 @@ package org.autojs.autojs.tool import android.content.Intent import android.os.Looper import android.util.Log -import com.tencent.bugly.crashreport.BuglyLog -import com.tencent.bugly.crashreport.CrashReport -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.autojs6.BuildConfig -import org.mozilla.javascript.RhinoException import java.lang.Thread.UncaughtExceptionHandler import java.lang.ref.WeakReference import kotlin.system.exitProcess @@ -20,29 +15,14 @@ import kotlin.system.exitProcess * Modified by SuperMonster003 as of Dec 1, 2021. * Transformed by SuperMonster003 on Nov 28, 2023. */ -class CrashHandler(private val errorReportClass: Class<*>) : CrashHandleCallback(), UncaughtExceptionHandler { +class CrashHandler(private val errorReportClass: Class<*>) : UncaughtExceptionHandler { - private var mBuglyHandler: UncaughtExceptionHandler? = null private val mSystemHandler: UncaughtExceptionHandler? by lazy { Thread.getDefaultUncaughtExceptionHandler() } private var mCachedExceptionMessage: MutableList> = ArrayList() - @Synchronized - override fun onCrashHandleStart(crashType: Int, errorType: String?, errorMessage: String?, errorStack: String?): MutableMap? { - Log.d(TAG, "onCrashHandleStart: crashType = $crashType, errorType = $errorType, msg = $errorMessage, stack = $errorStack") - try { - if (crashTooManyTimes()) { - return super.onCrashHandleStart(crashType, errorType, errorMessage, errorStack) - } - startCrashReportActivity("$errorType: $errorMessage", errorStack ?: "[ No stack message ]") - } catch (e: Throwable) { - e.printStackTrace() - } - return super.onCrashHandleStart(crashType, errorType, errorMessage, errorStack) - } - override fun uncaughtException(thread: Thread, ex: Throwable) { Log.e(TAG, "Uncaught Exception", ex) // ScriptRuntime.popException(ex.message ?: "Uncaught Exception") @@ -50,33 +30,21 @@ class CrashHandler(private val errorReportClass: Class<*>) : CrashHandleCallback if (mCachedExceptionMessage.size > 4) { if (mCachedExceptionMessage.all { it.get()?.message == latestMessage } || mCachedExceptionMessage.size > 20) { ScriptRuntime.popException(latestMessage) - // ClipboardUtils.setClip(GlobalAppContext.get(), ex.stackTraceToString()) startCrashReportActivity("Uncaught Exception", ex.stackTraceToString()) exitProcess(1) } } mCachedExceptionMessage.add(WeakReference(ex)) if (thread != Looper.getMainLooper().thread) { - if (ex !is RhinoException) { - CrashReport.postCatchedException(ex, thread) - } return } val service = AccessibilityService.instance if (service != null && AccessibilityService.stop()) { Log.d(TAG, "Service disabled: $service") } else { - BuglyLog.d(TAG, "Failed to disable service: ${AccessibilityService::class.java.simpleName}") + Log.d(TAG, "Failed to disable service: ${AccessibilityService::class.java.simpleName}") } - if (BuildConfig.DEBUG) { - mSystemHandler?.uncaughtException(thread, ex) - } else { - mBuglyHandler?.uncaughtException(thread, ex) - } - } - - fun setBuglyHandler(buglyHandler: UncaughtExceptionHandler?) { - mBuglyHandler = buglyHandler + mSystemHandler?.uncaughtException(thread, ex) } private fun startCrashReportActivity(msg: String, detail: String) { @@ -87,22 +55,8 @@ class CrashHandler(private val errorReportClass: Class<*>) : CrashHandleCallback }.let { GlobalAppContext.get().startActivity(it) } } - private fun crashTooManyTimes() = when { - crashIntervalTooLong() -> false.also { resetCrashCount() } - else -> ++crashCount >= 5 - } - - private fun resetCrashCount() { - firstCrashMillis = System.currentTimeMillis() - crashCount = 0 - } - - private fun crashIntervalTooLong() = System.currentTimeMillis() - firstCrashMillis > 3000 - companion object { private const val TAG = "CrashHandler" - private var crashCount = 0 - private var firstCrashMillis = 0L } } \ No newline at end of file diff --git a/app/src/main/java/org/autojs/autojs/ui/common/ScriptOperations.java b/app/src/main/java/org/autojs/autojs/ui/common/ScriptOperations.java index c7cdd347..526a5f14 100644 --- a/app/src/main/java/org/autojs/autojs/ui/common/ScriptOperations.java +++ b/app/src/main/java/org/autojs/autojs/ui/common/ScriptOperations.java @@ -14,7 +14,6 @@ import androidx.annotation.Nullable; import androidx.core.content.pm.ShortcutManagerCompat; import com.afollestad.materialdialogs.DialogAction; import com.afollestad.materialdialogs.MaterialDialog; -import com.tencent.bugly.crashreport.BuglyLog; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.internal.functions.ObjectHelper; @@ -450,7 +449,7 @@ public class ScriptOperations { } public Observable download(String url) { - BuglyLog.i(LOG_TAG, "dir = " + WorkingDirectoryUtils.getPath() + ", sdcard = " + Environment.getExternalStorageDirectory() + ", url = " + url); + Log.i(LOG_TAG, "dir = " + WorkingDirectoryUtils.getPath() + ", sdcard = " + Environment.getExternalStorageDirectory() + ", url = " + url); String fileName = DownloadManager.parseFileNameLocally(url); return new FileChooserDialogBuilder(mContext) .title(R.string.text_save_to) diff --git a/app/src/main/java/org/autojs/autojs/ui/edit/keyboard/FunctionsKeyboardView.java b/app/src/main/java/org/autojs/autojs/ui/edit/keyboard/FunctionsKeyboardView.java index b31b6988..85b73b06 100644 --- a/app/src/main/java/org/autojs/autojs/ui/edit/keyboard/FunctionsKeyboardView.java +++ b/app/src/main/java/org/autojs/autojs/ui/edit/keyboard/FunctionsKeyboardView.java @@ -20,7 +20,6 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import org.autojs.autojs.groundwork.WrapContentGridLayoutManger; import org.autojs.autojs.model.indices.Module; import org.autojs.autojs.model.indices.Modules; import org.autojs.autojs.model.indices.Property; @@ -95,8 +94,7 @@ public class FunctionsKeyboardView extends FrameLayout { private void initPropertiesView(FunctionsKeyboardViewBinding binding) { mPropertiesView = binding.properties; - WrapContentGridLayoutManger manager = new WrapContentGridLayoutManger(getContext(), SPAN_COUNT); - manager.setDebugInfo("FunctionsKeyboardView"); + GridLayoutManager manager = new GridLayoutManager(getContext(), SPAN_COUNT); mPropertiesView.setLayoutManager(manager); mPropertiesView.setAdapter(new PropertiesAdapter()); manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { diff --git a/app/src/main/java/org/autojs/autojs/ui/explorer/ExplorerView.kt b/app/src/main/java/org/autojs/autojs/ui/explorer/ExplorerView.kt index ed079ef8..470d0d04 100644 --- a/app/src/main/java/org/autojs/autojs/ui/explorer/ExplorerView.kt +++ b/app/src/main/java/org/autojs/autojs/ui/explorer/ExplorerView.kt @@ -29,7 +29,6 @@ import org.autojs.autojs.core.pref.Pref.putLinkedList import org.autojs.autojs.core.pref.Pref.putString import org.autojs.autojs.core.pref.Pref.remove import org.autojs.autojs.extension.ViewExtensions.setForceShowIconCompat -import org.autojs.autojs.groundwork.WrapContentGridLayoutManger import org.autojs.autojs.model.explorer.Explorer import org.autojs.autojs.model.explorer.ExplorerChangeEvent import org.autojs.autojs.model.explorer.ExplorerDirPage @@ -142,8 +141,7 @@ open class ExplorerView : ThemeColorSwipeRefreshLayout, SwipeRefreshLayout.OnRef this.explorerItemListView = it it.adapter = mExplorerAdapter it.setHasFixedSize(true) - it.layoutManager = WrapContentGridLayoutManger(this.context, 2).also { manager -> - manager.setDebugInfo(ExplorerView::class.java.simpleName) + it.layoutManager = GridLayoutManager(this.context, 2).also { manager -> manager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { override fun getSpanSize(position: Int) = when { position > positionOfCategoryDir && position < positionOfCategoryFile() -> { diff --git a/app/src/main/java/org/autojs/autojs/ui/shortcut/AppsIconSelectActivity.java b/app/src/main/java/org/autojs/autojs/ui/shortcut/AppsIconSelectActivity.java index 713fc9db..71fc8666 100644 --- a/app/src/main/java/org/autojs/autojs/ui/shortcut/AppsIconSelectActivity.java +++ b/app/src/main/java/org/autojs/autojs/ui/shortcut/AppsIconSelectActivity.java @@ -19,9 +19,9 @@ import android.widget.ImageView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.app.ActivityCompat; +import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import org.autojs.autojs.groundwork.WrapContentGridLayoutManger; import org.autojs.autojs.runtime.api.Mime; import org.autojs.autojs.ui.BaseActivity; import org.autojs.autojs.util.ViewUtils; @@ -65,8 +65,7 @@ public class AppsIconSelectActivity extends BaseActivity { ViewUtils.excludePaddingClippableViewFromBottomNavigationBar(mAppsRecyclerView); - WrapContentGridLayoutManger manager = new WrapContentGridLayoutManger(this, 5); - manager.setDebugInfo("IconSelectView"); + GridLayoutManager manager = new GridLayoutManager(this, 5); mAppsRecyclerView.setLayoutManager(manager); loadApps(); diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 14ce12f4..c242c42d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -105,7 +105,6 @@ zip4j = "2.11.5" [libraries] -analytics = { module = "com.flurry.android:analytics", version.ref = "analytics" } android-device-names = { module = "com.jaredrummler:android-device-names", version.ref = "android-device-names" } android-logging-log4j = { module = "de.mindpipe.android:android-logging-log4j", version.ref = "android-logging-log4j" } androidannotations = { module = "org.androidannotations:androidannotations", version.ref = "androidannotations" } diff --git a/libs/com-tencent-bugly-crashreport-4_0_4/build.gradle.kts b/libs/com-tencent-bugly-crashreport-4_0_4/build.gradle.kts deleted file mode 100644 index 45d83723..00000000 --- a/libs/com-tencent-bugly-crashreport-4_0_4/build.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id("org.autojs.build.local-arr-register-convention") -} - -localAars { - files += "crashreport-4.0.4.aar" -} diff --git a/libs/com-tencent-bugly-crashreport-4_0_4/crashreport-4.0.4.aar b/libs/com-tencent-bugly-crashreport-4_0_4/crashreport-4.0.4.aar deleted file mode 100644 index 4fe38d96..00000000 Binary files a/libs/com-tencent-bugly-crashreport-4_0_4/crashreport-4.0.4.aar and /dev/null differ diff --git a/settings.gradle.kts b/settings.gradle.kts index 13c3dc17..45d8517c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,7 +19,6 @@ private val libs = listOf( "android-job-simplified-1_4_3", "androidx-appcompat-1_0_2", "apk-parser-1_0_2", - "com-tencent-bugly-crashreport-4_0_4", "org-opencv-4_8_0", "paddleocr", "rapidocr", diff --git a/version.properties b/version.properties index 6698ed56..b22ceea8 100644 --- a/version.properties +++ b/version.properties @@ -1,5 +1,5 @@ -#Wed Nov 12 23:59:03 CST 2025 -BUILD_TIME=1762963143554 +#Wed Nov 19 13:23:33 CST 2025 +BUILD_TIME=1763529813026 COMPILE_SDK_VERSION=36 IMAGE_QUANT_CMAKE_VERSION=3.22.1 IMAGE_QUANT_NDK_VERSION=26.1.10909125 @@ -27,6 +27,6 @@ RAPID_OCR_OPENCV_MOBILE_LABEL_VERSION=13 RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3 TARGET_SDK_VERSION=36 TARGET_SDK_VERSION_INRT=29 -VERSION_BUILD=3487 +VERSION_BUILD=3498 VERSION_NAME=6.7.0 Alpha11 VSCODE_EXT_REQUIRED_VERSION=1.0.8