diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6f19260a089..fbdd16e9e9b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -154,9 +154,6 @@ dependencies { implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.core) implementation(projects.services.managerService) - - debugImplementation(libs.appcenter.analytics) - debugImplementation(libs.appcenter.crashes) } configurations.all { diff --git a/app/src/debug/java/org/lsposed/manager/util/Telemetry.java b/app/src/debug/java/org/lsposed/manager/util/Telemetry.java deleted file mode 100644 index 3545aa3e85a..00000000000 --- a/app/src/debug/java/org/lsposed/manager/util/Telemetry.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file is part of LSPosed. - * - * LSPosed is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * LSPosed is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with LSPosed. If not, see . - * - * Copyright (C) 2022 LSPosed Contributors - */ - -package org.lsposed.manager.util; - -import android.app.Application; -import android.os.Handler; - -import androidx.annotation.NonNull; - -import com.microsoft.appcenter.AppCenter; -import com.microsoft.appcenter.analytics.Analytics; -import com.microsoft.appcenter.channel.AbstractChannelListener; -import com.microsoft.appcenter.channel.Channel; -import com.microsoft.appcenter.crashes.Crashes; -import com.microsoft.appcenter.ingestion.models.Log; - -import org.lsposed.manager.App; -import org.lsposed.manager.BuildConfig; - -import java.util.Map; - -public class Telemetry { - private static final Channel.Listener patchDeviceListener = new AbstractChannelListener() { - @Override - public void onPreparedLog(@NonNull Log log, @NonNull String groupName, int flags) { - var device = log.getDevice(); - device.setAppVersion(BuildConfig.VERSION_NAME); - device.setAppBuild(String.valueOf(BuildConfig.VERSION_CODE)); - } - }; - - private static void addPatchDeviceListener() { - try { - var channelField = AppCenter.class.getDeclaredField("mChannel"); - channelField.setAccessible(true); - var channel = (Channel) channelField.get(AppCenter.getInstance()); - assert channel != null; - channel.addListener(patchDeviceListener); - } catch (ReflectiveOperationException e) { - android.util.Log.e(App.TAG, "add listener", e); - } - } - - private static void patchDevice() { - try { - var handlerField = AppCenter.class.getDeclaredField("mHandler"); - handlerField.setAccessible(true); - var handler = ((Handler) handlerField.get(AppCenter.getInstance())); - assert handler != null; - handler.post(Telemetry::addPatchDeviceListener); - } catch (ReflectiveOperationException e) { - android.util.Log.e(App.TAG, "patch device", e); - } - } - - public static void start(Application app) { - AppCenter.start(app, "eb3c4175-e879-4312-a72e-b0e64bca142c", - Analytics.class, Crashes.class); - patchDevice(); - } - - public static void trackEvent(String name, Map properties) { - Analytics.trackEvent(name, properties); - } - - public static void trackError(Throwable throwable, Map properties) { - Crashes.trackError(throwable, properties, null); - } -} diff --git a/app/src/main/java/org/lsposed/manager/App.java b/app/src/main/java/org/lsposed/manager/App.java index 7180c3a457b..4939dbfe6b1 100644 --- a/app/src/main/java/org/lsposed/manager/App.java +++ b/app/src/main/java/org/lsposed/manager/App.java @@ -49,7 +49,6 @@ import org.lsposed.manager.repo.RepoLoader; import org.lsposed.manager.util.CloudflareDNS; import org.lsposed.manager.util.ModuleUtil; -import org.lsposed.manager.util.Telemetry; import org.lsposed.manager.util.ThemeUtil; import org.lsposed.manager.util.UpdateUtil; @@ -141,10 +140,8 @@ public static Handler getMainHandler() { @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); - Telemetry.start(this); var map = new HashMap(1); map.put("isParasitic", String.valueOf(isParasitic)); - Telemetry.trackEvent("App start", map); var am = getSystemService(ActivityManager.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { map.clear(); @@ -155,7 +152,6 @@ protected void attachBaseContext(Context base) { map.put("process", reasons.get(0).getProcessName()); map.put("reason", String.valueOf(reasons.get(0).getReason())); map.put("status", String.valueOf(reasons.get(0).getStatus())); - Telemetry.trackEvent("Last exit reasons", map); } } } diff --git a/app/src/main/java/org/lsposed/manager/ui/activity/base/BaseActivity.java b/app/src/main/java/org/lsposed/manager/ui/activity/base/BaseActivity.java index 8e0e2530aeb..e0453f0be34 100644 --- a/app/src/main/java/org/lsposed/manager/ui/activity/base/BaseActivity.java +++ b/app/src/main/java/org/lsposed/manager/ui/activity/base/BaseActivity.java @@ -35,7 +35,6 @@ import org.lsposed.manager.App; import org.lsposed.manager.R; -import org.lsposed.manager.util.Telemetry; import org.lsposed.manager.util.ThemeUtil; import rikka.material.app.MaterialActivity; @@ -70,12 +69,6 @@ protected void onStart() { setTaskDescription(new ActivityManager.TaskDescription(getTitle().toString(), icon, getColor(R.color.ic_launcher_background))); } - @Override - protected void onStop() { - super.onStop(); - Telemetry.trackEvent("BaseActivity stop", null); - } - @Override public void onApplyUserThemeResource(@NonNull Resources.Theme theme, boolean isDecorView) { if (!ThemeUtil.isSystemAccent()) { diff --git a/app/src/main/java/org/lsposed/manager/ui/fragment/HomeFragment.java b/app/src/main/java/org/lsposed/manager/ui/fragment/HomeFragment.java index 9663aca3dab..ac9b9d4505d 100644 --- a/app/src/main/java/org/lsposed/manager/ui/fragment/HomeFragment.java +++ b/app/src/main/java/org/lsposed/manager/ui/fragment/HomeFragment.java @@ -50,7 +50,6 @@ import org.lsposed.manager.ui.dialog.FlashDialogBuilder; import org.lsposed.manager.ui.dialog.WelcomeDialog; import org.lsposed.manager.util.NavUtil; -import org.lsposed.manager.util.Telemetry; import org.lsposed.manager.util.UpdateUtil; import org.lsposed.manager.util.chrome.LinkTransformationMethod; @@ -246,7 +245,6 @@ private void updateStates(Activity activity, boolean binderAlive, boolean needUp map.put("api", binding.api.getText().toString()); map.put("frameworkVersion", binding.frameworkVersion.getText().toString()); map.put("systemAbi", Arrays.toString(Build.SUPPORTED_ABIS)); - Telemetry.trackEvent("HomeFragment", map); binding.copyInfo.setOnClickListener(v -> { ClipboardUtils.put(activity, info); showHint(R.string.info_copied, false); diff --git a/app/src/release/java/org/lsposed/manager/util/Telemetry.java b/app/src/release/java/org/lsposed/manager/util/Telemetry.java deleted file mode 100644 index 4054b6469cc..00000000000 --- a/app/src/release/java/org/lsposed/manager/util/Telemetry.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.lsposed.manager.util; - -import android.app.Application; - -import java.util.Map; - -public class Telemetry { - public static void start(Application application) { - } - - public static void trackEvent(String name, Map properties) { - } - - public static void trackError(Throwable throwable, Map properties) { - } -} diff --git a/external/lsplant b/external/lsplant index acdd096d3ef..6da9b91a2e3 160000 --- a/external/lsplant +++ b/external/lsplant @@ -1 +1 @@ -Subproject commit acdd096d3ef4220d6cf27b71308606eaa8741aac +Subproject commit 6da9b91a2e305c6d473ab39f2af8504ba65ff16e diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9a5150688f2..50a5065f71b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,9 +20,6 @@ lsplugin-cmaker = { id = "org.lsposed.lsplugin.cmaker", version = "1.2" } lsplugin-jgit = { id = "org.lsposed.lsplugin.jgit", version = "1.1" } [libraries] -appcenter-crashes = { group = "com.microsoft.appcenter", name = "appcenter-crashes", version.ref = "appcenter" } -appcenter-analytics = { group = "com.microsoft.appcenter", name = "appcenter-analytics", version.ref = "appcenter" } - rikkax-appcompat = { module = "dev.rikka.rikkax.appcompat:appcompat", version = "1.6.1" } rikkax-core = { module = "dev.rikka.rikkax.core:core", version = "1.4.1" } rikkax-insets = { module = "dev.rikka.rikkax.insets:insets", version = "1.3.0" }