mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 03:41:19 +08:00
在SystemUI 启用 AppCenter (#119)
* 在SystemUI 启用 AppCenter * 移除设置界面AppCenter Co-authored-by: LittleTurtle2333 <lturtle2333@outlook.com>
This commit is contained in:
@@ -29,12 +29,6 @@ class SettingsActivity : MIUIActivity() {
|
||||
private val activity = this
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
if (BuildConfig.BUILD_TYPE != "debug") {
|
||||
AppCenter.start(
|
||||
application, "ae2037d3-9914-4e0c-b02b-f9b2bb2574e5",
|
||||
Analytics::class.java, Crashes::class.java
|
||||
)
|
||||
}
|
||||
checkLSPosed()
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ object SystemUI: AppRegister() {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
autoInitHooks(lpparam,
|
||||
AppCenterService, //AppCenter统计服务
|
||||
HideStatusBarIcon, //隐藏状态栏图标
|
||||
HideBatteryIcon, //隐藏电池
|
||||
HideHDIcon, //隐藏HD图标
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.microsoft.appcenter.AppCenter
|
||||
import com.microsoft.appcenter.analytics.Analytics
|
||||
|
||||
object AppCenterService : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
Application::class.java.hookAfterMethod("attach", Context::class.java) {
|
||||
runCatching {
|
||||
AppCenter.start(it.thisObject as Application, "ae2037d3-9914-4e0c-b02b-f9b2bb2574e5", Analytics::class.java)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user