mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-14 20:31:19 +08:00
Compare commits
6 Commits
main
...
93b39c9bdb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93b39c9bdb | ||
|
|
6807a1a953 | ||
|
|
53a7e39220 | ||
|
|
99666c926b | ||
|
|
5925534ff9 | ||
|
|
c2df80dc10 |
@@ -1,4 +1,4 @@
|
|||||||
name: PR Check
|
name: Android CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
50
.github/workflows/dev.yml
vendored
50
.github/workflows/dev.yml
vendored
@@ -1,50 +0,0 @@
|
|||||||
name: Dev
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "main" ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: set up JDK 11
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
java-version: '11'
|
|
||||||
distribution: 'temurin'
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
|
|
||||||
- name: Clone UI
|
|
||||||
run: |
|
|
||||||
cd blockmiui
|
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: |
|
|
||||||
bash ./gradlew assembleDebug
|
|
||||||
|
|
||||||
- name: Sign Debug APK
|
|
||||||
if: success()
|
|
||||||
id: sign_debug
|
|
||||||
uses: r0adkll/sign-android-release@v1.0.4
|
|
||||||
with:
|
|
||||||
releaseDirectory: ./app/build/outputs/apk/debug
|
|
||||||
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
|
||||||
alias: ${{ secrets.KEY_STORE_ALIAS }}
|
|
||||||
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
||||||
keyPassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Upload Debug APK
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: WooBox_Debug
|
|
||||||
path: ${{ steps.sign_debug.outputs.signedReleaseFile }}
|
|
||||||
42
README.md
42
README.md
@@ -1,67 +1,57 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
|
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
|
||||||
<h1>WooBox For MIUI</h1>
|
<h1>WooBox For MIUI</h1>
|
||||||
<p><b><a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README_EN.md">English</a> 丨 简体中文</b></p>
|
<p>
|
||||||
|
<b><a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README_EN.md">English</a> 丨 简体中文</b>
|
||||||
|
</p>
|
||||||
<a href="https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases"><img alt="GitHub all releases" src="https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.lt2333.simplicitytools/total?label=Downloads"></a>
|
<a href="https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases"><img alt="GitHub all releases" src="https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.lt2333.simplicitytools/total?label=Downloads"></a>
|
||||||
<a href="https://github.com/LittleTurtle2333/SimplicityTools/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/LittleTurtle2333/SimplicityTools"></a>
|
<a href="https://github.com/LittleTurtle2333/SimplicityTools/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/LittleTurtle2333/SimplicityTools"></a>
|
||||||
<a href="https://github.com/LittleTurtle2333/SimplicityTools/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/LittleTurtle2333/SimplicityTools"></a>
|
<a href="https://github.com/LittleTurtle2333/SimplicityTools/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/LittleTurtle2333/SimplicityTools"></a>
|
||||||
<a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/LittleTurtle2333/SimplicityTools"></a>
|
<a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/LittleTurtle2333/SimplicityTools"></a>
|
||||||
<p>一个基于 MIUI13+(Android12+)适配的系统拓展Xposed模块</p>
|
<p>一个基于 MIUI13(Android12)适配的系统拓展Xposed模块</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 模块说明
|
### 模块说明
|
||||||
|
|
||||||
开发者:[酷安@乌堆小透明](http://www.coolapk.com/u/883441)
|
仅支持MIUI13(Android12),其余版本无法使用。
|
||||||
|
|
||||||
当前仅基于`Android13`进行开发,`Android12`几乎不再维护。也有基于`Android13`开发,但是能在`Android12`使用的情况,请广大社区使用`Android12`的开发者自行测试和修复后提交`Pull Request`。
|
开发者:[酷安@乌堆小透明](http://www.coolapk.com/u/883441)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 模块截图
|
### 模块截图
|
||||||
|

|
||||||

|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 下载地址
|
### 下载地址
|
||||||
|
|
||||||
Xposed
|
Xposed仓库下载:[点击此处下载最新发行版](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases)
|
||||||
仓库下载:[点击此处下载最新发行版](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases)
|
|
||||||
|
|
||||||
酷安下载:[点击此处下载最新发行版](https://www.coolapk.com/apk/com.lt2333.simplicitytools)
|
酷安下载:[点击此处下载最新发行版](https://www.coolapk.com/apk/com.lt2333.simplicitytools)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 改进翻译
|
### 改进翻译
|
||||||
|
[](https://crowdin.com/project/simplicitytools)[点击此处进入Crowdin](https://crowdin.com/project/simplicitytools)
|
||||||
[](https://crowdin.com/project/simplicitytools) [点击此处进入Crowdin](https://crowdin.com/project/simplicitytools)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 第三方开源引用
|
### 第三方开源引用
|
||||||
|
|
||||||
##### GNU General Public License v3.0
|
##### GNU General Public License v3.0
|
||||||
|
[qqlittleice/MiuiHome](https://github.com/qqlittleice/MiuiHome)
|
||||||
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
|
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
|
||||||
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
|
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
|
||||||
[MonwF/customiuizer](https://github.com/MonwF/customiuizer)
|
|
||||||
|
|
||||||
##### GNU General Public License v2.0
|
##### GNU General Public License v2.0
|
||||||
|
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
|
||||||
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
|
|
||||||
|
|
||||||
##### GNU Lesser General Public License v2.1
|
##### GNU Lesser General Public License v2.1
|
||||||
|
[577fkj/blockmiui](https://github.com/577fkj/blockmiui)
|
||||||
[577fkj/blockmiui](https://github.com/577fkj/blockmiui)
|
|
||||||
|
|
||||||
##### Apache License 2.0
|
##### Apache License 2.0
|
||||||
|
[KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper)
|
||||||
[KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
[GNU General Public License v3.0](https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE)
|
[GNU General Public License v3.0](https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE)
|
||||||
|
|||||||
34
README_EN.md
34
README_EN.md
@@ -1,62 +1,54 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
|
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
|
||||||
<h1>WooBox For MIUI</h1>
|
<h1>WooBox For MIUI</h1>
|
||||||
<p><b>English 丨 <a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README.md">简体中文</a></b></p>
|
<p>
|
||||||
|
<b>English 丨 <a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README.md">简体中文</a></b>
|
||||||
|
</p>
|
||||||
<a href="https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases"><img alt="GitHub all releases" src="https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.lt2333.simplicitytools/total?label=Downloads"></a>
|
<a href="https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases"><img alt="GitHub all releases" src="https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.lt2333.simplicitytools/total?label=Downloads"></a>
|
||||||
<a href="https://github.com/LittleTurtle2333/SimplicityTools/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/LittleTurtle2333/SimplicityTools"></a>
|
<a href="https://github.com/LittleTurtle2333/SimplicityTools/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/LittleTurtle2333/SimplicityTools"></a>
|
||||||
<a href="https://github.com/LittleTurtle2333/SimplicityTools/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/LittleTurtle2333/SimplicityTools"></a>
|
<a href="https://github.com/LittleTurtle2333/SimplicityTools/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/LittleTurtle2333/SimplicityTools"></a>
|
||||||
<a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/LittleTurtle2333/SimplicityTools"></a>
|
<a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/LittleTurtle2333/SimplicityTools"></a>
|
||||||
<p>A system extension Xposed module based on MIUI13+ (Android12+) </p>
|
<p>A system extension Xposed module based on MIUI13 (Android12) </p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Module Description
|
### Description
|
||||||
|
|
||||||
Currently only developed based on `Android13`, `Android12` is almost no longer maintained. There are also cases where the development is based on `Android13`, but it can be used in `Android12`. Developers in the community who use `Android12` are requested to submit `Pull Request` after testing and repairing by themselves.
|
Only MIUI13 (Android12) is supported. The rest of the versions not be valid.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Screenshot
|
### Screenshot
|
||||||
|

|
||||||

|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Download
|
### Download
|
||||||
|
|
||||||
Xposed Repo:[Click here to download the latest release](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases)
|
Xposed Repo:[Click here to download the latest release](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases)
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Participate in translation
|
### Participate in translation
|
||||||
|
[](https://crowdin.com/project/simplicitytools)[Click here to Crowdin](https://crowdin.com/project/simplicitytools)
|
||||||
[](https://crowdin.com/project/simplicitytools) [Click here to Crowdin](https://crowdin.com/project/simplicitytools)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Third party open source references
|
## Third party open source references
|
||||||
|
|
||||||
##### GNU General Public License v3.0
|
##### GNU General Public License v3.0
|
||||||
|
[qqlittleice/MiuiHome](https://github.com/qqlittleice/MiuiHome)
|
||||||
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
|
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
|
||||||
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
|
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
|
||||||
[MonwF/customiuizer](https://github.com/MonwF/customiuizer)
|
|
||||||
|
|
||||||
##### GNU General Public License v2.0
|
##### GNU General Public License v2.0
|
||||||
|
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
|
||||||
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
|
|
||||||
|
|
||||||
##### GNU Lesser General Public License v2.1
|
##### GNU Lesser General Public License v2.1
|
||||||
|
|
||||||
[577fkj/blockmiui](https://github.com/577fkj/blockmiui)
|
[577fkj/blockmiui](https://github.com/577fkj/blockmiui)
|
||||||
|
|
||||||
##### Apache License 2.0
|
##### Apache License 2.0
|
||||||
|
|
||||||
[KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper)
|
[KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[GNU General Public License v3.0](https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE)
|
[GNU General Public License v3.0](https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE)
|
||||||
|
|||||||
@@ -6,21 +6,22 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk = 33
|
compileSdk = 32
|
||||||
|
buildToolsVersion = "32.0.0"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.lt2333.simplicitytools"
|
applicationId = "com.lt2333.simplicitytools"
|
||||||
minSdk = 31
|
minSdk = 31
|
||||||
targetSdk = 33
|
targetSdk = 32
|
||||||
versionCode = 75
|
versionCode = 66
|
||||||
versionName = "1.7.5"
|
versionName = "1.6.5"
|
||||||
buildConfigField("String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
isShrinkResources = true
|
isShrinkResources = true
|
||||||
setProguardFiles(listOf("proguard-rules.pro"))
|
setProguardFiles(listOf("proguard-rules.pro")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@@ -43,7 +44,8 @@ android {
|
|||||||
}
|
}
|
||||||
applicationVariants.all {
|
applicationVariants.all {
|
||||||
outputs.all {
|
outputs.all {
|
||||||
(this as BaseVariantOutputImpl).outputFileName = "WooBoxForMIUI-$versionName-$name.apk"
|
(this as BaseVariantOutputImpl).outputFileName =
|
||||||
|
"WooBoxForMIUI-$versionName-$name.apk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,10 +53,10 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
//API
|
//API
|
||||||
compileOnly("de.robv.android.xposed:api:82")
|
compileOnly("de.robv.android.xposed:api:82")
|
||||||
implementation("com.github.kyuubiran:EzXHelper:1.0.3")
|
implementation("com.github.kyuubiran:EzXHelper:0.8.6")
|
||||||
//UI
|
//UI
|
||||||
implementation(project(":blockmiui"))
|
implementation(project(":blockmiui"))
|
||||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
|
||||||
//APP Center
|
//APP Center
|
||||||
val appCenterSdkVersion = "4.4.3"
|
val appCenterSdkVersion = "4.4.3"
|
||||||
implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}")
|
implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}")
|
||||||
|
|||||||
2
app/proguard-rules.pro
vendored
2
app/proguard-rules.pro
vendored
@@ -27,7 +27,7 @@
|
|||||||
public void *(de.robv.android.xposed.IXposedHookZygoteInit$StartupParam);
|
public void *(de.robv.android.xposed.IXposedHookZygoteInit$StartupParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
-keep class * extends com.lt2333.simplicitytools.utils.xposed.EasyXposedInit
|
-keep class * extends com.lt2333.simplicitytools.util.xposed.EasyXposedInit
|
||||||
|
|
||||||
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
|
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
|
||||||
public static void check*(...);
|
public static void check*(...);
|
||||||
|
|||||||
@@ -11,13 +11,12 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.MainActivity"
|
android:name=".activity.SettingsActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:launchMode="singleTop">
|
android:launchMode="singleTop">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
<category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" />
|
<category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
@@ -27,7 +26,7 @@
|
|||||||
android:name=".launcher"
|
android:name=".launcher"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:targetActivity=".activity.MainActivity">
|
android:targetActivity=".activity.SettingsActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
@@ -48,7 +47,7 @@
|
|||||||
android:resource="@array/xposed_scope" />
|
android:resource="@array/xposed_scope" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".tiles.LockMaxFpsTile"
|
android:name=".tile.LockMaxFpsTile"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:icon="@drawable/ic_fps"
|
android:icon="@drawable/ic_fps"
|
||||||
android:label="@string/lock_max"
|
android:label="@string/lock_max"
|
||||||
@@ -59,7 +58,7 @@
|
|||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".tiles.AllowScreenshots"
|
android:name=".tile.AllowScreenshots"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:icon="@drawable/ic_baseline_fullscreen_24"
|
android:icon="@drawable/ic_baseline_fullscreen_24"
|
||||||
android:label="@string/allow_screenshots"
|
android:label="@string/allow_screenshots"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
com.lt2333.simplicitytools.hooks.MainHook
|
com.lt2333.simplicitytools.hook.XposedEntry
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import com.lt2333.simplicitytools.BuildConfig
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
import com.lt2333.simplicitytools.activity.pages.all.AboutPage
|
|
||||||
import com.lt2333.simplicitytools.activity.pages.all.MenuPage
|
|
||||||
import com.lt2333.simplicitytools.activity.pages.s.*
|
|
||||||
import com.lt2333.simplicitytools.activity.pages.t.*
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.android.*
|
|
||||||
import com.microsoft.appcenter.AppCenter
|
|
||||||
import com.microsoft.appcenter.analytics.Analytics
|
|
||||||
import com.microsoft.appcenter.crashes.Crashes
|
|
||||||
import java.util.*
|
|
||||||
import kotlin.system.exitProcess
|
|
||||||
|
|
||||||
class MainActivity : MIUIActivity() {
|
|
||||||
private val activity = this
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
if (!checkLSPosed()) isLoad = false
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
if (isLoad && !BuildConfig.DEBUG) {
|
|
||||||
AppCenter.start(
|
|
||||||
application,
|
|
||||||
"ae2037d3-9914-4e0c-b02b-f9b2bb2574e5",
|
|
||||||
Analytics::class.java,
|
|
||||||
Crashes::class.java
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//检测LSPosed是否激活
|
|
||||||
@SuppressLint("WorldReadableFiles")
|
|
||||||
private fun checkLSPosed(): Boolean {
|
|
||||||
try {
|
|
||||||
setSP(getSharedPreferences("config", MODE_WORLD_READABLE))
|
|
||||||
return true
|
|
||||||
} catch (exception: SecurityException) {
|
|
||||||
MIUIDialog(this) {
|
|
||||||
setTitle(R.string.Tips)
|
|
||||||
setMessage(R.string.not_support)
|
|
||||||
setCancelable(false)
|
|
||||||
setRButton(R.string.Done) {
|
|
||||||
exitProcess(0)
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
init {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
registerPage(MainPageForT::class.java)
|
|
||||||
registerPage(SystemUIPageForT::class.java)
|
|
||||||
registerPage(AndroidPageForT::class.java)
|
|
||||||
registerPage(OtherPageForT::class.java)
|
|
||||||
registerPage(HideIconPageForT::class.java)
|
|
||||||
registerPage(AboutPage::class.java)
|
|
||||||
registerPage(MenuPage::class.java)
|
|
||||||
}
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
registerPage(MainPageForS::class.java)
|
|
||||||
registerPage(SystemUIPageForS::class.java)
|
|
||||||
registerPage(AndroidPageForS::class.java)
|
|
||||||
registerPage(OtherPageForS::class.java)
|
|
||||||
registerPage(HideIconPageForS::class.java)
|
|
||||||
registerPage(AboutPage::class.java)
|
|
||||||
registerPage(MenuPage::class.java)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,200 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.all
|
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.net.Uri
|
|
||||||
import android.widget.Toast
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import com.lt2333.simplicitytools.BuildConfig
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("about_module","About Module", hideMenu = true)
|
|
||||||
class AboutPage : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
Author(
|
|
||||||
authorHead = getDrawable(R.drawable.app_icon)!!,
|
|
||||||
authorName = getString(R.string.app_name),
|
|
||||||
authorTips = "${
|
|
||||||
SimpleDateFormat(
|
|
||||||
"yyyy-MM-dd HH:mm:ss",
|
|
||||||
Locale.getDefault()
|
|
||||||
).format(BuildConfig.BUILD_TIME.toLong())
|
|
||||||
}\n${BuildConfig.VERSION_NAME}(${BuildConfig.BUILD_TYPE})",
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
activity.startActivity(
|
|
||||||
Intent(
|
|
||||||
Intent.ACTION_VIEW,
|
|
||||||
Uri.parse("coolmarket://apk/com.lt2333.simplicitytools")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
Toast.makeText(activity, "恳求一个五星好评,Thanks♪(・ω・)ノ", Toast.LENGTH_LONG)
|
|
||||||
.show()
|
|
||||||
} catch (e: Exception) {
|
|
||||||
val uri =
|
|
||||||
Uri.parse("https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
Line()
|
|
||||||
TitleText(text = getString(R.string.developer))
|
|
||||||
Author(
|
|
||||||
authorHead = getDrawable(R.drawable.lt)!!,
|
|
||||||
authorName = "乌堆小透明",
|
|
||||||
authorTips = "LittleTurtle2333",
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
activity.startActivity(
|
|
||||||
Intent(
|
|
||||||
Intent.ACTION_VIEW,
|
|
||||||
Uri.parse("coolmarket://u/883441")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
Toast.makeText(activity, "乌堆小透明:靓仔,点个关注吧!", Toast.LENGTH_SHORT).show()
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "本机未安装酷安应用", Toast.LENGTH_SHORT).show()
|
|
||||||
val uri = Uri.parse("https://www.coolapk.com/u/883441")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
Line()
|
|
||||||
TitleText(text = getString(R.string.thank_list))
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.contributor_list,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
val uri =
|
|
||||||
Uri.parse("https://github.com/LittleTurtle2333/SimplicityTools/graphs/contributors")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.third_party_open_source_statement,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
val uri =
|
|
||||||
Uri.parse("https://github.com/LittleTurtle2333/SimplicityTools#%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BC%80%E6%BA%90%E5%BC%95%E7%94%A8")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(text = getString(R.string.discussions))
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.qq_channel, onClickListener = {
|
|
||||||
try {
|
|
||||||
val uri =
|
|
||||||
Uri.parse("https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&inviteCode=29Mu64&from=246610&biz=ka")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.tg_channel,
|
|
||||||
tipsId = R.string.tg_channel_summary,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
activity.startActivity(
|
|
||||||
Intent(
|
|
||||||
Intent.ACTION_VIEW,
|
|
||||||
Uri.parse("tg://resolve?domain=simplicityrom")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "本机未安装Telegram应用", Toast.LENGTH_SHORT)
|
|
||||||
.show()
|
|
||||||
val uri = Uri.parse("https://t.me/simplicityrom")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.issues,
|
|
||||||
tipsId = R.string.issues_url,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
val uri =
|
|
||||||
Uri.parse("https://github.com/LittleTurtle2333/SimplicityTools/issues")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(getString(R.string.other))
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.app_coolapk_url,
|
|
||||||
tipsId = R.string.app_coolapk_url_summary,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
activity.startActivity(
|
|
||||||
Intent(
|
|
||||||
Intent.ACTION_VIEW,
|
|
||||||
Uri.parse("coolmarket://apk/com.lt2333.simplicitytools")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
Toast.makeText(
|
|
||||||
activity,
|
|
||||||
"恳求一个五星好评,Thanks♪(・ω・)ノ",
|
|
||||||
Toast.LENGTH_LONG
|
|
||||||
).show()
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "本机未安装酷安应用", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.opensource,
|
|
||||||
tipsId = R.string.github_url,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
val uri =
|
|
||||||
Uri.parse("https://github.com/LittleTurtle2333/SimplicityTools")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.participate_in_translation,
|
|
||||||
tipsId = R.string.participate_in_translation_summary,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
val uri = Uri.parse("https://crowdin.com/project/simplicitytools")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.all
|
|
||||||
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMMenuPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
import com.lt2333.simplicitytools.utils.ShellUtils
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
|
|
||||||
@BMMenuPage("Menu")
|
|
||||||
class MenuPage : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.reboot, onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.Tips)
|
|
||||||
setMessage(R.string.are_you_sure_reboot)
|
|
||||||
setLButton(R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(R.string.Done) {
|
|
||||||
val command = arrayOf("reboot")
|
|
||||||
ShellUtils.execCommand(command, true)
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}))
|
|
||||||
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.reboot_host, onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.Tips)
|
|
||||||
setMessage(R.string.are_you_sure_reboot_scope)
|
|
||||||
setLButton(R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(R.string.Done) {
|
|
||||||
val command = arrayOf(
|
|
||||||
"killall com.android.systemui",
|
|
||||||
"killall com.miui.home",
|
|
||||||
"killall com.miui.securitycenter ",
|
|
||||||
"killall com.android.settings",
|
|
||||||
"killall com.miui.powerkeeper",
|
|
||||||
"killall com.android.updater",
|
|
||||||
"killall com.miui.mediaeditor",
|
|
||||||
"killall com.miui.screenshot",
|
|
||||||
"killall com.milink.service",
|
|
||||||
"killall com.xiaomi.misubscreenui",
|
|
||||||
"killall com.miui.packageinstaller"
|
|
||||||
)
|
|
||||||
ShellUtils.execCommand(command, true)
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.s
|
|
||||||
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.Switch
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("scope_android","Android", hideMenu = false)
|
|
||||||
class AndroidPageForS : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TitleText(textId = R.string.corepacth)
|
|
||||||
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.downgr,
|
|
||||||
tipsId = R.string.downgr_summary
|
|
||||||
), SwitchV("downgrade")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.authcreak,
|
|
||||||
tipsId = R.string.authcreak_summary
|
|
||||||
), SwitchV("authcreak")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.digestCreak,
|
|
||||||
tipsId = R.string.digestCreak_summary
|
|
||||||
), SwitchV("digestCreak")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.UsePreSig,
|
|
||||||
tipsId = R.string.UsePreSig_summary
|
|
||||||
), SwitchV("UsePreSig")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.enhancedMode,
|
|
||||||
tipsId = R.string.enhancedMode_summary
|
|
||||||
), SwitchV("enhancedMode")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.disable_flag_secure,
|
|
||||||
tipsId = R.string.disable_flag_secure_summary
|
|
||||||
), SwitchV("disable_flag_secure")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.delete_on_post_notification,
|
|
||||||
tipsId = R.string.delete_on_post_notification_summary
|
|
||||||
), SwitchV("delete_on_post_notification")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_small_window_restrictions,
|
|
||||||
tipsId = R.string.remove_small_window_restrictions_summary
|
|
||||||
), SwitchV("remove_small_window_restrictions")
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.max_wallpaper_scale,
|
|
||||||
onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.max_wallpaper_scale)
|
|
||||||
setEditText(
|
|
||||||
"",
|
|
||||||
"${activity.getString(R.string.def)}1.1, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getFloat("max_wallpaper_scale", 1.1f)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText() != "") {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"max_wallpaper_scale",
|
|
||||||
getEditText().toFloat()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.allow_untrusted_touches,
|
|
||||||
tipsId = R.string.take_effect_after_reboot
|
|
||||||
), SwitchV("allow_untrusted_touches")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.sound)
|
|
||||||
val mediaVolumeStepsSwitchBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"media_volume_steps_switch",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.media_volume_steps_switch,
|
|
||||||
tips = "${getString(R.string.take_effect_after_reboot)}\n${getString(R.string.media_volume_steps_summary)}"
|
|
||||||
),
|
|
||||||
SwitchV(
|
|
||||||
"media_volume_steps_switch",
|
|
||||||
dataBindingSend = mediaVolumeStepsSwitchBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"media_volume_steps",
|
|
||||||
15,
|
|
||||||
29,
|
|
||||||
15,
|
|
||||||
dataBindingRecv = mediaVolumeStepsSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.s
|
|
||||||
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.Switch
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.activity.view.TextV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("hide_icon","Hide Icon", hideMenu = false)
|
|
||||||
class HideIconPageForS : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TitleText(textId = R.string.status_bar_icon)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_battery_icon),
|
|
||||||
SwitchV("hide_battery_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_battery_charging_icon),
|
|
||||||
SwitchV("hide_battery_charging_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_gps_icon), SwitchV("hide_gps_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_bluetooth_icon),
|
|
||||||
SwitchV("hide_bluetooth_icon")
|
|
||||||
)
|
|
||||||
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_nfc_icon), SwitchV("hide_nfc_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_bluetooth_battery_icon),
|
|
||||||
SwitchV("hide_bluetooth_battery_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_small_hd_icon),
|
|
||||||
SwitchV("hide_small_hd_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_big_hd_icon),
|
|
||||||
SwitchV("hide_big_hd_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_new_hd_icon),
|
|
||||||
SwitchV("hide_new_hd_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_hd_no_service_icon),
|
|
||||||
SwitchV("hide_hd_no_service_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_no_sim_icon),
|
|
||||||
SwitchV("hide_no_sim_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_sim_one_icon),
|
|
||||||
SwitchV("hide_sim_one_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_sim_two_icon),
|
|
||||||
SwitchV("hide_sim_two_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_mobile_activity_icon),
|
|
||||||
SwitchV("hide_mobile_activity_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_mobile_type_icon),
|
|
||||||
SwitchV("hide_mobile_type_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_wifi_icon), SwitchV("hide_wifi_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_wifi_activity_icon),
|
|
||||||
SwitchV("hide_wifi_activity_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_wifi_standard_icon),
|
|
||||||
SwitchV("hide_wifi_standard_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_slave_wifi_icon),
|
|
||||||
SwitchV("hide_slave_wifi_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_hotspot_icon),
|
|
||||||
SwitchV("hide_hotspot_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_vpn_icon), SwitchV("hide_vpn_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_airplane_icon),
|
|
||||||
SwitchV("hide_airplane_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_alarm_icon), SwitchV("hide_alarm_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_headset_icon),
|
|
||||||
SwitchV("hide_headset_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_volume_icon),
|
|
||||||
SwitchV("hide_volume_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_zen_icon), SwitchV("hide_zen_icon"))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.s
|
|
||||||
|
|
||||||
import android.content.ComponentName
|
|
||||||
import android.content.pm.PackageManager
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMMainPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import com.lt2333.simplicitytools.BuildConfig
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMMainPage("WooBox[MIUI13]")
|
|
||||||
class MainPageForS : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.main_switch,
|
|
||||||
colorId = R.color.blue
|
|
||||||
), SwitchV("main_switch", true)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.HideLauncherIcon),
|
|
||||||
SwitchV("hLauncherIcon", onClickListener = {
|
|
||||||
activity.packageManager.setComponentEnabledSetting(
|
|
||||||
ComponentName(activity, "${BuildConfig.APPLICATION_ID}.launcher"),
|
|
||||||
if (it) {
|
|
||||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
|
||||||
} else {
|
|
||||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
|
||||||
},
|
|
||||||
PackageManager.DONT_KILL_APP
|
|
||||||
)
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.matters_needing_attention,
|
|
||||||
colorId = R.color.red,
|
|
||||||
onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.matters_needing_attention)
|
|
||||||
setMessage(R.string.matters_needing_attention_context)
|
|
||||||
setRButton(R.string.Done) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
})
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.scope)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.scope_systemui,
|
|
||||||
tipsId = R.string.scope_systemui_summary,
|
|
||||||
onClickListener = { showFragment("scope_systemui") })
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.scope_android,
|
|
||||||
tipsId = R.string.scope_android_summary,
|
|
||||||
onClickListener = { showFragment("scope_android") })
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.scope_other,
|
|
||||||
tipsId = R.string.scope_other_summary,
|
|
||||||
onClickListener = { showFragment("scope_other") })
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.about)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.about_module,
|
|
||||||
tips = getString(R.string.about_module_summary),
|
|
||||||
onClickListener = { showFragment("about_module") })
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.s
|
|
||||||
|
|
||||||
import android.content.ComponentName
|
|
||||||
import android.content.Intent
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.Switch
|
|
||||||
import android.widget.Toast
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("scope_other", "Other", hideMenu = false)
|
|
||||||
class OtherPageForS : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TitleText(textId = R.string.scope_miuihome)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.home_time,
|
|
||||||
tipsId = R.string.home_time_summary
|
|
||||||
), SwitchV("home_time")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.double_tap_to_sleep,
|
|
||||||
tipsId = R.string.home_double_tap_to_sleep_summary
|
|
||||||
), SwitchV("double_tap_to_sleep")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.miuihome_recentwiew_wallpaper_darkening, tipsId = R.string.miuihome_recentwiew_wallpaper_darkening_summary
|
|
||||||
), SwitchV("miuihome_recentwiew_wallpaper_darkening", false)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.miuihome_recentview_remove_card_animation, tipsId = R.string.miuihome_recentview_remove_card_animation_summary
|
|
||||||
), SwitchV("miuihome_recentview_remove_card_animation", false)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.miuihome_shortcut_add_small_window, tipsId = R.string.miuihome_shortcut_add_small_window_summary),
|
|
||||||
SwitchV("miuihome_shortcut_add_small_window", false)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.miuihome_scroll_icon_name, tipsId = R.string.miuihome_scroll_icon_name_summary),
|
|
||||||
SwitchV("miuihome_scroll_icon_name", false)
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.scope_powerkeeper)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.lock_max_fps,
|
|
||||||
tipsId = R.string.lock_max_fps_summary
|
|
||||||
), SwitchV("lock_max_fps")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.prevent_recovery_of_battery_optimization_white_list,
|
|
||||||
tipsId = R.string.failed_after_restart
|
|
||||||
), SwitchV("prevent_recovery_of_battery_optimization_white_list")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.do_not_clear_app,
|
|
||||||
tipsId = R.string.do_not_clear_app_summary
|
|
||||||
), SwitchV("do_not_clear_app")
|
|
||||||
)
|
|
||||||
val makeMilletMoreAggressiveSwitchBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"make_millet_more_aggressive",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.make_millet_more_aggressive,
|
|
||||||
tipsId = R.string.make_millet_more_aggressive_summary
|
|
||||||
),
|
|
||||||
SwitchV(
|
|
||||||
"make_millet_more_aggressive",
|
|
||||||
dataBindingSend = makeMilletMoreAggressiveSwitchBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.make_millet_ignore_active,
|
|
||||||
tipsId = R.string.make_millet_ignore_active_summary
|
|
||||||
),
|
|
||||||
SwitchV("make_millet_ignore_active"),
|
|
||||||
dataBindingRecv = makeMilletMoreAggressiveSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.battery_optimization,
|
|
||||||
tipsId = R.string.battery_optimization_summary,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
val intent = Intent()
|
|
||||||
val comp = ComponentName(
|
|
||||||
"com.android.settings",
|
|
||||||
"com.android.settings.Settings\$HighPowerApplicationsActivity"
|
|
||||||
)
|
|
||||||
intent.component = comp
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "启动失败,可能是不支持", Toast.LENGTH_LONG).show()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.scope_securitycenter)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.skip_waiting_time,
|
|
||||||
tipsId = R.string.skip_waiting_time_summary
|
|
||||||
), SwitchV("skip_waiting_time")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_open_app_confirmation_popup,
|
|
||||||
tipsId = R.string.remove_open_app_confirmation_popup_summary
|
|
||||||
), SwitchV("remove_open_app_confirmation_popup")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.lock_one_hundred,
|
|
||||||
tipsId = R.string.lock_one_hundred_summary
|
|
||||||
), SwitchV("lock_one_hundred")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.remove_macro_blacklist),
|
|
||||||
SwitchV("remove_macro_blacklist")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.battery_life_function),
|
|
||||||
SwitchV("battery_life_function")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.scope_mediaeditor)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.unlock_unlimited_cropping,
|
|
||||||
tipsId = R.string.unlock_unlimited_cropping_summary
|
|
||||||
), SwitchV("unlock_unlimited_cropping")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.updater)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_ota_validate,
|
|
||||||
tipsId = R.string.remove_ota_validate_summary
|
|
||||||
), SwitchV("remove_ota_validate")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.settings)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_notification_importance,
|
|
||||||
tipsId = R.string.show_notification_importance_summary
|
|
||||||
), SwitchV("show_notification_importance")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.cast)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.force_support_send_app,
|
|
||||||
), SwitchV("force_support_send_app")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.rear_display)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_weather_main_switch,
|
|
||||||
), SwitchV("rear_show_weather")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.remove_ad)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.remove_thememanager_ads),
|
|
||||||
SwitchV("remove_thememanager_ads")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.pkg_installer)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.pkg_installer_summary),
|
|
||||||
SwitchV("pkg_installer_count_checking")
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,740 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.s
|
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.net.Uri
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.Switch
|
|
||||||
import android.widget.Toast
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SpinnerV
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.activity.view.TextV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import cn.fkj233.ui.dialog.NewDialog
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("scope_systemui", "System UI", hideMenu = false)
|
|
||||||
class SystemUIPageForS : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TitleText(textId = R.string.statusbar)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.double_tap_to_sleep),
|
|
||||||
SwitchV("status_bar_double_tap_to_sleep")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.status_bar_layout)
|
|
||||||
val statusBarLayoutMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
|
||||||
it[0] = getString(R.string.default1)
|
|
||||||
it[1] = getString(R.string.clock_center)
|
|
||||||
it[2] = getString(R.string.clock_right)
|
|
||||||
it[3] = getString(R.string.clock_center_and_icon_left)
|
|
||||||
}
|
|
||||||
TextWithSpinner(
|
|
||||||
TextV(textId = R.string.status_bar_layout_mode),
|
|
||||||
SpinnerV(
|
|
||||||
statusBarLayoutMode[MIUIActivity.safeSP.getInt(
|
|
||||||
"status_bar_layout_mode",
|
|
||||||
0
|
|
||||||
)].toString()
|
|
||||||
) {
|
|
||||||
add(statusBarLayoutMode[0].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 0)
|
|
||||||
}
|
|
||||||
add(statusBarLayoutMode[1].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 1)
|
|
||||||
}
|
|
||||||
add(statusBarLayoutMode[2].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 2)
|
|
||||||
}
|
|
||||||
add(statusBarLayoutMode[3].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 3)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
val layoutCompatibilityBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"layout_compatibility_mode", false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.layout_compatibility_mode, tipsId = R.string.layout_compatibility_mode_summary
|
|
||||||
), SwitchV("layout_compatibility_mode", dataBindingSend = layoutCompatibilityBinding.bindingSend)
|
|
||||||
)
|
|
||||||
|
|
||||||
Text(
|
|
||||||
textId = R.string.left_margin, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_left_margin", 0, 300, 0, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.right_margin, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_right_margin", 0, 300, 0, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.status_bar_clock_format)
|
|
||||||
|
|
||||||
|
|
||||||
val customClockPresetBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getInt(
|
|
||||||
"custom_clock_mode",
|
|
||||||
0
|
|
||||||
) == 1
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val customClockGeekBinding =
|
|
||||||
GetDataBinding({ MIUIActivity.safeSP.getInt("custom_clock_mode", 0) == 2 }
|
|
||||||
|
|
||||||
) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val customClockMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
|
||||||
it[0] = getString(R.string.off)
|
|
||||||
it[1] = getString(R.string.preset)
|
|
||||||
it[2] = getString(R.string.geek)
|
|
||||||
}
|
|
||||||
TextWithSpinner(
|
|
||||||
TextV(textId = R.string.custom_clock_mode),
|
|
||||||
SpinnerV(customClockMode[MIUIActivity.safeSP.getInt("custom_clock_mode", 0)].toString()) {
|
|
||||||
add(customClockMode[0].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 0)
|
|
||||||
customClockPresetBinding.binding.Send().send(false)
|
|
||||||
customClockGeekBinding.binding.Send().send(false)
|
|
||||||
}
|
|
||||||
add(customClockMode[1].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 1)
|
|
||||||
customClockPresetBinding.binding.Send().send(true)
|
|
||||||
customClockGeekBinding.binding.Send().send(false)
|
|
||||||
}
|
|
||||||
add(customClockMode[2].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 2)
|
|
||||||
customClockPresetBinding.binding.Send().send(false)
|
|
||||||
customClockGeekBinding.binding.Send().send(true)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//预设模式起始
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_year),
|
|
||||||
SwitchV("status_bar_time_year"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_month),
|
|
||||||
SwitchV("status_bar_time_month"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_day),
|
|
||||||
SwitchV("status_bar_time_day"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_week),
|
|
||||||
SwitchV("status_bar_time_week"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_double_hour),
|
|
||||||
SwitchV("status_bar_time_double_hour"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_period),
|
|
||||||
SwitchV("status_bar_time_period", true),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_seconds),
|
|
||||||
SwitchV("status_bar_time_seconds"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_hide_space),
|
|
||||||
SwitchV("status_bar_time_hide_space"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_double_line),
|
|
||||||
SwitchV("status_bar_time_double_line"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
|
||||||
SwitchV("status_bar_time_double_line_center_align"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.status_bar_clock_size,
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_clock_size",
|
|
||||||
0,
|
|
||||||
18,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.status_bar_clock_double_line_size,
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_clock_double_line_size",
|
|
||||||
0,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
//预设模式结束
|
|
||||||
|
|
||||||
//极客模式起始
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
|
|
||||||
NewDialog(activity) {
|
|
||||||
setTitle(R.string.custom_clock_format_geek)
|
|
||||||
setEditText(
|
|
||||||
MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "", isSingleLine = false
|
|
||||||
)
|
|
||||||
Button(getString(R.string.click_to_view_use_cases)) {
|
|
||||||
val locale = context.resources.configuration.locale
|
|
||||||
val language = locale.language
|
|
||||||
if (language.endsWith("zh")) {
|
|
||||||
val uri = Uri.parse("https://zhuti.designer.xiaomi.com/docs/grammar/#%E6%97%B6%E9%97%B4%E6%97%A5%E6%9C%9F")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} else {
|
|
||||||
val uri = Uri.parse("https://docs.google.com/spreadsheets/d/1ghkT2iFbxB3bT4TKCiKAfmEdGt6kTVKFU3dm4Nz1or8/edit?usp=sharing")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Button(getString(R.string.Done)) {
|
|
||||||
if (getEditText().isNotEmpty()) {
|
|
||||||
try {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_format_geek", getEditText())
|
|
||||||
dismiss()
|
|
||||||
return@Button
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
Button(getString(R.string.cancel), cancelStyle = true) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}, dataBindingRecv = customClockGeekBinding.binding.getRecv(2))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
|
||||||
SwitchV("status_bar_time_center_align_geek"),
|
|
||||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.status_bar_clock_size,
|
|
||||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_clock_size_geek",
|
|
||||||
0,
|
|
||||||
18,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
//极客模式结束
|
|
||||||
|
|
||||||
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.status_bar_icon)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.hide_icon,
|
|
||||||
onClickListener = { showFragment("hide_icon") })
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.show_wifi_standard),
|
|
||||||
SwitchV("show_wifi_standard")
|
|
||||||
)
|
|
||||||
val customMobileTypeTextBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"custom_mobile_type_text_switch",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.custom_mobile_type_text_switch),
|
|
||||||
SwitchV(
|
|
||||||
"custom_mobile_type_text_switch",
|
|
||||||
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.custom_mobile_type_text) {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.custom_mobile_type_text)
|
|
||||||
setEditText(MIUIActivity.safeSP.getString("custom_mobile_type_text", "5G"), "")
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText().isNotEmpty()) {
|
|
||||||
try {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_mobile_type_text", getEditText())
|
|
||||||
dismiss()
|
|
||||||
return@setRButton
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
|
||||||
.show()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}, dataBindingRecv = customMobileTypeTextBinding.binding.getRecv(2))
|
|
||||||
val bigMobileTypeIconBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"big_mobile_type_icon",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.big_mobile_type_icon),
|
|
||||||
SwitchV(
|
|
||||||
"big_mobile_type_icon",
|
|
||||||
dataBindingSend = bigMobileTypeIconBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.big_mobile_type_icon_bold),
|
|
||||||
SwitchV("big_mobile_type_icon_bold", true),
|
|
||||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.big_mobile_type_icon_size,
|
|
||||||
onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.big_mobile_type_icon_size)
|
|
||||||
setEditText(
|
|
||||||
"",
|
|
||||||
"${activity.getString(R.string.def)}12.5, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getFloat("big_mobile_type_icon_size", 12.5f)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText() != "") {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"big_mobile_type_icon_size",
|
|
||||||
getEditText().toFloat()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_up_and_down_position) {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.big_mobile_type_icon_up_and_down_position)
|
|
||||||
setMessage("${activity.getString(R.string.range)} -15~15")
|
|
||||||
setEditText(
|
|
||||||
"",
|
|
||||||
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText().isNotEmpty()) {
|
|
||||||
try {
|
|
||||||
val value = getEditText().toInt()
|
|
||||||
if (value in (-15..15)) {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"big_mobile_type_icon_up_and_down_position",
|
|
||||||
value
|
|
||||||
)
|
|
||||||
dismiss()
|
|
||||||
return@setRButton
|
|
||||||
}
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
|
||||||
.show()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_left_and_right_margins) {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.big_mobile_type_icon_left_and_right_margins)
|
|
||||||
setMessage("${activity.getString(R.string.range)} 0~30")
|
|
||||||
setEditText(
|
|
||||||
"",
|
|
||||||
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_left_and_right_margins", 0)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText().isNotEmpty()) {
|
|
||||||
try {
|
|
||||||
val value = getEditText().toInt()
|
|
||||||
if (value in (0..30)) {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"big_mobile_type_icon_left_and_right_margins",
|
|
||||||
value
|
|
||||||
)
|
|
||||||
dismiss()
|
|
||||||
return@setRButton
|
|
||||||
}
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
|
||||||
.show()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
|
||||||
Text(textId = R.string.maximum_number_of_notification_icons)
|
|
||||||
SeekBarWithText("maximum_number_of_notification_icons", 1, 30, 3)
|
|
||||||
Text(textId = R.string.maximum_number_of_notification_dots)
|
|
||||||
SeekBarWithText("maximum_number_of_notification_dots", 0, 4, 3)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.battery_percentage_font_size,
|
|
||||||
onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.battery_percentage_font_size)
|
|
||||||
setMessage(R.string.zero_do_no_change)
|
|
||||||
setEditText(
|
|
||||||
"", "${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getFloat("battery_percentage_font_size", 0f)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText() != "") {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"battery_percentage_font_size",
|
|
||||||
getEditText().toFloat()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.hide_battery_percentage_icon,
|
|
||||||
tipsId = R.string.hide_battery_percentage_icon_summary
|
|
||||||
), SwitchV("hide_battery_percentage_icon")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.status_bar_network_speed)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.status_bar_network_speed_refresh_speed,
|
|
||||||
tipsId = R.string.status_bar_network_speed_refresh_speed_summary
|
|
||||||
), SwitchV("status_bar_network_speed_refresh_speed")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.hide_status_bar_network_speed_second,
|
|
||||||
tipsId = R.string.hide_status_bar_network_speed_second_summary
|
|
||||||
), SwitchV("hide_status_bar_network_speed_second")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_network_speed_splitter),
|
|
||||||
SwitchV("hide_network_speed_splitter")
|
|
||||||
)
|
|
||||||
val statusBarDualRowNetworkSpeedBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"status_bar_dual_row_network_speed",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.status_bar_dual_row_network_speed,
|
|
||||||
tipsId = R.string.status_bar_dual_row_network_speed_summary
|
|
||||||
),
|
|
||||||
SwitchV(
|
|
||||||
"status_bar_dual_row_network_speed",
|
|
||||||
dataBindingSend = statusBarDualRowNetworkSpeedBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
val align: HashMap<Int, String> = hashMapOf()
|
|
||||||
align[0] = getString(R.string.left)
|
|
||||||
align[1] = getString(R.string.right)
|
|
||||||
TextWithSpinner(
|
|
||||||
TextV(textId = R.string.status_bar_network_speed_dual_row_gravity),
|
|
||||||
SpinnerV(
|
|
||||||
align[MIUIActivity.safeSP.getInt(
|
|
||||||
"status_bar_network_speed_dual_row_gravity",
|
|
||||||
0
|
|
||||||
)].toString()
|
|
||||||
) {
|
|
||||||
add(align[0].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 0)
|
|
||||||
}
|
|
||||||
add(align[1].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 1)
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSpinner(
|
|
||||||
TextV(textId = R.string.status_bar_network_speed_dual_row_icon),
|
|
||||||
SpinnerV(
|
|
||||||
MIUIActivity.safeSP.getString(
|
|
||||||
"status_bar_network_speed_dual_row_icon",
|
|
||||||
getString(R.string.none)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
add(getString(R.string.none)) {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"status_bar_network_speed_dual_row_icon",
|
|
||||||
getString(R.string.none)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
add("▲▼") {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "▲▼")
|
|
||||||
}
|
|
||||||
add("△▽") {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "△▽")
|
|
||||||
}
|
|
||||||
add("↑↓") {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "↑↓")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
Text(
|
|
||||||
textId = R.string.status_bar_network_speed_dual_row_size,
|
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_network_speed_dual_row_size",
|
|
||||||
0,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.notification_center)
|
|
||||||
val showWeatherMainSwitchBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"notification_weather",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_weather_main_switch,
|
|
||||||
colorId = R.color.blue
|
|
||||||
),
|
|
||||||
SwitchV(
|
|
||||||
"notification_weather",
|
|
||||||
dataBindingSend = showWeatherMainSwitchBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_city,
|
|
||||||
),
|
|
||||||
SwitchV("notification_weather_city"),
|
|
||||||
dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.can_notification_slide,
|
|
||||||
tipsId = R.string.can_notification_slide_summary,
|
|
||||||
),
|
|
||||||
SwitchV("can_notification_slide"),
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.control_center)
|
|
||||||
val controlCenterWeatherBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"control_center_weather",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_weather_main_switch,
|
|
||||||
colorId = R.color.blue,
|
|
||||||
tipsId = R.string.control_center_weather_summary
|
|
||||||
),
|
|
||||||
SwitchV(
|
|
||||||
"control_center_weather",
|
|
||||||
dataBindingSend = controlCenterWeatherBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_city,
|
|
||||||
),
|
|
||||||
SwitchV("control_center_weather_city"),
|
|
||||||
dataBindingRecv = controlCenterWeatherBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.lock_screen)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.lock_screen_clock_display_seconds,
|
|
||||||
tipsId = R.string.only_official_default_themes_are_supported
|
|
||||||
), SwitchV("lock_screen_clock_display_seconds")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_the_left_side_of_the_lock_screen,
|
|
||||||
tipsId = R.string.only_official_default_themes_are_supported
|
|
||||||
), SwitchV("remove_the_left_side_of_the_lock_screen")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_lock_screen_camera,
|
|
||||||
tipsId = R.string.only_official_default_themes_are_supported
|
|
||||||
), SwitchV("remove_lock_screen_camera")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.enable_wave_charge_animation),
|
|
||||||
SwitchV("enable_wave_charge_animation")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.lock_screen_charging_current,
|
|
||||||
tipsId = R.string.only_official_default_themes_are_supported
|
|
||||||
), SwitchV("lock_screen_charging_current")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.double_tap_to_sleep,
|
|
||||||
tipsId = R.string.home_double_tap_to_sleep_summary
|
|
||||||
), SwitchV("lock_screen_double_tap_to_sleep")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.old_quick_settings_panel)
|
|
||||||
val oldQSCustomSwitchBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"old_qs_custom_switch",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.old_qs_custom_switch,
|
|
||||||
colorId = R.color.blue
|
|
||||||
),
|
|
||||||
SwitchV(
|
|
||||||
"old_qs_custom_switch",
|
|
||||||
dataBindingSend = oldQSCustomSwitchBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.qs_custom_rows,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"qs_custom_rows",
|
|
||||||
1,
|
|
||||||
6,
|
|
||||||
3,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.qs_custom_rows_horizontal,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"qs_custom_rows_horizontal",
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
2,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.qs_custom_columns,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"qs_custom_columns",
|
|
||||||
1,
|
|
||||||
7,
|
|
||||||
4,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.qs_custom_columns_unexpanded,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"qs_custom_columns_unexpanded",
|
|
||||||
1,
|
|
||||||
7,
|
|
||||||
5,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.t
|
|
||||||
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.Switch
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("scope_android","Android", hideMenu = false)
|
|
||||||
class AndroidPageForT : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TitleText(textId = R.string.corepacth)
|
|
||||||
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.downgr,
|
|
||||||
tipsId = R.string.downgr_summary
|
|
||||||
), SwitchV("downgrade")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.authcreak,
|
|
||||||
tipsId = R.string.authcreak_summary
|
|
||||||
), SwitchV("authcreak")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.digestCreak,
|
|
||||||
tipsId = R.string.digestCreak_summary
|
|
||||||
), SwitchV("digestCreak")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.UsePreSig,
|
|
||||||
tipsId = R.string.UsePreSig_summary
|
|
||||||
), SwitchV("UsePreSig")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.enhancedMode,
|
|
||||||
tipsId = R.string.enhancedMode_summary
|
|
||||||
), SwitchV("enhancedMode")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.disable_flag_secure,
|
|
||||||
tipsId = R.string.disable_flag_secure_summary
|
|
||||||
), SwitchV("disable_flag_secure")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.delete_on_post_notification,
|
|
||||||
tipsId = R.string.delete_on_post_notification_summary
|
|
||||||
), SwitchV("delete_on_post_notification")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_small_window_restrictions,
|
|
||||||
tipsId = R.string.remove_small_window_restrictions_summary
|
|
||||||
), SwitchV("remove_small_window_restrictions")
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.max_wallpaper_scale,
|
|
||||||
onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.max_wallpaper_scale)
|
|
||||||
setEditText(
|
|
||||||
"",
|
|
||||||
"${activity.getString(R.string.def)}1.2, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getFloat("max_wallpaper_scale", 1.2f)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText() != "") {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"max_wallpaper_scale",
|
|
||||||
getEditText().toFloat()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.allow_untrusted_touches,
|
|
||||||
tipsId = R.string.take_effect_after_reboot
|
|
||||||
), SwitchV("allow_untrusted_touches")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.sound)
|
|
||||||
val mediaVolumeStepsSwitchBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"media_volume_steps_switch",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.media_volume_steps_switch,
|
|
||||||
tips = "${getString(R.string.take_effect_after_reboot)}\n${getString(R.string.media_volume_steps_summary)}"
|
|
||||||
),
|
|
||||||
SwitchV(
|
|
||||||
"media_volume_steps_switch",
|
|
||||||
dataBindingSend = mediaVolumeStepsSwitchBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"media_volume_steps",
|
|
||||||
15,
|
|
||||||
29,
|
|
||||||
15,
|
|
||||||
dataBindingRecv = mediaVolumeStepsSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.t
|
|
||||||
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.Switch
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.activity.view.TextV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("hide_icon","Hide Icon", hideMenu = false)
|
|
||||||
class HideIconPageForT : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TitleText(textId = R.string.status_bar_icon)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_battery_icon),
|
|
||||||
SwitchV("hide_battery_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_battery_charging_icon),
|
|
||||||
SwitchV("hide_battery_charging_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_gps_icon), SwitchV("hide_gps_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_bluetooth_icon),
|
|
||||||
SwitchV("hide_bluetooth_icon")
|
|
||||||
)
|
|
||||||
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_nfc_icon), SwitchV("hide_nfc_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_bluetooth_battery_icon),
|
|
||||||
SwitchV("hide_bluetooth_battery_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_small_hd_icon),
|
|
||||||
SwitchV("hide_small_hd_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_big_hd_icon),
|
|
||||||
SwitchV("hide_big_hd_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_new_hd_icon),
|
|
||||||
SwitchV("hide_new_hd_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_hd_no_service_icon),
|
|
||||||
SwitchV("hide_hd_no_service_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_no_sim_icon),
|
|
||||||
SwitchV("hide_no_sim_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_sim_one_icon),
|
|
||||||
SwitchV("hide_sim_one_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_sim_two_icon),
|
|
||||||
SwitchV("hide_sim_two_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_mobile_activity_icon),
|
|
||||||
SwitchV("hide_mobile_activity_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_mobile_type_icon),
|
|
||||||
SwitchV("hide_mobile_type_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_wifi_icon), SwitchV("hide_wifi_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_wifi_activity_icon),
|
|
||||||
SwitchV("hide_wifi_activity_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_wifi_standard_icon),
|
|
||||||
SwitchV("hide_wifi_standard_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_slave_wifi_icon),
|
|
||||||
SwitchV("hide_slave_wifi_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_hotspot_icon),
|
|
||||||
SwitchV("hide_hotspot_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_vpn_icon), SwitchV("hide_vpn_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_airplane_icon),
|
|
||||||
SwitchV("hide_airplane_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_alarm_icon), SwitchV("hide_alarm_icon"))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_headset_icon),
|
|
||||||
SwitchV("hide_headset_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_volume_icon),
|
|
||||||
SwitchV("hide_volume_icon")
|
|
||||||
)
|
|
||||||
TextWithSwitch(TextV(textId = R.string.hide_zen_icon), SwitchV("hide_zen_icon"))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.t
|
|
||||||
|
|
||||||
import android.content.ComponentName
|
|
||||||
import android.content.pm.PackageManager
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMMainPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import com.lt2333.simplicitytools.BuildConfig
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMMainPage("WooBox[MIUI14]")
|
|
||||||
class MainPageForT : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.main_switch,
|
|
||||||
colorId = R.color.blue
|
|
||||||
), SwitchV("main_switch", true)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.HideLauncherIcon),
|
|
||||||
SwitchV("hLauncherIcon", onClickListener = {
|
|
||||||
activity.packageManager.setComponentEnabledSetting(
|
|
||||||
ComponentName(activity, "${BuildConfig.APPLICATION_ID}.launcher"),
|
|
||||||
if (it) {
|
|
||||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
|
||||||
} else {
|
|
||||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
|
||||||
},
|
|
||||||
PackageManager.DONT_KILL_APP
|
|
||||||
)
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.matters_needing_attention,
|
|
||||||
colorId = R.color.red,
|
|
||||||
onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.matters_needing_attention)
|
|
||||||
setMessage(R.string.matters_needing_attention_context)
|
|
||||||
setRButton(R.string.Done) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
})
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.scope)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.scope_systemui,
|
|
||||||
tipsId = R.string.scope_systemui_summary,
|
|
||||||
onClickListener = { showFragment("scope_systemui") })
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.scope_android,
|
|
||||||
tipsId = R.string.scope_android_summary,
|
|
||||||
onClickListener = { showFragment("scope_android") })
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.scope_other,
|
|
||||||
tipsId = R.string.scope_other_summary,
|
|
||||||
onClickListener = { showFragment("scope_other") })
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.about)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.about_module,
|
|
||||||
tips = getString(R.string.about_module_summary),
|
|
||||||
onClickListener = { showFragment("about_module") })
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.t
|
|
||||||
|
|
||||||
import android.content.ComponentName
|
|
||||||
import android.content.Intent
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.Switch
|
|
||||||
import android.widget.Toast
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("scope_other", "Other", hideMenu = false)
|
|
||||||
class OtherPageForT : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TitleText(textId = R.string.scope_miuihome)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.home_time,
|
|
||||||
tipsId = R.string.home_time_summary
|
|
||||||
), SwitchV("home_time")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.double_tap_to_sleep,
|
|
||||||
tipsId = R.string.home_double_tap_to_sleep_summary
|
|
||||||
), SwitchV("double_tap_to_sleep")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.miuihome_recentwiew_wallpaper_darkening, tipsId = R.string.miuihome_recentwiew_wallpaper_darkening_summary
|
|
||||||
), SwitchV("miuihome_recentwiew_wallpaper_darkening", false)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.miuihome_recentview_remove_card_animation, tipsId = R.string.miuihome_recentview_remove_card_animation_summary
|
|
||||||
), SwitchV("miuihome_recentview_remove_card_animation", false)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.miuihome_shortcut_add_small_window, tipsId = R.string.miuihome_shortcut_add_small_window_summary),
|
|
||||||
SwitchV("miuihome_shortcut_add_small_window", false)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.miuihome_scroll_icon_name, tipsId = R.string.miuihome_scroll_icon_name_summary),
|
|
||||||
SwitchV("miuihome_scroll_icon_name", false)
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.scope_powerkeeper)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.lock_max_fps,
|
|
||||||
tipsId = R.string.lock_max_fps_summary
|
|
||||||
), SwitchV("lock_max_fps")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.prevent_recovery_of_battery_optimization_white_list,
|
|
||||||
tipsId = R.string.failed_after_restart
|
|
||||||
), SwitchV("prevent_recovery_of_battery_optimization_white_list")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.do_not_clear_app,
|
|
||||||
tipsId = R.string.do_not_clear_app_summary
|
|
||||||
), SwitchV("do_not_clear_app")
|
|
||||||
)
|
|
||||||
val makeMilletMoreAggressiveSwitchBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"make_millet_more_aggressive",
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.make_millet_more_aggressive,
|
|
||||||
tipsId = R.string.make_millet_more_aggressive_summary
|
|
||||||
),
|
|
||||||
SwitchV(
|
|
||||||
"make_millet_more_aggressive",
|
|
||||||
dataBindingSend = makeMilletMoreAggressiveSwitchBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.make_millet_ignore_active,
|
|
||||||
tipsId = R.string.make_millet_ignore_active_summary
|
|
||||||
),
|
|
||||||
SwitchV("make_millet_ignore_active"),
|
|
||||||
dataBindingRecv = makeMilletMoreAggressiveSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.battery_optimization,
|
|
||||||
tipsId = R.string.battery_optimization_summary,
|
|
||||||
onClickListener = {
|
|
||||||
try {
|
|
||||||
val intent = Intent()
|
|
||||||
val comp = ComponentName(
|
|
||||||
"com.android.settings",
|
|
||||||
"com.android.settings.Settings\$HighPowerApplicationsActivity"
|
|
||||||
)
|
|
||||||
intent.component = comp
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Toast.makeText(activity, "启动失败,可能是不支持", Toast.LENGTH_LONG).show()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.scope_securitycenter)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.skip_waiting_time,
|
|
||||||
tipsId = R.string.skip_waiting_time_summary
|
|
||||||
), SwitchV("skip_waiting_time")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_open_app_confirmation_popup,
|
|
||||||
tipsId = R.string.remove_open_app_confirmation_popup_summary
|
|
||||||
), SwitchV("remove_open_app_confirmation_popup")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.lock_one_hundred,
|
|
||||||
tipsId = R.string.lock_one_hundred_summary
|
|
||||||
), SwitchV("lock_one_hundred")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.remove_macro_blacklist),
|
|
||||||
SwitchV("remove_macro_blacklist")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.battery_life_function),
|
|
||||||
SwitchV("battery_life_function")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.scope_mediaeditor)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.unlock_unlimited_cropping,
|
|
||||||
tipsId = R.string.unlock_unlimited_cropping_summary
|
|
||||||
), SwitchV("unlock_unlimited_cropping")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.updater)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_ota_validate,
|
|
||||||
tipsId = R.string.remove_ota_validate_summary
|
|
||||||
), SwitchV("remove_ota_validate")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.settings)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_notification_importance,
|
|
||||||
tipsId = R.string.show_notification_importance_summary
|
|
||||||
), SwitchV("show_notification_importance")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.cast)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.force_support_send_app,
|
|
||||||
), SwitchV("force_support_send_app")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.rear_display)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_weather_main_switch,
|
|
||||||
), SwitchV("rear_show_weather")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.remove_ad)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.remove_thememanager_ads),
|
|
||||||
SwitchV("remove_thememanager_ads")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.pkg_installer)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.pkg_installer_summary),
|
|
||||||
SwitchV("pkg_installer_count_checking")
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,680 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.t
|
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.net.Uri
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.Switch
|
|
||||||
import android.widget.Toast
|
|
||||||
import cn.fkj233.ui.activity.MIUIActivity
|
|
||||||
import cn.fkj233.ui.activity.annotation.BMPage
|
|
||||||
import cn.fkj233.ui.activity.data.BasePage
|
|
||||||
import cn.fkj233.ui.activity.view.SpinnerV
|
|
||||||
import cn.fkj233.ui.activity.view.SwitchV
|
|
||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
|
||||||
import cn.fkj233.ui.activity.view.TextV
|
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
|
||||||
import cn.fkj233.ui.dialog.NewDialog
|
|
||||||
import com.lt2333.simplicitytools.R
|
|
||||||
|
|
||||||
|
|
||||||
@BMPage("scope_systemui", "System UI", hideMenu = false) class SystemUIPageForT : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
TitleText(textId = R.string.statusbar)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.double_tap_to_sleep), SwitchV("status_bar_double_tap_to_sleep")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.status_bar_layout)
|
|
||||||
val statusBarLayoutMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
|
||||||
it[0] = getString(R.string.default1)
|
|
||||||
it[1] = getString(R.string.clock_center)
|
|
||||||
it[2] = getString(R.string.clock_right)
|
|
||||||
it[3] = getString(R.string.clock_center_and_icon_left)
|
|
||||||
}
|
|
||||||
TextWithSpinner(TextV(textId = R.string.status_bar_layout_mode), SpinnerV(
|
|
||||||
statusBarLayoutMode[MIUIActivity.safeSP.getInt(
|
|
||||||
"status_bar_layout_mode", 0
|
|
||||||
)].toString()
|
|
||||||
) {
|
|
||||||
add(statusBarLayoutMode[0].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 0)
|
|
||||||
}
|
|
||||||
add(statusBarLayoutMode[1].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 1)
|
|
||||||
}
|
|
||||||
add(statusBarLayoutMode[2].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 2)
|
|
||||||
}
|
|
||||||
add(statusBarLayoutMode[3].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 3)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
val layoutCompatibilityBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"layout_compatibility_mode", false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.layout_compatibility_mode, tipsId = R.string.layout_compatibility_mode_summary
|
|
||||||
), SwitchV("layout_compatibility_mode", dataBindingSend = layoutCompatibilityBinding.bindingSend)
|
|
||||||
)
|
|
||||||
|
|
||||||
Text(
|
|
||||||
textId = R.string.left_margin, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_left_margin", 0, 300, 0, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.right_margin, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_right_margin", 0, 300, 0, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.status_bar_clock_format)
|
|
||||||
|
|
||||||
|
|
||||||
val customClockPresetBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getInt(
|
|
||||||
"custom_clock_mode", 0
|
|
||||||
) == 1
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val customClockGeekBinding = GetDataBinding({ MIUIActivity.safeSP.getInt("custom_clock_mode", 0) == 2 }
|
|
||||||
|
|
||||||
) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val customClockMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
|
||||||
it[0] = getString(R.string.off)
|
|
||||||
it[1] = getString(R.string.preset)
|
|
||||||
it[2] = getString(R.string.geek)
|
|
||||||
}
|
|
||||||
TextWithSpinner(TextV(textId = R.string.custom_clock_mode), SpinnerV(
|
|
||||||
customClockMode[MIUIActivity.safeSP.getInt(
|
|
||||||
"custom_clock_mode", 0
|
|
||||||
)].toString()
|
|
||||||
) {
|
|
||||||
add(customClockMode[0].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 0)
|
|
||||||
customClockPresetBinding.binding.Send().send(false)
|
|
||||||
customClockGeekBinding.binding.Send().send(false)
|
|
||||||
}
|
|
||||||
add(customClockMode[1].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 1)
|
|
||||||
customClockPresetBinding.binding.Send().send(true)
|
|
||||||
customClockGeekBinding.binding.Send().send(false)
|
|
||||||
}
|
|
||||||
add(customClockMode[2].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 2)
|
|
||||||
customClockPresetBinding.binding.Send().send(false)
|
|
||||||
customClockGeekBinding.binding.Send().send(true)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//预设模式起始
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_year),
|
|
||||||
SwitchV("status_bar_time_year"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_month),
|
|
||||||
SwitchV("status_bar_time_month"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_day),
|
|
||||||
SwitchV("status_bar_time_day"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_week),
|
|
||||||
SwitchV("status_bar_time_week"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_double_hour),
|
|
||||||
SwitchV("status_bar_time_double_hour"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_period),
|
|
||||||
SwitchV("status_bar_time_period", true),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_seconds),
|
|
||||||
SwitchV("status_bar_time_seconds"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_hide_space),
|
|
||||||
SwitchV("status_bar_time_hide_space"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_double_line),
|
|
||||||
SwitchV("status_bar_time_double_line"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
|
||||||
SwitchV("status_bar_time_double_line_center_align"),
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.status_bar_clock_size, dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_clock_size", 0, 18, 0, dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.status_bar_clock_double_line_size,
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_clock_double_line_size", 0, 9, 0, dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
//预设模式结束
|
|
||||||
|
|
||||||
//极客模式起始
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
|
|
||||||
NewDialog(activity) {
|
|
||||||
setTitle(R.string.custom_clock_format_geek)
|
|
||||||
setEditText(
|
|
||||||
MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "", isSingleLine = false
|
|
||||||
)
|
|
||||||
Button(getString(R.string.click_to_view_use_cases)) {
|
|
||||||
val locale = context.resources.configuration.locale
|
|
||||||
val language = locale.language
|
|
||||||
if (language.endsWith("zh")) {
|
|
||||||
val uri = Uri.parse("https://zhuti.designer.xiaomi.com/docs/grammar/#%E6%97%B6%E9%97%B4%E6%97%A5%E6%9C%9F")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
} else {
|
|
||||||
val uri = Uri.parse("https://docs.google.com/spreadsheets/d/1ghkT2iFbxB3bT4TKCiKAfmEdGt6kTVKFU3dm4Nz1or8/edit?usp=sharing")
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Button(getString(R.string.Done)) {
|
|
||||||
if (getEditText().isNotEmpty()) {
|
|
||||||
try {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_format_geek", getEditText())
|
|
||||||
dismiss()
|
|
||||||
return@Button
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
Button(getString(R.string.cancel), cancelStyle = true) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}, dataBindingRecv = customClockGeekBinding.binding.getRecv(2))
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
|
||||||
SwitchV("status_bar_time_center_align_geek"),
|
|
||||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.status_bar_clock_size, dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_clock_size_geek", 0, 18, 0, dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
//极客模式结束
|
|
||||||
|
|
||||||
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.status_bar_icon)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(textId = R.string.hide_icon, onClickListener = { showFragment("hide_icon") })
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.show_wifi_standard), SwitchV("show_wifi_standard")
|
|
||||||
)
|
|
||||||
val customMobileTypeTextBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"custom_mobile_type_text_switch", false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.custom_mobile_type_text_switch), SwitchV(
|
|
||||||
"custom_mobile_type_text_switch", dataBindingSend = customMobileTypeTextBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.custom_mobile_type_text) {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.custom_mobile_type_text)
|
|
||||||
setEditText(MIUIActivity.safeSP.getString("custom_mobile_type_text", "5G"), "")
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText().isNotEmpty()) {
|
|
||||||
try {
|
|
||||||
MIUIActivity.safeSP.putAny("custom_mobile_type_text", getEditText())
|
|
||||||
dismiss()
|
|
||||||
return@setRButton
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}, dataBindingRecv = customMobileTypeTextBinding.binding.getRecv(2))
|
|
||||||
val bigMobileTypeIconBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"big_mobile_type_icon", false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.big_mobile_type_icon), SwitchV(
|
|
||||||
"big_mobile_type_icon", dataBindingSend = bigMobileTypeIconBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
val bigMobileTypeLocation: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
|
||||||
it[0] = getString(R.string.left)
|
|
||||||
it[1] = getString(R.string.right)
|
|
||||||
}
|
|
||||||
TextWithSpinner(
|
|
||||||
TextV(textId = R.string.big_mobile_type_location), SpinnerV(
|
|
||||||
bigMobileTypeLocation[MIUIActivity.safeSP.getInt(
|
|
||||||
"big_mobile_type_location", 1
|
|
||||||
)].toString()
|
|
||||||
) {
|
|
||||||
add(bigMobileTypeLocation[0].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("big_mobile_type_location", 0)
|
|
||||||
}
|
|
||||||
add(bigMobileTypeLocation[1].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("big_mobile_type_location", 1)
|
|
||||||
}
|
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.big_mobile_type_only_show_network_card),
|
|
||||||
SwitchV("big_mobile_type_only_show_network_card", false),
|
|
||||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.big_mobile_type_icon_bold),
|
|
||||||
SwitchV("big_mobile_type_icon_bold", true),
|
|
||||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(textId = R.string.big_mobile_type_icon_size, onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.big_mobile_type_icon_size)
|
|
||||||
setEditText(
|
|
||||||
"", "${activity.getString(R.string.def)}12.5, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getFloat("big_mobile_type_icon_size", 12.5f)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText() != "") {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"big_mobile_type_icon_size", getEditText().toFloat()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_up_and_down_position) {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.big_mobile_type_icon_up_and_down_position)
|
|
||||||
setMessage("${activity.getString(R.string.range)} -15~15")
|
|
||||||
setEditText(
|
|
||||||
"", "${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText().isNotEmpty()) {
|
|
||||||
try {
|
|
||||||
val value = getEditText().toInt()
|
|
||||||
if (value in (-15..15)) {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"big_mobile_type_icon_up_and_down_position", value
|
|
||||||
)
|
|
||||||
dismiss()
|
|
||||||
return@setRButton
|
|
||||||
}
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
|
||||||
TextSummaryWithArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_left_and_right_margins) {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.big_mobile_type_icon_left_and_right_margins)
|
|
||||||
setMessage("${activity.getString(R.string.range)} 0~30")
|
|
||||||
setEditText(
|
|
||||||
"", "${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_left_and_right_margins", 0)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText().isNotEmpty()) {
|
|
||||||
try {
|
|
||||||
val value = getEditText().toInt()
|
|
||||||
if (value in (0..30)) {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"big_mobile_type_icon_left_and_right_margins", value
|
|
||||||
)
|
|
||||||
dismiss()
|
|
||||||
return@setRButton
|
|
||||||
}
|
|
||||||
} catch (_: Throwable) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
|
||||||
Text(textId = R.string.maximum_number_of_notification_icons)
|
|
||||||
SeekBarWithText("maximum_number_of_notification_icons", 1, 30, 3)
|
|
||||||
Text(textId = R.string.maximum_number_of_notification_dots)
|
|
||||||
SeekBarWithText("maximum_number_of_notification_dots", 0, 4, 3)
|
|
||||||
TextSummaryWithArrow(
|
|
||||||
TextSummaryV(textId = R.string.battery_percentage_font_size, onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
|
||||||
setTitle(R.string.battery_percentage_font_size)
|
|
||||||
setMessage(R.string.zero_do_no_change)
|
|
||||||
setEditText(
|
|
||||||
"", "${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getFloat("battery_percentage_font_size", 0f)
|
|
||||||
}"
|
|
||||||
)
|
|
||||||
setLButton(textId = R.string.cancel) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
setRButton(textId = R.string.Done) {
|
|
||||||
if (getEditText() != "") {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"battery_percentage_font_size", getEditText().toFloat()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}.show()
|
|
||||||
})
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.hide_battery_percentage_icon, tipsId = R.string.hide_battery_percentage_icon_summary
|
|
||||||
), SwitchV("hide_battery_percentage_icon")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.status_bar_network_speed)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.status_bar_network_speed_refresh_speed,
|
|
||||||
tipsId = R.string.status_bar_network_speed_refresh_speed_summary
|
|
||||||
), SwitchV("status_bar_network_speed_refresh_speed")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.hide_status_bar_network_speed_second,
|
|
||||||
tipsId = R.string.hide_status_bar_network_speed_second_summary
|
|
||||||
), SwitchV("hide_status_bar_network_speed_second")
|
|
||||||
)
|
|
||||||
TextWithSwitch(
|
|
||||||
TextV(textId = R.string.hide_network_speed_splitter), SwitchV("hide_network_speed_splitter")
|
|
||||||
)
|
|
||||||
val statusBarDualRowNetworkSpeedBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"status_bar_dual_row_network_speed", false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.status_bar_dual_row_network_speed,
|
|
||||||
tipsId = R.string.status_bar_dual_row_network_speed_summary
|
|
||||||
), SwitchV(
|
|
||||||
"status_bar_dual_row_network_speed", dataBindingSend = statusBarDualRowNetworkSpeedBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
val align: HashMap<Int, String> = hashMapOf()
|
|
||||||
align[0] = getString(R.string.left)
|
|
||||||
align[1] = getString(R.string.right)
|
|
||||||
TextWithSpinner(
|
|
||||||
TextV(textId = R.string.status_bar_network_speed_dual_row_gravity), SpinnerV(
|
|
||||||
align[MIUIActivity.safeSP.getInt(
|
|
||||||
"status_bar_network_speed_dual_row_gravity", 0
|
|
||||||
)].toString()
|
|
||||||
) {
|
|
||||||
add(align[0].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 0)
|
|
||||||
}
|
|
||||||
add(align[1].toString()) {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 1)
|
|
||||||
|
|
||||||
}
|
|
||||||
}, dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextWithSpinner(TextV(textId = R.string.status_bar_network_speed_dual_row_icon), SpinnerV(
|
|
||||||
MIUIActivity.safeSP.getString(
|
|
||||||
"status_bar_network_speed_dual_row_icon", getString(R.string.none)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
add(getString(R.string.none)) {
|
|
||||||
MIUIActivity.safeSP.putAny(
|
|
||||||
"status_bar_network_speed_dual_row_icon", getString(R.string.none)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
add("▲▼") {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "▲▼")
|
|
||||||
}
|
|
||||||
add("△▽") {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "△▽")
|
|
||||||
}
|
|
||||||
add("↑↓") {
|
|
||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "↑↓")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
Text(
|
|
||||||
textId = R.string.status_bar_network_speed_dual_row_size,
|
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"status_bar_network_speed_dual_row_size",
|
|
||||||
0,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.notification_center)
|
|
||||||
val showWeatherMainSwitchBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"notification_weather", false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_weather_main_switch, colorId = R.color.blue
|
|
||||||
), SwitchV(
|
|
||||||
"notification_weather", dataBindingSend = showWeatherMainSwitchBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_city,
|
|
||||||
), SwitchV("notification_weather_city"), dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.can_notification_slide,
|
|
||||||
tipsId = R.string.can_notification_slide_summary,
|
|
||||||
),
|
|
||||||
SwitchV("can_notification_slide"),
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.control_center)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.disable_bluetooth_temporarily_off
|
|
||||||
), SwitchV(
|
|
||||||
"disable_bluetooth_temporarily_off"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
val controlCenterWeatherBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"control_center_weather", false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_weather_main_switch,
|
|
||||||
colorId = R.color.blue,
|
|
||||||
tipsId = R.string.control_center_weather_summary
|
|
||||||
), SwitchV(
|
|
||||||
"control_center_weather", dataBindingSend = controlCenterWeatherBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.show_city,
|
|
||||||
), SwitchV("control_center_weather_city"), dataBindingRecv = controlCenterWeatherBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.lock_screen)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.lock_screen_clock_display_seconds,
|
|
||||||
tipsId = R.string.only_official_default_themes_are_supported
|
|
||||||
), SwitchV("lock_screen_clock_display_seconds")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_the_left_side_of_the_lock_screen,
|
|
||||||
tipsId = R.string.only_official_default_themes_are_supported
|
|
||||||
), SwitchV("remove_the_left_side_of_the_lock_screen")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.remove_lock_screen_camera,
|
|
||||||
tipsId = R.string.only_official_default_themes_are_supported
|
|
||||||
), SwitchV("remove_lock_screen_camera")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(textId = R.string.enable_wave_charge_animation), SwitchV("enable_wave_charge_animation")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.lock_screen_charging_current,
|
|
||||||
tipsId = R.string.only_official_default_themes_are_supported
|
|
||||||
), SwitchV("lock_screen_charging_current")
|
|
||||||
)
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.double_tap_to_sleep, tipsId = R.string.home_double_tap_to_sleep_summary
|
|
||||||
), SwitchV("lock_screen_double_tap_to_sleep")
|
|
||||||
)
|
|
||||||
Line()
|
|
||||||
TitleText(textId = R.string.old_quick_settings_panel)
|
|
||||||
val oldQSCustomSwitchBinding = GetDataBinding({
|
|
||||||
MIUIActivity.safeSP.getBoolean(
|
|
||||||
"old_qs_custom_switch", false
|
|
||||||
)
|
|
||||||
}) { view, flags, data ->
|
|
||||||
when (flags) {
|
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.old_qs_custom_switch, colorId = R.color.blue
|
|
||||||
), SwitchV(
|
|
||||||
"old_qs_custom_switch", dataBindingSend = oldQSCustomSwitchBinding.bindingSend
|
|
||||||
)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.qs_custom_rows, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"qs_custom_rows", 1, 6, 3, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.qs_custom_rows_horizontal, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"qs_custom_rows_horizontal", 1, 3, 2, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.qs_custom_columns, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"qs_custom_columns", 1, 7, 4, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
textId = R.string.qs_custom_columns_unexpanded,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
SeekBarWithText(
|
|
||||||
"qs_custom_columns_unexpanded", 1, 7, 5, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.lt2333.simplicitytools.hooks
|
package com.lt2333.simplicitytools.hook
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.BuildConfig
|
import com.lt2333.simplicitytools.BuildConfig
|
||||||
import com.lt2333.simplicitytools.hooks.apps.*
|
import com.lt2333.simplicitytools.hook.app.*
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.corepatch.CorePatchMainHook
|
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatch
|
||||||
import com.lt2333.simplicitytools.utils.xposed.EasyXposedInit
|
import com.lt2333.simplicitytools.util.xposed.EasyXposedInit
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
import de.robv.android.xposed.IXposedHookZygoteInit
|
import de.robv.android.xposed.IXposedHookZygoteInit
|
||||||
import de.robv.android.xposed.XSharedPreferences
|
import de.robv.android.xposed.XSharedPreferences
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
class MainHook : EasyXposedInit() {
|
class XposedEntry : EasyXposedInit() {
|
||||||
private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
||||||
|
|
||||||
override val registeredApp: List<AppRegister> = listOf(
|
override val registeredApp: List<AppRegister> = listOf(
|
||||||
@@ -25,7 +25,6 @@ class MainHook : EasyXposedInit() {
|
|||||||
ScreenShot, // 截屏
|
ScreenShot, // 截屏
|
||||||
Cast, //投屏
|
Cast, //投屏
|
||||||
RearDisplay, //背屏
|
RearDisplay, //背屏
|
||||||
PackageInstaller, // 应用包管理组件
|
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
||||||
@@ -36,7 +35,7 @@ class MainHook : EasyXposedInit() {
|
|||||||
|
|
||||||
override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
|
override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
|
||||||
super.initZygote(startupParam)
|
super.initZygote(startupParam)
|
||||||
CorePatchMainHook().initZygote(startupParam)
|
CorePatch().initZygote(startupParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.android.*
|
||||||
|
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatch
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object Android : AppRegister() {
|
||||||
|
override val packageName: String = "android"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook " + javaClass.simpleName)
|
||||||
|
//核心破解
|
||||||
|
CorePatch().handleLoadPackage(lpparam)
|
||||||
|
|
||||||
|
autoInitHooks(
|
||||||
|
lpparam,
|
||||||
|
DisableFlagSecure, //允许截图
|
||||||
|
DeleteOnPostNotification, //上层显示
|
||||||
|
RemoveSmallWindowRestrictions, //解除小窗限制
|
||||||
|
MaxWallpaperScale, //壁纸缩放比例
|
||||||
|
SystemPropertiesHook, //SystemPropertiesHook
|
||||||
|
AllowUntrustedTouches, //允许不受信任的触摸
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.cast.ForceSupportSendApp
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object Cast: AppRegister() {
|
||||||
|
override val packageName: String = "com.milink.service"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
ForceSupportSendApp, //强制允许所有应用接力
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.mediaeditor.UnlockUnlimitedCropping
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object MediaEditor: AppRegister() {
|
||||||
|
override val packageName: String = "com.miui.mediaeditor"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
UnlockUnlimitedCropping, //解锁裁切最小值
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.miuihome.AlwaysDisplayTime
|
||||||
|
import com.lt2333.simplicitytools.hook.app.miuihome.DoubleTapToSleep
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object MiuiHome: AppRegister() {
|
||||||
|
override val packageName: String = "com.miui.home"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
AlwaysDisplayTime, //时钟显示时钟
|
||||||
|
DoubleTapToSleep, //双击锁屏
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.powerkeeper.LockMaxFps
|
||||||
|
import com.lt2333.simplicitytools.hook.app.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelist
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object PowerKeeper: AppRegister() {
|
||||||
|
override val packageName: String = "com.miui.powerkeeper"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
LockMaxFps, //锁定最高刷新率
|
||||||
|
PreventRecoveryOfBatteryOptimizationWhitelist, //防止恢复电池优化白名单
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.cast.RearDisplayWeather
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object RearDisplay: AppRegister() {
|
||||||
|
override val packageName: String = "com.xiaomi.misubscreenui"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
RearDisplayWeather, //背屏显示天气
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.screenshot.UnlockUnlimitedCropping
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object ScreenShot: AppRegister() {
|
||||||
|
override val packageName: String = "com.miui.screenshot"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook " + javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
UnlockUnlimitedCropping, //锁定最高刷新率
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.securitycenter.*
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object SecurityCenter: AppRegister() {
|
||||||
|
override val packageName: String = "com.miui.securitycenter"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook " + javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
SkipWaitingTime, //跳过 5/10秒等待时间
|
||||||
|
LockOneHundred, //锁定 100分
|
||||||
|
RemoveMacroBlacklist, //去除自动连招黑名单
|
||||||
|
ShowBatteryTemperature, //显示电池温度
|
||||||
|
RemoveOpenAppConfirmationPopup, //去除打开应用弹窗
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.settings.ShowNotificationImportance
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object Settings: AppRegister() {
|
||||||
|
override val packageName: String = "com.android.settings"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
ShowNotificationImportance, //显示通知重要程度
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.systemui.*
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object SystemUI: AppRegister() {
|
||||||
|
override val packageName: String = "com.android.systemui"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
HideStatusBarIcon, //隐藏状态栏图标
|
||||||
|
HideBatteryIcon, //隐藏电池
|
||||||
|
HideHDIcon, //隐藏HD图标
|
||||||
|
HideSimIcon, //隐藏SIM卡图标
|
||||||
|
HideMobileActivityIcon, //隐藏移动箭头图标
|
||||||
|
HideMobileTypeIcon, //隐藏移动类型图标
|
||||||
|
HideStatusBarNetworkSpeedSecond, //隐藏状态栏网速/s
|
||||||
|
HideWifiActivityIcon, //隐藏WIFI活动箭头图标
|
||||||
|
MaximumNumberOfNotificationIcons, //通知图标上限
|
||||||
|
StatusBarNetworkSpeedRefreshSpeed, //状态栏网速秒刷新
|
||||||
|
StatusBarTimeCustomization, //状态栏时钟自定义
|
||||||
|
RemoveTheLeftSideOfTheLockScreen, //移除锁屏负一屏功能
|
||||||
|
RemoveLockScreenCamera, //移除锁屏相机功能
|
||||||
|
NotificationWeather, //通知面板天气
|
||||||
|
OldNotificationWeather,
|
||||||
|
ControlCenterWeather, //控制中心天气
|
||||||
|
//StatusBarCurrent, //TODO:状态栏电流
|
||||||
|
StatusBarLayout, //状态栏布局
|
||||||
|
HideNetworkSpeedSplitter, //隐藏时钟与实时网速之间的分隔符
|
||||||
|
WaveCharge, //Alpha充电动画
|
||||||
|
LockScreenCurrent, //锁屏电流
|
||||||
|
LockScreenDoubleTapToSleep, //锁屏下双击锁屏
|
||||||
|
StatusBarDoubleTapToSleep, //双击状态栏锁屏
|
||||||
|
OldQSCustom, //旧版快速设置自定义
|
||||||
|
DoubleLineNetworkSpeed, //双排网速
|
||||||
|
StatusBarBigMobileTypeIcon, //大移动类型
|
||||||
|
BatteryPercentage, //电量百分比
|
||||||
|
CustomMobileTypeText, //自定义移动类型文本
|
||||||
|
CanNotificationSlide, //允许下滑通知打开小窗
|
||||||
|
LockScreenClockDisplaySeconds, // 锁屏时钟显示秒
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.hook.app.thememanager.RemoveAds
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
object ThemeManager: AppRegister() {
|
||||||
|
override val packageName: String = "com.android.thememanager"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName)
|
||||||
|
autoInitHooks(lpparam,
|
||||||
|
RemoveAds, //移除主题壁纸的广告
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,33 +1,27 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
||||||
import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull
|
import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||||
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object Updater : AppRegister() {
|
object Updater : AppRegister() {
|
||||||
override val packageName: String = "com.android.updater"
|
override val packageName: String = "com.android.updater"
|
||||||
|
override val processName: List<String> = emptyList()
|
||||||
|
override val logTag: String = "WooBox"
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
XposedBridge.log("WooBox: 成功 Hook " + javaClass.simpleName)
|
||||||
|
|
||||||
hasEnable("remove_ota_validate") {
|
hasEnable("remove_ota_validate") {
|
||||||
Array(26) { "com.android.updater.common.utils.${'a' + it}" }
|
Array(26) { "com.android.updater.common.utils.${'a' + it}" }
|
||||||
.mapNotNull { loadClassOrNull(it) }
|
.mapNotNull { loadClassOrNull(it) }
|
||||||
.firstOrNull { it.declaredFields.size >= 9 && it.declaredMethods.size > 60 }
|
.firstOrNull() { it.declaredFields.size >= 9 && it.declaredMethods.size > 60 }
|
||||||
?.findMethod { name == "T" && returnType == Boolean::class.java }
|
?.findMethod { name == "T" && returnType == Boolean::class.java }
|
||||||
?.hookReturnConstant(false)
|
?.hookReturnConstant(false)
|
||||||
|
|
||||||
findMethod("miui.util.FeatureParser") {
|
|
||||||
name == "hasFeature" && parameterCount == 2
|
|
||||||
}.hookBefore {
|
|
||||||
if (it.args[0] == "support_ota_validate") {
|
|
||||||
it.result = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.android
|
package com.lt2333.simplicitytools.hook.app.android
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object AllowUntrustedTouchesForAll : HookRegister() {
|
object AllowUntrustedTouches : HookRegister() {
|
||||||
override fun init() = hasEnable("allow_untrusted_touches") {
|
override fun init() = hasEnable("allow_untrusted_touches") {
|
||||||
findMethod("android.hardware.input.InputManager") {
|
findMethod("android.hardware.input.InputManager") {
|
||||||
name == "getBlockUntrustedTouchesMode" && parameterTypes[0] == Context::class.java
|
name == "getBlockUntrustedTouchesMode" && parameterTypes[0] == Context::class.java
|
||||||
}.hookReturnConstant(0)
|
}.hookReturnConstant(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.android
|
package com.lt2333.simplicitytools.hook.app.android
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object DeleteOnPostNotificationForAll : HookRegister() {
|
object DeleteOnPostNotification : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.server.wm.AlertWindowNotification") {
|
findMethod("com.android.server.wm.AlertWindowNotification") {
|
||||||
name == "onPostNotification"
|
name == "onPostNotification"
|
||||||
@@ -15,5 +15,4 @@ object DeleteOnPostNotificationForAll : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.android
|
||||||
|
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
|
object DisableFlagSecure : HookRegister() {
|
||||||
|
override fun init() {
|
||||||
|
findMethod("com.android.server.wm.WindowState") {
|
||||||
|
name == "isSecureLocked"
|
||||||
|
}.hookBefore {
|
||||||
|
hasEnable("disable_flag_secure") {
|
||||||
|
it.result = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
package com.lt2333.simplicitytools.hook.app.android
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
import com.github.kyuubiran.ezxhelper.utils.putObject
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object MaxWallpaperScaleForS : HookRegister() {
|
object MaxWallpaperScale : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.server.wm.WallpaperController") {
|
findMethod("com.android.server.wm.WallpaperController") {
|
||||||
name == "zoomOutToScale" && parameterTypes[0] == Float::class.java
|
name == "zoomOutToScale" && parameterTypes[0] == Float::class.java
|
||||||
@@ -15,5 +15,4 @@ object MaxWallpaperScaleForS : HookRegister() {
|
|||||||
it.thisObject.putObject("mMaxWallpaperScale", value)
|
it.thisObject.putObject("mMaxWallpaperScale", value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
package com.lt2333.simplicitytools.hook.app.android
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object RemoveSmallWindowRestrictionsForS : HookRegister() {
|
object RemoveSmallWindowRestrictions : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
// 强制所有活动设为可以调整大小
|
// 强制所有活动设为可以调整大小
|
||||||
findMethod("com.android.server.wm.Task") {
|
findMethod("com.android.server.wm.Task") {
|
||||||
@@ -42,5 +42,4 @@ object RemoveSmallWindowRestrictionsForS : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
package com.lt2333.simplicitytools.hook.app.android
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object SystemPropertiesHookForS : HookRegister() {
|
object SystemPropertiesHook : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false)
|
val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false)
|
||||||
val mediaSteps = XSPUtils.getInt("media_volume_steps", 15)
|
val mediaSteps = XSPUtils.getInt("media_volume_steps", 15)
|
||||||
@@ -18,5 +18,4 @@ object SystemPropertiesHookForS : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,21 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.corepatch;
|
/**
|
||||||
|
* 代码来自 https://github.com/LSPosed/CorePatch
|
||||||
|
* GPL-2.0 License
|
||||||
|
**/
|
||||||
|
|
||||||
|
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||||
|
|
||||||
import android.app.AndroidAppHelper;
|
import android.app.AndroidAppHelper;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.Signature;
|
import android.content.pm.Signature;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.BuildConfig;
|
import com.lt2333.simplicitytools.BuildConfig;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Member;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.security.cert.Certificate;
|
import java.security.cert.Certificate;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -30,17 +31,12 @@ import de.robv.android.xposed.XposedBridge;
|
|||||||
import de.robv.android.xposed.XposedHelpers;
|
import de.robv.android.xposed.XposedHelpers;
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||||
|
|
||||||
public class CorePatchForR extends XposedHelper implements IXposedHookLoadPackage, IXposedHookZygoteInit {
|
public class CorePatch extends XposedHelper implements IXposedHookLoadPackage, IXposedHookZygoteInit {
|
||||||
XSharedPreferences prefs = new XSharedPreferences(BuildConfig.APPLICATION_ID, "config");
|
XSharedPreferences prefs = new XSharedPreferences(BuildConfig.APPLICATION_ID, "config");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws IllegalAccessException, InvocationTargetException, InstantiationException {
|
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws IllegalAccessException, InvocationTargetException, InstantiationException {
|
||||||
|
|
||||||
Log.d(CorePatchMainHook.TAG, "downgrade" + prefs.getBoolean("downgrade->", true));
|
|
||||||
Log.d(CorePatchMainHook.TAG, "authcreak" + prefs.getBoolean("authcreak->", true));
|
|
||||||
Log.d(CorePatchMainHook.TAG, "digestCreak" + prefs.getBoolean("digestCreak->", true));
|
|
||||||
Log.d(CorePatchMainHook.TAG, "UsePreSig" + prefs.getBoolean("UsePreSig->", false));
|
|
||||||
|
|
||||||
// 允许降级
|
// 允许降级
|
||||||
findAndHookMethod("com.android.server.pm.PackageManagerService", loadPackageParam.classLoader,
|
findAndHookMethod("com.android.server.pm.PackageManagerService", loadPackageParam.classLoader,
|
||||||
"checkDowngrade",
|
"checkDowngrade",
|
||||||
@@ -104,7 +100,7 @@ public class CorePatchForR extends XposedHelper implements IXposedHookLoadPackag
|
|||||||
Class<?> sJarClass = XposedHelpers.findClass("android.util.jar.StrictJarFile", loadPackageParam.classLoader);
|
Class<?> sJarClass = XposedHelpers.findClass("android.util.jar.StrictJarFile", loadPackageParam.classLoader);
|
||||||
Constructor<?> constructorExact = XposedHelpers.findConstructorExact(sJarClass, String.class, boolean.class, boolean.class);
|
Constructor<?> constructorExact = XposedHelpers.findConstructorExact(sJarClass, String.class, boolean.class, boolean.class);
|
||||||
constructorExact.setAccessible(true);
|
constructorExact.setAccessible(true);
|
||||||
Class<?> signingDetails = getSigningDetails(loadPackageParam.classLoader);
|
Class<?> signingDetails = XposedHelpers.findClass("android.content.pm.PackageParser.SigningDetails", loadPackageParam.classLoader);
|
||||||
Constructor<?> findConstructorExact = XposedHelpers.findConstructorExact(signingDetails, Signature[].class, Integer.TYPE);
|
Constructor<?> findConstructorExact = XposedHelpers.findConstructorExact(signingDetails, Signature[].class, Integer.TYPE);
|
||||||
findConstructorExact.setAccessible(true);
|
findConstructorExact.setAccessible(true);
|
||||||
Class<?> packageParserException = XposedHelpers.findClass("android.content.pm.PackageParser.PackageParserException", loadPackageParam.classLoader);
|
Class<?> packageParserException = XposedHelpers.findClass("android.content.pm.PackageParser.PackageParserException", loadPackageParam.classLoader);
|
||||||
@@ -112,12 +108,11 @@ public class CorePatchForR extends XposedHelper implements IXposedHookLoadPackag
|
|||||||
error.setAccessible(true);
|
error.setAccessible(true);
|
||||||
Object[] signingDetailsArgs = new Object[2];
|
Object[] signingDetailsArgs = new Object[2];
|
||||||
signingDetailsArgs[1] = 1;
|
signingDetailsArgs[1] = 1;
|
||||||
Class<?> parseResult = XposedHelpers.findClassIfExists("android.content.pm.parsing.result.ParseResult", loadPackageParam.classLoader);
|
|
||||||
hookAllMethods("android.util.jar.StrictJarVerifier", loadPackageParam.classLoader, "verifyBytes", new XC_MethodHook() {
|
hookAllMethods("android.util.jar.StrictJarVerifier", loadPackageParam.classLoader, "verifyBytes", new XC_MethodHook() {
|
||||||
public void afterHookedMethod(MethodHookParam param) throws Throwable {
|
public void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
super.afterHookedMethod(param);
|
super.afterHookedMethod(param);
|
||||||
if (prefs.getBoolean("digestCreak", true)) {
|
if (prefs.getBoolean("digestCreak", true)) {
|
||||||
if (!prefs.getBoolean("UsePreSig", false)) {
|
if(!prefs.getBoolean("UsePreSig", false)) {
|
||||||
final Object block = constructor.newInstance(param.args[0]);
|
final Object block = constructor.newInstance(param.args[0]);
|
||||||
Object[] infos = (Object[]) XposedHelpers.callMethod(block, "getSignerInfos");
|
Object[] infos = (Object[]) XposedHelpers.callMethod(block, "getSignerInfos");
|
||||||
Object info = infos[0];
|
Object info = infos[0];
|
||||||
@@ -130,49 +125,27 @@ public class CorePatchForR extends XposedHelper implements IXposedHookLoadPackag
|
|||||||
});
|
});
|
||||||
hookAllMethods("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "verifyV1Signature", new XC_MethodHook() {
|
hookAllMethods("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "verifyV1Signature", new XC_MethodHook() {
|
||||||
public void afterHookedMethod(MethodHookParam methodHookParam) throws Throwable {
|
public void afterHookedMethod(MethodHookParam methodHookParam) throws Throwable {
|
||||||
|
super.afterHookedMethod(methodHookParam);
|
||||||
if (prefs.getBoolean("authcreak", true)) {
|
if (prefs.getBoolean("authcreak", true)) {
|
||||||
Throwable throwable = methodHookParam.getThrowable();
|
Throwable throwable = methodHookParam.getThrowable();
|
||||||
Integer parseErr = null;
|
if (throwable != null) {
|
||||||
if (parseResult != null && ((Method) methodHookParam.method).getReturnType() == parseResult) {
|
|
||||||
Object result = methodHookParam.getResult();
|
|
||||||
if ((boolean) XposedHelpers.callMethod(result, "isError")) {
|
|
||||||
parseErr = (int) XposedHelpers.callMethod(result, "getErrorCode");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (throwable != null || parseErr != null) {
|
|
||||||
Signature[] lastSigs = null;
|
Signature[] lastSigs = null;
|
||||||
try {
|
if(prefs.getBoolean("UsePreSig", false)) {
|
||||||
if (prefs.getBoolean("UsePreSig", false)) {
|
PackageManager PM = AndroidAppHelper.currentApplication().getPackageManager();
|
||||||
PackageManager PM = AndroidAppHelper.currentApplication().getPackageManager();
|
if(PM == null){
|
||||||
if (PM == null) {
|
XposedBridge.log("E: " + BuildConfig.APPLICATION_ID + " Cannot get the Package Manager... Are you using MiUI?");
|
||||||
XposedBridge.log("E: " + BuildConfig.APPLICATION_ID + " Cannot get the Package Manager... Are you using MiUI?");
|
}else {
|
||||||
} else {
|
PackageInfo pI = PM.getPackageArchiveInfo((String) methodHookParam.args[0], 0);
|
||||||
PackageInfo pI;
|
PackageInfo InstpI = PM.getPackageInfo(pI.packageName, PackageManager.GET_SIGNATURES);
|
||||||
if (parseErr != null) {
|
lastSigs = InstpI.signatures;
|
||||||
pI = PM.getPackageArchiveInfo((String) methodHookParam.args[1], 0);
|
|
||||||
} else {
|
|
||||||
pI = PM.getPackageArchiveInfo((String) methodHookParam.args[0], 0);
|
|
||||||
}
|
|
||||||
PackageInfo InstpI = PM.getPackageInfo(pI.packageName, PackageManager.GET_SIGNATURES);
|
|
||||||
lastSigs = InstpI.signatures;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (Throwable ignored) {
|
}else {
|
||||||
|
if(prefs.getBoolean("digestCreak", true)) {
|
||||||
}
|
final Object origJarFile = constructorExact.newInstance(methodHookParam.args[0], true, false);
|
||||||
try {
|
|
||||||
if (lastSigs == null && prefs.getBoolean("digestCreak", true)) {
|
|
||||||
final Object origJarFile = constructorExact.newInstance(methodHookParam.args[parseErr == null ? 0 : 1], true, false);
|
|
||||||
final ZipEntry manifestEntry = (ZipEntry) XposedHelpers.callMethod(origJarFile, "findEntry", "AndroidManifest.xml");
|
final ZipEntry manifestEntry = (ZipEntry) XposedHelpers.callMethod(origJarFile, "findEntry", "AndroidManifest.xml");
|
||||||
final Certificate[][] lastCerts;
|
final Certificate[][] lastCerts = (Certificate[][]) XposedHelpers.callStaticMethod(ASV, "loadCertificates", origJarFile, manifestEntry);
|
||||||
if (parseErr != null) {
|
|
||||||
lastCerts = (Certificate[][]) XposedHelpers.callMethod(XposedHelpers.callStaticMethod(ASV, "loadCertificates", methodHookParam.args[0], origJarFile, manifestEntry), "getResult");
|
|
||||||
} else {
|
|
||||||
lastCerts = (Certificate[][]) XposedHelpers.callStaticMethod(ASV, "loadCertificates", origJarFile, manifestEntry);
|
|
||||||
}
|
|
||||||
lastSigs = (Signature[]) XposedHelpers.callStaticMethod(ASV, "convertToSignatures", (Object) lastCerts);
|
lastSigs = (Signature[]) XposedHelpers.callStaticMethod(ASV, "convertToSignatures", (Object) lastCerts);
|
||||||
}
|
}
|
||||||
} catch (Throwable ignored) {
|
|
||||||
}
|
}
|
||||||
if (lastSigs != null) {
|
if (lastSigs != null) {
|
||||||
signingDetailsArgs[0] = lastSigs;
|
signingDetailsArgs[0] = lastSigs;
|
||||||
@@ -188,23 +161,17 @@ public class CorePatchForR extends XposedHelper implements IXposedHookLoadPackag
|
|||||||
signingDetailsWithDigestsConstructorExact.setAccessible(true);
|
signingDetailsWithDigestsConstructorExact.setAccessible(true);
|
||||||
newInstance = signingDetailsWithDigestsConstructorExact.newInstance(new Object[]{newInstance, null});
|
newInstance = signingDetailsWithDigestsConstructorExact.newInstance(new Object[]{newInstance, null});
|
||||||
}
|
}
|
||||||
if (throwable != null) {
|
|
||||||
Throwable cause = throwable.getCause();
|
Throwable cause = throwable.getCause();
|
||||||
if (throwable.getClass() == packageParserException) {
|
if (throwable.getClass() == packageParserException) {
|
||||||
if (error.getInt(throwable) == -103) {
|
if (error.getInt(throwable) == -103) {
|
||||||
methodHookParam.setResult(newInstance);
|
methodHookParam.setResult(newInstance);
|
||||||
}
|
|
||||||
}
|
|
||||||
if (cause != null && cause.getClass() == packageParserException) {
|
|
||||||
if (error.getInt(cause) == -103) {
|
|
||||||
methodHookParam.setResult(newInstance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parseErr != null && parseErr == -103) {
|
if (cause != null && cause.getClass() == packageParserException) {
|
||||||
Object input = methodHookParam.args[0];
|
if (error.getInt(cause) == -103) {
|
||||||
XposedHelpers.callMethod(input, "reset");
|
methodHookParam.setResult(newInstance);
|
||||||
methodHookParam.setResult(XposedHelpers.callMethod(input, "success", newInstance));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,25 +206,24 @@ public class CorePatchForR extends XposedHelper implements IXposedHookLoadPackag
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (prefs.getBoolean("digestCreak", true) && prefs.getBoolean("UsePreSig", false)) {
|
||||||
var utilClass = findClass("com.android.server.pm.PackageManagerServiceUtils", loadPackageParam.classLoader);
|
Class<?> pmClass = findClass("com.android.server.pm.PackageManagerService", loadPackageParam.classLoader);
|
||||||
if (utilClass != null) {
|
Class<?> pPClass = findClass("com.android.server.pm.parsing.pkg.ParsedPackage", loadPackageParam.classLoader);
|
||||||
for (var m : utilClass.getDeclaredMethods()) {
|
XposedHelpers.findAndHookMethod(pmClass, "doesSignatureMatchForPermissions", String.class, pPClass, int.class, new XC_MethodHook() {
|
||||||
if ("verifySignatures".equals(m.getName())) {
|
@Override
|
||||||
try {
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
XposedBridge.class.getDeclaredMethod("deoptimizeMethod", Member.class).invoke(null, m);
|
//If we decide to crack this then at least make sure they are same apks, avoid another one that tries to impersonate.
|
||||||
} catch (Throwable e) {
|
if (param.getResult().equals(false)) {
|
||||||
Log.e("CorePatch", "deoptimizing failed", e);
|
String pPname = (String) XposedHelpers.callMethod(param.args[1], "getPackageName");
|
||||||
|
if (pPname.contentEquals((String) param.args[0])) {
|
||||||
|
param.setResult(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Class<?> getSigningDetails(ClassLoader classLoader) {
|
|
||||||
return XposedHelpers.findClass("android.content.pm.PackageParser.SigningDetails", classLoader);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initZygote(StartupParam startupParam) {
|
public void initZygote(StartupParam startupParam) {
|
||||||
|
|
||||||
@@ -272,4 +238,4 @@ public class CorePatchForR extends XposedHelper implements IXposedHookLoadPackag
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.corepatch;
|
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||||
|
|
||||||
import de.robv.android.xposed.XC_MethodHook;
|
import de.robv.android.xposed.XC_MethodHook;
|
||||||
import de.robv.android.xposed.XSharedPreferences;
|
import de.robv.android.xposed.XSharedPreferences;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.corepatch;
|
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.BuildConfig;
|
import com.lt2333.simplicitytools.BuildConfig;
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.cast
|
||||||
|
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookMethod
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
|
object ForceSupportSendApp : HookRegister() {
|
||||||
|
override fun init() {
|
||||||
|
hasEnable("force_support_send_app") {
|
||||||
|
findMethod("com.xiaomi.mirror.synergy.MiuiSynergySdk") {
|
||||||
|
name == "isSupportSendApp"
|
||||||
|
}.hookMethod {
|
||||||
|
after { param ->
|
||||||
|
param.result = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.mediaeditor
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
object UnlockUnlimitedCropping : HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
//解锁图库裁切最小值
|
||||||
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
|
"com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector",
|
||||||
|
getDefaultClassLoader()
|
||||||
|
)
|
||||||
|
XposedHelpers.findAndHookMethod(
|
||||||
|
classIfExists,
|
||||||
|
"calculateMinSize",
|
||||||
|
object : XC_MethodHook() {
|
||||||
|
override fun beforeHookedMethod(param: MethodHookParam) {
|
||||||
|
if (XSPUtils.getBoolean("unlock_unlimited_cropping",false)) {
|
||||||
|
param.result = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//截图无限裁切
|
||||||
|
val classIfExists2 = XposedHelpers.findClassIfExists(
|
||||||
|
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector",
|
||||||
|
getDefaultClassLoader()
|
||||||
|
)
|
||||||
|
|
||||||
|
XposedHelpers.findAndHookMethod(
|
||||||
|
classIfExists2,
|
||||||
|
"calculateMinSize",
|
||||||
|
object : XC_MethodHook() {
|
||||||
|
override fun beforeHookedMethod(param: MethodHookParam) {
|
||||||
|
if (XSPUtils.getBoolean("unlock_unlimited_cropping",false)) {
|
||||||
|
param.result = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.miuihome
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
object AlwaysDisplayTime : HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
|
"com.miui.home.launcher.Workspace",
|
||||||
|
getDefaultClassLoader()
|
||||||
|
)
|
||||||
|
XposedHelpers.findAndHookMethod(
|
||||||
|
classIfExists,
|
||||||
|
"isScreenHasClockGadget", Long::class.javaPrimitiveType,
|
||||||
|
object : XC_MethodHook() {
|
||||||
|
override fun beforeHookedMethod(param: MethodHookParam) {
|
||||||
|
if (XSPUtils.getBoolean("home_time", false)) {
|
||||||
|
param.result = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.miuihome
|
package com.yuk.miuihome.module
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
@@ -6,7 +6,7 @@ import android.view.MotionEvent
|
|||||||
import android.view.ViewConfiguration
|
import android.view.ViewConfiguration
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
|
|
||||||
class DoubleTapControllerForAll internal constructor(mContext: Context) {
|
class DoubleTapController internal constructor(mContext: Context) {
|
||||||
|
|
||||||
private val maxDuration: Long = 500
|
private val maxDuration: Long = 500
|
||||||
private var mActionDownRawX: Float = 0f
|
private var mActionDownRawX: Float = 0f
|
||||||
@@ -48,5 +48,4 @@ class DoubleTapControllerForAll internal constructor(mContext: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,34 +1,38 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.miuihome
|
package com.lt2333.simplicitytools.hook.app.miuihome
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import com.github.kyuubiran.ezxhelper.utils.*
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import com.yuk.miuihome.module.DoubleTapController
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
object DoubleTapToSleepForAll : HookRegister() {
|
object DoubleTapToSleep : HookRegister() {
|
||||||
|
|
||||||
override fun init() = hasEnable("double_tap_to_sleep") {
|
override fun init() = hasEnable("double_tap_to_sleep") {
|
||||||
hookAllConstructorAfter("com.miui.home.launcher.Workspace") {
|
hookAllConstructorAfter("com.miui.home.launcher.Workspace") {
|
||||||
var mDoubleTapControllerEx =
|
var mDoubleTapControllerEx =
|
||||||
XposedHelpers.getAdditionalInstanceField(it.thisObject, "mDoubleTapControllerEx")
|
XposedHelpers.getAdditionalInstanceField(
|
||||||
|
it.thisObject,
|
||||||
|
"mDoubleTapControllerEx"
|
||||||
|
)
|
||||||
if (mDoubleTapControllerEx != null) return@hookAllConstructorAfter
|
if (mDoubleTapControllerEx != null) return@hookAllConstructorAfter
|
||||||
mDoubleTapControllerEx = DoubleTapControllerForAll((it.args[0] as Context))
|
mDoubleTapControllerEx = DoubleTapController((it.args[0] as Context))
|
||||||
XposedHelpers.setAdditionalInstanceField(
|
XposedHelpers.setAdditionalInstanceField(
|
||||||
it.thisObject,
|
it.thisObject,
|
||||||
"mDoubleTapControllerEx",
|
"mDoubleTapControllerEx",
|
||||||
mDoubleTapControllerEx
|
mDoubleTapControllerEx
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
findMethod("com.miui.home.launcher.Workspace") {
|
findMethod("com.miui.home.launcher.Workspace") {
|
||||||
name == "dispatchTouchEvent" && parameterTypes[0] == MotionEvent::class.java
|
name == "dispatchTouchEvent" && parameterTypes[0] == MotionEvent::class.java
|
||||||
}.hookBefore {
|
}.hookBefore {
|
||||||
val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField(
|
val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField(
|
||||||
it.thisObject,
|
it.thisObject,
|
||||||
"mDoubleTapControllerEx"
|
"mDoubleTapControllerEx"
|
||||||
) as DoubleTapControllerForAll
|
) as DoubleTapController
|
||||||
if (!mDoubleTapControllerEx.isDoubleTapEvent(it.args[0] as MotionEvent)) return@hookBefore
|
if (!mDoubleTapControllerEx.isDoubleTapEvent(it.args[0] as MotionEvent)) return@hookBefore
|
||||||
val mCurrentScreenIndex = it.thisObject.getObject("mCurrentScreenIndex") as Int
|
val mCurrentScreenIndex = it.thisObject.getObject("mCurrentScreenIndex") as Int
|
||||||
val cellLayout = it.thisObject.invokeMethodAuto("getCellLayout", mCurrentScreenIndex)
|
val cellLayout = it.thisObject.invokeMethodAuto("getCellLayout", mCurrentScreenIndex)
|
||||||
@@ -43,5 +47,4 @@ object DoubleTapToSleepForAll : HookRegister() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
object LockMaxFps : HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
|
"com.miui.powerkeeper.statemachine.DisplayFrameSetting",
|
||||||
|
getDefaultClassLoader()
|
||||||
|
)
|
||||||
|
XposedHelpers.findAndHookMethod(
|
||||||
|
classIfExists,
|
||||||
|
"setScreenEffect",
|
||||||
|
String::class.java, Int::class.javaPrimitiveType, Int::class.javaPrimitiveType,
|
||||||
|
object : XC_MethodHook() {
|
||||||
|
override fun beforeHookedMethod(param: MethodHookParam) {
|
||||||
|
super.beforeHookedMethod(param)
|
||||||
|
if (XSPUtils.getBoolean("lock_max_fps", false)) {
|
||||||
|
param.result = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
object PreventRecoveryOfBatteryOptimizationWhitelist : HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
|
"com.miui.powerkeeper.statemachine.ForceDozeController",
|
||||||
|
getDefaultClassLoader()
|
||||||
|
)
|
||||||
|
XposedHelpers.findAndHookMethod(
|
||||||
|
classIfExists,
|
||||||
|
"restoreWhiteListAppsIfQuitForceIdle",
|
||||||
|
object : XC_MethodHook() {
|
||||||
|
override fun beforeHookedMethod(param: MethodHookParam) {
|
||||||
|
super.beforeHookedMethod(param)
|
||||||
|
if (XSPUtils.getBoolean(
|
||||||
|
"prevent_recovery_of_battery_optimization_white_list",
|
||||||
|
false
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
param.result = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.cast
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.graphics.Typeface
|
||||||
|
import android.util.TypedValue
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.RelativeLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import cn.fkj233.ui.activity.dp2px
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookMethod
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import com.lt2333.simplicitytools.view.WeatherView
|
||||||
|
|
||||||
|
object RearDisplayWeather : HookRegister() {
|
||||||
|
@SuppressLint("ResourceType")
|
||||||
|
override fun init() {
|
||||||
|
hasEnable("rear_show_weather") {
|
||||||
|
findMethod("com.xiaomi.misubscreenui.light.aod.view.VerticalClockView") {
|
||||||
|
name == "onFinishInflate"
|
||||||
|
}.hookMethod {
|
||||||
|
after {
|
||||||
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
|
val context = viewGroup.context
|
||||||
|
|
||||||
|
//获取原组件
|
||||||
|
val gradientLayoutID =
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"gradient_layout",
|
||||||
|
"id",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
val gradientLayout: ViewGroup = viewGroup.findViewById(gradientLayoutID)
|
||||||
|
|
||||||
|
val dateID =
|
||||||
|
context.resources.getIdentifier("date", "id", context.packageName)
|
||||||
|
val date: TextView = viewGroup.findViewById(dateID)
|
||||||
|
|
||||||
|
|
||||||
|
//创建天气组件
|
||||||
|
val mWeatherView = WeatherView(context, false).apply {
|
||||||
|
gravity = Gravity.END
|
||||||
|
setTextAppearance(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"Sub_Screen_Aod_date_s",
|
||||||
|
"style",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
|
typeface = Typeface.create("mipro-medium", Typeface.NORMAL)
|
||||||
|
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12f)
|
||||||
|
|
||||||
|
}
|
||||||
|
gradientLayout.addView(mWeatherView, (gradientLayout.indexOfChild(date) + 1))
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
findMethod("com.xiaomi.misubscreenui.light.aod.view.HorizontalClockView") {
|
||||||
|
name == "onFinishInflate"
|
||||||
|
}.hookMethod {
|
||||||
|
before {
|
||||||
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
|
val context = viewGroup.context
|
||||||
|
|
||||||
|
//获取原组件
|
||||||
|
val gradientLayoutID =
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"gradient_layout",
|
||||||
|
"id",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
val gradientLayout: RelativeLayout = viewGroup.findViewById(gradientLayoutID)
|
||||||
|
|
||||||
|
val dateID =
|
||||||
|
context.resources.getIdentifier("date", "id", context.packageName)
|
||||||
|
val date: TextView = viewGroup.findViewById(dateID)
|
||||||
|
|
||||||
|
val dateParentLayout: ViewGroup = date.parent as ViewGroup
|
||||||
|
|
||||||
|
|
||||||
|
//创建天气组件
|
||||||
|
val mWeatherView = WeatherView(context, false).apply {
|
||||||
|
id = View.generateViewId()
|
||||||
|
gravity = Gravity.CENTER
|
||||||
|
maxLines = 1
|
||||||
|
setTextAppearance(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"Sub_Screen_Aod_date_s_horizontal",
|
||||||
|
"style",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
|
typeface = Typeface.create("mipro-medium", 0)
|
||||||
|
|
||||||
|
layoutParams = RelativeLayout.LayoutParams(
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT, dp2px(context, 30f)
|
||||||
|
).also {
|
||||||
|
it.addRule(RelativeLayout.END_OF, dateID)
|
||||||
|
it.marginStart = dp2px(context, 3f)
|
||||||
|
it.marginEnd = dp2px(context, 3f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dateParentLayout.addView(
|
||||||
|
mWeatherView,
|
||||||
|
(dateParentLayout.indexOfChild(date) + 1)
|
||||||
|
)
|
||||||
|
|
||||||
|
//电池位置
|
||||||
|
val batteryID =
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"battery_container",
|
||||||
|
"id",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
val battery: ViewGroup = viewGroup.findViewById(batteryID)
|
||||||
|
|
||||||
|
battery.layoutParams = RelativeLayout.LayoutParams(
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT, dp2px(context, 30f)
|
||||||
|
).also {
|
||||||
|
it.addRule(RelativeLayout.END_OF, mWeatherView.id)
|
||||||
|
}
|
||||||
|
gradientLayout.setPadding(0, dp2px(context,5f),0,0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.screenshot
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
object UnlockUnlimitedCropping : HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
//截图无限裁切
|
||||||
|
val classIfExists2 = XposedHelpers.findClassIfExists(
|
||||||
|
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$b",
|
||||||
|
getDefaultClassLoader()
|
||||||
|
)
|
||||||
|
|
||||||
|
XposedHelpers.findAndHookMethod(
|
||||||
|
classIfExists2,
|
||||||
|
"a",
|
||||||
|
object : XC_MethodHook() {
|
||||||
|
override fun beforeHookedMethod(param: MethodHookParam) {
|
||||||
|
if (XSPUtils.getBoolean("unlock_unlimited_cropping",false)) {
|
||||||
|
param.result = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.securitycenter
|
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object LockOneHundredForAll : HookRegister() {
|
|
||||||
|
|
||||||
|
object LockOneHundred : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
//防止点击重新检测
|
//防止点击重新检测
|
||||||
findMethod("com.miui.securityscan.ui.main.MainContentFrame") {
|
findMethod("com.miui.securityscan.ui.main.MainContentFrame") {
|
||||||
@@ -27,5 +26,4 @@ object LockOneHundredForAll : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||||
|
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
object RemoveMacroBlacklist : HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
if (XSPUtils.getBoolean("remove_macro_blacklist", false)) {
|
||||||
|
var letter = 'a'
|
||||||
|
for (i in 0..25) {
|
||||||
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
|
"com.miui.gamebooster.v.$letter" + "0", getDefaultClassLoader()
|
||||||
|
) ?: continue
|
||||||
|
if (classIfExists.declaredMethods.size in 6..12 && classIfExists.fields.isEmpty() && classIfExists.declaredFields.size >= 2) {
|
||||||
|
XposedHelpers.findAndHookMethod(classIfExists, "c", String::class.java,
|
||||||
|
object : XC_MethodHook() {
|
||||||
|
override fun beforeHookedMethod(param: MethodHookParam?) {
|
||||||
|
param?.result = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
letter++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.securitycenter
|
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||||
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object RemoveOpenAppConfirmationPopupForAll : HookRegister() {
|
|
||||||
|
|
||||||
|
object RemoveOpenAppConfirmationPopup : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("android.widget.TextView") {
|
findMethod("android.widget.TextView") {
|
||||||
name == "setText" && parameterTypes[0] == CharSequence::class.java
|
name == "setText" && parameterTypes[0] == CharSequence::class.java
|
||||||
@@ -29,5 +28,4 @@ object RemoveOpenAppConfirmationPopupForAll : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||||
|
|
||||||
|
import android.app.AndroidAppHelper
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.content.res.Configuration
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.Typeface
|
||||||
|
import android.util.TypedValue
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import cn.fkj233.ui.activity.dp2px
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||||
|
import com.lt2333.simplicitytools.util.*
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import java.lang.reflect.Field
|
||||||
|
|
||||||
|
object ShowBatteryTemperature : HookRegister() {
|
||||||
|
|
||||||
|
private fun getBatteryTemperature(context: Context): Int {
|
||||||
|
return context.registerReceiver(
|
||||||
|
null as BroadcastReceiver?,
|
||||||
|
IntentFilter("android.intent.action.BATTERY_CHANGED")
|
||||||
|
)!!.getIntExtra("temperature", 0) / 10
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun init() = hasEnable("battery_life_function") {
|
||||||
|
findMethod("com.miui.powercenter.a") {
|
||||||
|
name == "b" && parameterTypes[0] == Context::class.java
|
||||||
|
}.hookBefore {
|
||||||
|
it.result = getBatteryTemperature(it.args[0] as Context).toString()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
findMethod("com.miui.powercenter.a\$a") {
|
||||||
|
name == "run"
|
||||||
|
}.hookAfter {
|
||||||
|
val context = AndroidAppHelper.currentApplication().applicationContext
|
||||||
|
val isDarkMode =
|
||||||
|
context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES
|
||||||
|
val currentTemperatureValue = context.resources.getIdentifier(
|
||||||
|
"current_temperature_value",
|
||||||
|
"id",
|
||||||
|
"com.miui.securitycenter"
|
||||||
|
)
|
||||||
|
val field = loadClass("com.miui.powercenter.a\$a").getDeclaredField("a") as Field
|
||||||
|
field.isAccessible = true
|
||||||
|
val view = field.get(it.thisObject) as View
|
||||||
|
val textView = view.findViewById<TextView>(currentTemperatureValue)
|
||||||
|
(textView.layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 25f)
|
||||||
|
(textView.layoutParams as LinearLayout.LayoutParams).topMargin = 0
|
||||||
|
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 36.399998f)
|
||||||
|
textView.setPadding(0, 0, 0, 0)
|
||||||
|
textView.gravity = Gravity.NO_GRAVITY
|
||||||
|
textView.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
|
||||||
|
textView.height = dp2px(context, 49.099983f)
|
||||||
|
textView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
|
||||||
|
val tempView = TextView(context)
|
||||||
|
tempView.layoutParams = LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
dp2px(context, 49.099983f)
|
||||||
|
)
|
||||||
|
(tempView.layoutParams as LinearLayout.LayoutParams).marginStart =
|
||||||
|
dp2px(context, 3.599976f)
|
||||||
|
tempView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f)
|
||||||
|
tempView.setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333"))
|
||||||
|
tempView.setPadding(0, dp2px(context, 25f), 0, 0)
|
||||||
|
tempView.text = "℃"
|
||||||
|
tempView.typeface = Typeface.create(null, 500, false)
|
||||||
|
tempView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
|
||||||
|
val tempeValueContainer = context.resources.getIdentifier(
|
||||||
|
"tempe_value_container",
|
||||||
|
"id",
|
||||||
|
"com.miui.securitycenter"
|
||||||
|
)
|
||||||
|
val linearLayout = view.findViewById<LinearLayout>(tempeValueContainer)
|
||||||
|
linearLayout.addView(tempView)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.securitycenter
|
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object SkipWaitingTimeForAll : HookRegister() {
|
|
||||||
|
|
||||||
|
object SkipWaitingTime : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("android.widget.TextView") {
|
findMethod("android.widget.TextView") {
|
||||||
name == "setText" && parameterCount == 4
|
name == "setText" && parameterCount == 4
|
||||||
@@ -27,5 +26,4 @@ object SkipWaitingTimeForAll : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,36 +1,36 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.settings
|
package com.lt2333.simplicitytools.hook.app.settings
|
||||||
|
|
||||||
import android.app.NotificationChannel
|
import android.app.NotificationChannel
|
||||||
import com.github.kyuubiran.ezxhelper.utils.*
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
object ShowNotificationImportanceForAll : HookRegister() {
|
object ShowNotificationImportance : HookRegister() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.settings.notification.ChannelNotificationSettings") {
|
findMethod("com.android.settings.notification.ChannelNotificationSettings"){
|
||||||
name == "removeDefaultPrefs"
|
name == "removeDefaultPrefs"
|
||||||
}.hookBefore {
|
}.hookBefore {
|
||||||
if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBefore
|
if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBefore
|
||||||
val importance = it.thisObject.invokeMethodAuto("findPreference", "importance") ?: return@hookBefore
|
val importance = it.thisObject.invokeMethodAuto("findPreference", "importance") ?: return@hookBefore
|
||||||
val mChannel = it.thisObject.getObject("mChannel") as NotificationChannel
|
val mChannel = it.thisObject.getObject("mChannel") as NotificationChannel
|
||||||
val index = importance.invokeMethodAutoAs<Int>("findSpinnerIndexOfValue", mChannel.importance.toString())!!
|
val index = importance.invokeMethodAuto("findSpinnerIndexOfValue", mChannel.importance.toString()) as Int
|
||||||
if (index < 0) return@hookBefore
|
if (index < 0) return@hookBefore
|
||||||
importance.invokeMethodAuto("setValueIndex", index)
|
importance.invokeMethodAuto("setValueIndex", index)
|
||||||
XposedHelpers.setAdditionalInstanceField(importance, "channelNotificationSettings", it.thisObject)
|
XposedHelpers.setAdditionalInstanceField(importance, "channelNotificationSettings", it.thisObject)
|
||||||
it.result = null
|
it.result = null
|
||||||
}
|
}
|
||||||
|
|
||||||
findMethod("androidx.preference.Preference") {
|
findMethod("androidx.preference.Preference"){
|
||||||
name == "callChangeListener" && parameterTypes[0] == Any::class.java
|
name == "callChangeListener" && parameterTypes[0]==Any::class.java
|
||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfter
|
val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfter
|
||||||
val mChannel = channelNotificationSettings.getObject("mChannel") as NotificationChannel
|
val mChannel = channelNotificationSettings.getObject("mChannel") as NotificationChannel
|
||||||
mChannel.invokeMethodAuto("setImportance", (it.args[0] as String).toInt())
|
mChannel.invokeMethodAuto("setImportance", (it.args[0] as String).toInt())
|
||||||
val mBackend = channelNotificationSettings.getObjectOrNull("mBackend") ?: return@hookAfter
|
val mBackend = channelNotificationSettings.getObjectOrNull("mBackend") ?: return@hookAfter
|
||||||
val mPkg = channelNotificationSettings.getObjectAs<String>("mPkg")
|
val mPkg = channelNotificationSettings.getObject("mPkg") as String
|
||||||
val mUid = channelNotificationSettings.getObjectAs<Int>("mUid")
|
val mUid = channelNotificationSettings.getObject("mUid") as Int
|
||||||
mBackend.invokeMethodAuto("updateChannel", mPkg, mUid, mChannel)
|
mBackend.invokeMethodAuto("updateChannel", mPkg, mUid, mChannel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,23 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object BatteryPercentageForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object BatteryPercentage : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
val size = XSPUtils.getFloat("battery_percentage_font_size", 0f)
|
val size = XSPUtils.getFloat("battery_percentage_font_size", 0f)
|
||||||
if (size == 0f) return
|
if (size == 0f) return
|
||||||
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") {
|
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") {
|
||||||
name == "updateResources"
|
name == "updateResources"
|
||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
(it.thisObject.getObjectAs<TextView>("mBatteryPercentView")).setTextSize(
|
(it.thisObject.getObject("mBatteryPercentView") as TextView).setTextSize(
|
||||||
TypedValue.COMPLEX_UNIT_DIP, size
|
TypedValue.COMPLEX_UNIT_DIP, size
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookMethod
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
|
object CanNotificationSlide: HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
findMethod("com.android.systemui.statusbar.notification.NotificationSettingsManager") {
|
||||||
|
name == "canSlide"
|
||||||
|
}.hookMethod {
|
||||||
|
after { param ->
|
||||||
|
hasEnable("can_notification_slide") {
|
||||||
|
param.result = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.content.ComponentName
|
import android.content.ComponentName
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -10,36 +10,45 @@ import android.widget.Toast
|
|||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import cn.fkj233.ui.activity.dp2px
|
import cn.fkj233.ui.activity.dp2px
|
||||||
import com.github.kyuubiran.ezxhelper.utils.*
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
import com.lt2333.simplicitytools.utils.SystemProperties
|
import com.lt2333.simplicitytools.util.SystemProperties
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import com.lt2333.simplicitytools.views.WeatherView
|
import com.lt2333.simplicitytools.view.WeatherView
|
||||||
|
|
||||||
object ControlCenterWeatherForT : HookRegister() {
|
|
||||||
|
|
||||||
|
object ControlCenterWeather : HookRegister() {
|
||||||
override fun init() = hasEnable("control_center_weather") {
|
override fun init() = hasEnable("control_center_weather") {
|
||||||
var mWeatherView: TextView? = null
|
var mWeatherView: TextView? = null
|
||||||
var mConstraintLayout: ConstraintLayout? = null
|
var mConstraintLayout: ConstraintLayout? = null
|
||||||
val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false)
|
val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false)
|
||||||
findMethod("com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView") {
|
findMethod("com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView") {
|
||||||
name == "onFinishInflate"
|
name == "onFinishInflate"
|
||||||
}.hookAfter { param ->
|
}.hookAfter {
|
||||||
val viewGroup = param.thisObject as ViewGroup
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
val context = viewGroup.context
|
val context = viewGroup.context
|
||||||
|
|
||||||
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
|
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
|
||||||
if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 &&
|
if (SystemProperties.get(context, "ro.build.date.utc")!!
|
||||||
!SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM")
|
.toInt() >= 1647014400 &&
|
||||||
|
|
||||||
|
!SystemProperties.get(
|
||||||
|
context,
|
||||||
|
"ro.build.version.incremental"
|
||||||
|
)!!.endsWith("DEV") &&
|
||||||
|
|
||||||
|
!SystemProperties.get(
|
||||||
|
context,
|
||||||
|
"ro.build.version.incremental"
|
||||||
|
)!!.endsWith("XM")
|
||||||
) {
|
) {
|
||||||
//获取原组件
|
//获取原组件
|
||||||
val bigTimeId =
|
val big_time_ID =
|
||||||
context.resources.getIdentifier("big_time", "id", context.packageName)
|
context.resources.getIdentifier("big_time", "id", context.packageName)
|
||||||
val big_time: TextView = viewGroup.findViewById(bigTimeId)
|
val big_time: TextView = viewGroup.findViewById(big_time_ID)
|
||||||
|
|
||||||
val dateTimeId =
|
val date_time_ID =
|
||||||
context.resources.getIdentifier("date_time", "id", context.packageName)
|
context.resources.getIdentifier("date_time", "id", context.packageName)
|
||||||
val dateTime: TextView = viewGroup.findViewById(dateTimeId)
|
val date_time: TextView = viewGroup.findViewById(date_time_ID)
|
||||||
|
|
||||||
//创建新布局
|
//创建新布局
|
||||||
val mConstraintLayoutLp = LinearLayout.LayoutParams(
|
val mConstraintLayoutLp = LinearLayout.LayoutParams(
|
||||||
@@ -60,20 +69,23 @@ object ControlCenterWeatherForT : HookRegister() {
|
|||||||
|
|
||||||
(big_time.parent as ViewGroup).addView(mConstraintLayout, 0)
|
(big_time.parent as ViewGroup).addView(mConstraintLayout, 0)
|
||||||
|
|
||||||
|
|
||||||
//从原布局中删除组件
|
//从原布局中删除组件
|
||||||
(big_time.parent as ViewGroup).removeView(big_time)
|
(big_time.parent as ViewGroup).removeView(big_time)
|
||||||
(dateTime.parent as ViewGroup).removeView(dateTime)
|
(date_time.parent as ViewGroup).removeView(date_time)
|
||||||
|
|
||||||
|
|
||||||
//添加组件至新布局
|
//添加组件至新布局
|
||||||
mConstraintLayout!!.addView(big_time)
|
mConstraintLayout!!.addView(big_time)
|
||||||
mConstraintLayout!!.addView(dateTime)
|
mConstraintLayout!!.addView(date_time)
|
||||||
|
|
||||||
//组件属性
|
//组件属性
|
||||||
val dateTimeLp = ConstraintLayout.LayoutParams(
|
|
||||||
|
val date_time_LP = ConstraintLayout.LayoutParams(
|
||||||
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
||||||
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
||||||
).also {
|
).also {
|
||||||
it.startToEnd = bigTimeId
|
it.startToEnd = big_time_ID
|
||||||
it.bottomToBottom = 0
|
it.bottomToBottom = 0
|
||||||
it.marginStart = context.resources.getDimensionPixelSize(
|
it.marginStart = context.resources.getDimensionPixelSize(
|
||||||
context.resources.getIdentifier(
|
context.resources.getIdentifier(
|
||||||
@@ -84,7 +96,7 @@ object ControlCenterWeatherForT : HookRegister() {
|
|||||||
)
|
)
|
||||||
it.bottomMargin = dp2px(context, 5f)
|
it.bottomMargin = dp2px(context, 5f)
|
||||||
}
|
}
|
||||||
dateTime.layoutParams = dateTimeLp
|
date_time.layoutParams = date_time_LP
|
||||||
|
|
||||||
|
|
||||||
//创建天气组件
|
//创建天气组件
|
||||||
@@ -100,12 +112,12 @@ object ControlCenterWeatherForT : HookRegister() {
|
|||||||
}
|
}
|
||||||
mConstraintLayout!!.addView(mWeatherView)
|
mConstraintLayout!!.addView(mWeatherView)
|
||||||
|
|
||||||
val mweatherviewLp = ConstraintLayout.LayoutParams(
|
val mWeatherView_LP = ConstraintLayout.LayoutParams(
|
||||||
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
||||||
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
||||||
).also {
|
).also {
|
||||||
it.startToEnd = bigTimeId
|
it.startToEnd = big_time_ID
|
||||||
it.bottomToTop = dateTimeId
|
it.bottomToTop = date_time_ID
|
||||||
it.marginStart = context.resources.getDimensionPixelSize(
|
it.marginStart = context.resources.getDimensionPixelSize(
|
||||||
context.resources.getIdentifier(
|
context.resources.getIdentifier(
|
||||||
"notification_panel_time_date_space",
|
"notification_panel_time_date_space",
|
||||||
@@ -115,7 +127,7 @@ object ControlCenterWeatherForT : HookRegister() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
(mWeatherView as WeatherView).layoutParams = mweatherviewLp
|
(mWeatherView as WeatherView).layoutParams = mWeatherView_LP
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
val layoutParam =
|
val layoutParam =
|
||||||
@@ -178,9 +190,18 @@ object ControlCenterWeatherForT : HookRegister() {
|
|||||||
val context = viewGroup.context
|
val context = viewGroup.context
|
||||||
val mOrientation = viewGroup.getObject("mOrientation") as Int
|
val mOrientation = viewGroup.getObject("mOrientation") as Int
|
||||||
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
|
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
|
||||||
if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith(
|
if (SystemProperties.get(context, "ro.build.date.utc")!!
|
||||||
"DEV"
|
.toInt() >= 1647014400 &&
|
||||||
) && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM")
|
|
||||||
|
!SystemProperties.get(
|
||||||
|
context,
|
||||||
|
"ro.build.version.incremental"
|
||||||
|
)!!.endsWith("DEV") &&
|
||||||
|
|
||||||
|
!SystemProperties.get(
|
||||||
|
context,
|
||||||
|
"ro.build.version.incremental"
|
||||||
|
)!!.endsWith("XM")
|
||||||
) {
|
) {
|
||||||
if (mOrientation == 1) {
|
if (mOrientation == 1) {
|
||||||
mConstraintLayout!!.visibility = View.VISIBLE
|
mConstraintLayout!!.visibility = View.VISIBLE
|
||||||
@@ -196,5 +217,4 @@ object ControlCenterWeatherForT : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object CustomMobileTypeTextForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object CustomMobileTypeText : HookRegister() {
|
||||||
override fun init() = hasEnable("custom_mobile_type_text_switch") {
|
override fun init() = hasEnable("custom_mobile_type_text_switch") {
|
||||||
findMethod("com.android.systemui.statusbar.policy.MobileSignalController") {
|
findMethod("com.android.systemui.statusbar.policy.MobileSignalController") {
|
||||||
name == "getMobileTypeName" && parameterTypes[0] == Int::class.java
|
name == "getMobileTypeName" && parameterTypes[0] == Int::class.java
|
||||||
@@ -15,5 +14,4 @@ object CustomMobileTypeTextForS : HookRegister() {
|
|||||||
it.result = XSPUtils.getString("custom_mobile_type_text", "5G")
|
it.result = XSPUtils.getString("custom_mobile_type_text", "5G")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.TrafficStats
|
import android.net.TrafficStats
|
||||||
@@ -11,12 +11,12 @@ import com.github.kyuubiran.ezxhelper.utils.findMethod
|
|||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.R
|
import com.lt2333.simplicitytools.R
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
|
|
||||||
object DoubleLineNetworkSpeedForT : HookRegister() {
|
object DoubleLineNetworkSpeed : HookRegister() {
|
||||||
|
|
||||||
private var mLastTotalUp: Long = 0
|
private var mLastTotalUp: Long = 0
|
||||||
private var mLastTotalDown: Long = 0
|
private var mLastTotalDown: Long = 0
|
||||||
@@ -35,8 +35,10 @@ object DoubleLineNetworkSpeedForT : HookRegister() {
|
|||||||
val none = InitFields.moduleRes.getString(R.string.none)
|
val none = InitFields.moduleRes.getString(R.string.none)
|
||||||
|
|
||||||
if (XSPUtils.getString("status_bar_network_speed_dual_row_icon", none) != none) {
|
if (XSPUtils.getString("status_bar_network_speed_dual_row_icon", none) != none) {
|
||||||
upIcon = XSPUtils.getString("status_bar_network_speed_dual_row_icon", none)?.firstOrNull().toString()
|
upIcon = XSPUtils.getString("status_bar_network_speed_dual_row_icon", none)
|
||||||
downIcon = XSPUtils.getString("status_bar_network_speed_dual_row_icon", none)?.lastOrNull().toString()
|
?.firstOrNull().toString()
|
||||||
|
downIcon = XSPUtils.getString("status_bar_network_speed_dual_row_icon", none)
|
||||||
|
?.lastOrNull().toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
findConstructor("com.android.systemui.statusbar.views.NetworkSpeedView") {
|
findConstructor("com.android.systemui.statusbar.views.NetworkSpeedView") {
|
||||||
@@ -50,9 +52,9 @@ object DoubleLineNetworkSpeedForT : HookRegister() {
|
|||||||
mView.isSingleLine = false
|
mView.isSingleLine = false
|
||||||
mView.setLineSpacing(0F, 0.8F)
|
mView.setLineSpacing(0F, 0.8F)
|
||||||
if (getDualAlign == 0) {
|
if (getDualAlign == 0) {
|
||||||
mView.gravity = Gravity.START or Gravity.CENTER_VERTICAL
|
mView.gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
|
||||||
} else {
|
} else {
|
||||||
mView.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
mView.gravity = Gravity.RIGHT or Gravity.CENTER_VERTICAL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,34 +62,55 @@ object DoubleLineNetworkSpeedForT : HookRegister() {
|
|||||||
name == "formatSpeed" && parameterCount == 2
|
name == "formatSpeed" && parameterCount == 2
|
||||||
}.hookBefore {
|
}.hookBefore {
|
||||||
if (getDualAlign == 0) {
|
if (getDualAlign == 0) {
|
||||||
it.result = "$upIcon ${getTotalUpSpeed(it.args[0] as Context)}\n$downIcon ${
|
it.result =
|
||||||
getTotalDownloadSpeed(it.args[0] as Context)
|
"$upIcon ${getTotalUpSpeed(it.args[0] as Context)}\n${downIcon} ${
|
||||||
}"
|
getTotalDownloadSpeed(
|
||||||
|
it.args[0] as Context
|
||||||
|
)
|
||||||
|
}"
|
||||||
} else {
|
} else {
|
||||||
it.result = "${getTotalUpSpeed(it.args[0] as Context)} $upIcon\n${
|
it.result =
|
||||||
getTotalDownloadSpeed(it.args[0] as Context)
|
"${getTotalUpSpeed(it.args[0] as Context)} ${upIcon}\n${
|
||||||
} $downIcon"
|
getTotalDownloadSpeed(
|
||||||
|
it.args[0] as Context
|
||||||
|
)
|
||||||
|
} $downIcon"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取总的上行速度
|
//获取总的上行速度
|
||||||
private fun getTotalUpSpeed(context: Context): String {
|
private fun getTotalUpSpeed(context: Context): String {
|
||||||
val totalUpSpeed: Float
|
var totalUpSpeed: Float
|
||||||
|
|
||||||
val currentTotalTxBytes = TrafficStats.getTotalTxBytes()
|
val currentTotalTxBytes = TrafficStats.getTotalTxBytes()
|
||||||
val nowTimeStampTotalUp = System.currentTimeMillis()
|
val nowTimeStampTotalUp = System.currentTimeMillis()
|
||||||
|
|
||||||
//计算上传速度
|
//计算上传速度
|
||||||
val bytes = (currentTotalTxBytes - mLastTotalUp) * 1000 / (nowTimeStampTotalUp - lastTimeStampTotalUp).toFloat()
|
val bytes =
|
||||||
val unit: String
|
(currentTotalTxBytes - mLastTotalUp) * 1000 / (nowTimeStampTotalUp - lastTimeStampTotalUp).toFloat()
|
||||||
|
var unit: String
|
||||||
|
|
||||||
if (bytes >= 1048576) {
|
if (bytes >= 1048576) {
|
||||||
totalUpSpeed = DecimalFormat("0.0").format(bytes / 1048576).toFloat()
|
totalUpSpeed =
|
||||||
unit = context.resources.getString(context.resources.getIdentifier("megabyte_per_second", "string", context.packageName))
|
DecimalFormat("0.0").format(bytes / 1048576).toFloat()
|
||||||
|
unit = context.resources.getString(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"megabyte_per_second",
|
||||||
|
"string",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
totalUpSpeed = DecimalFormat("0.0").format(bytes / 1024).toFloat()
|
totalUpSpeed =
|
||||||
unit = context.resources.getString(context.resources.getIdentifier("kilobyte_per_second", "string", context.packageName))
|
DecimalFormat("0.0").format(bytes / 1024).toFloat()
|
||||||
|
unit = context.resources.getString(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"kilobyte_per_second",
|
||||||
|
"string",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//保存当前的流量总和和上次的时间戳
|
//保存当前的流量总和和上次的时间戳
|
||||||
@@ -95,38 +118,53 @@ object DoubleLineNetworkSpeedForT : HookRegister() {
|
|||||||
lastTimeStampTotalUp = nowTimeStampTotalUp
|
lastTimeStampTotalUp = nowTimeStampTotalUp
|
||||||
|
|
||||||
return if (totalUpSpeed >= 100) {
|
return if (totalUpSpeed >= 100) {
|
||||||
"${totalUpSpeed.toInt()}$unit"
|
"" + totalUpSpeed.toInt() + unit
|
||||||
} else {
|
} else {
|
||||||
"${totalUpSpeed}$unit"
|
"" + totalUpSpeed + unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取总的下行速度
|
//获取总的下行速度
|
||||||
private fun getTotalDownloadSpeed(context: Context): String {
|
private fun getTotalDownloadSpeed(context: Context): String {
|
||||||
val totalDownSpeed: Float
|
var totalDownSpeed: Float
|
||||||
val currentTotalRxBytes = TrafficStats.getTotalRxBytes()
|
val currentTotalRxBytes = TrafficStats.getTotalRxBytes()
|
||||||
val nowTimeStampTotalDown = System.currentTimeMillis()
|
val nowTimeStampTotalDown = System.currentTimeMillis()
|
||||||
|
|
||||||
//计算下行速度
|
//计算下行速度
|
||||||
val bytes = (currentTotalRxBytes - mLastTotalDown) * 1000 / (nowTimeStampTotalDown - lastTimeStampTotalDown).toFloat()
|
val bytes =
|
||||||
|
(currentTotalRxBytes - mLastTotalDown) * 1000 / (nowTimeStampTotalDown - lastTimeStampTotalDown).toFloat()
|
||||||
|
|
||||||
val unit: String
|
var unit: String
|
||||||
|
|
||||||
if (bytes >= 1048576) {
|
if (bytes >= 1048576) {
|
||||||
totalDownSpeed = DecimalFormat("0.0").format(bytes / 1048576).toFloat()
|
totalDownSpeed =
|
||||||
unit = context.resources.getString(context.resources.getIdentifier("megabyte_per_second", "string", context.packageName))
|
DecimalFormat("0.0").format(bytes / 1048576).toFloat()
|
||||||
|
unit = context.resources.getString(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"megabyte_per_second",
|
||||||
|
"string",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
totalDownSpeed = DecimalFormat("0.0").format(bytes / 1024).toFloat()
|
totalDownSpeed =
|
||||||
unit = context.resources.getString(context.resources.getIdentifier("kilobyte_per_second", "string", context.packageName))
|
DecimalFormat("0.0").format(bytes / 1024).toFloat()
|
||||||
|
unit = context.resources.getString(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"kilobyte_per_second",
|
||||||
|
"string",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
//保存当前的流量总和和上次的时间戳
|
//保存当前的流量总和和上次的时间戳
|
||||||
mLastTotalDown = currentTotalRxBytes
|
mLastTotalDown = currentTotalRxBytes
|
||||||
lastTimeStampTotalDown = nowTimeStampTotalDown
|
lastTimeStampTotalDown = nowTimeStampTotalDown
|
||||||
|
|
||||||
return if (totalDownSpeed >= 100) {
|
return if (totalDownSpeed >= 100) {
|
||||||
"${totalDownSpeed.toInt()}$unit"
|
"" + totalDownSpeed.toInt() + unit
|
||||||
} else {
|
} else {
|
||||||
"${totalDownSpeed}$unit"
|
"" + totalDownSpeed + unit
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
@@ -6,12 +6,11 @@ import android.widget.ImageView
|
|||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.getObject
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object HideBatteryIconForT : HookRegister() {
|
object HideBatteryIcon : HookRegister() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") {
|
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") {
|
||||||
@@ -19,19 +18,19 @@ object HideBatteryIconForT : HookRegister() {
|
|||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
//隐藏电池图标
|
//隐藏电池图标
|
||||||
hasEnable("hide_battery_icon") {
|
hasEnable("hide_battery_icon") {
|
||||||
(it.thisObject.getObjectAs<ImageView>("mBatteryIconView")).visibility = View.GONE
|
(it.thisObject.getObject("mBatteryIconView") as ImageView).visibility = View.GONE
|
||||||
if (it.thisObject.getObject("mBatteryStyle") == 1) {
|
if (it.thisObject.getObject("mBatteryStyle") == 1) {
|
||||||
(it.thisObject.getObjectAs<FrameLayout>("mBatteryDigitalView")).visibility =
|
(it.thisObject.getObject("mBatteryDigitalView") as FrameLayout).visibility =
|
||||||
View.GONE
|
View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//隐藏电池内的百分比
|
//隐藏电池内的百分比
|
||||||
hasEnable("hide_battery_percentage_icon") {
|
hasEnable("hide_battery_percentage_icon") {
|
||||||
(it.thisObject.getObjectAs<TextView>("mBatteryPercentMarkView")).textSize = 0F
|
(it.thisObject.getObject("mBatteryPercentMarkView") as TextView).textSize = 0F
|
||||||
}
|
}
|
||||||
//隐藏电池百分号
|
//隐藏电池百分号
|
||||||
hasEnable("hide_battery_percentage_icon") {
|
hasEnable("hide_battery_percentage_icon") {
|
||||||
(it.thisObject.getObjectAs<TextView>("mBatteryPercentMarkView")).textSize = 0F
|
(it.thisObject.getObject("mBatteryPercentMarkView") as TextView).textSize = 0F
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,12 +39,11 @@ object HideBatteryIconForT : HookRegister() {
|
|||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
//隐藏电池充电图标
|
//隐藏电池充电图标
|
||||||
hasEnable("hide_battery_charging_icon") {
|
hasEnable("hide_battery_charging_icon") {
|
||||||
(it.thisObject.getObjectAs<ImageView>("mBatteryChargingInView")).visibility =
|
(it.thisObject.getObject("mBatteryChargingInView") as ImageView).visibility =
|
||||||
View.GONE
|
View.GONE
|
||||||
(it.thisObject.getObjectAs<ImageView>("mBatteryChargingView")).visibility =
|
(it.thisObject.getObject("mBatteryChargingView") as ImageView).visibility =
|
||||||
View.GONE
|
View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.*
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
|
||||||
object HideHDIconForS : HookRegister() {
|
object HideHDIcon : HookRegister() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
|
|
||||||
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
|
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
|
||||||
name == "initViewState" && parameterCount == 1
|
name == "initViewState" && parameterCount == 1
|
||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
@@ -23,23 +22,18 @@ object HideHDIconForS : HookRegister() {
|
|||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
hide(it)
|
hide(it)
|
||||||
}
|
}
|
||||||
hasEnable("hide_new_hd_icon") {
|
|
||||||
findMethod("com.android.systemui.statusbar.policy.HDController") { name == "update" }.hookBefore {
|
|
||||||
it.result = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hide(it: XC_MethodHook.MethodHookParam) {
|
private fun hide(it: XC_MethodHook.MethodHookParam) {
|
||||||
hasEnable("hide_big_hd_icon") {
|
hasEnable("hide_big_hd_icon") {
|
||||||
(it.thisObject.getObjectAs<ImageView>("mVolte")).visibility = View.GONE
|
(it.thisObject.getObject("mVolte") as ImageView).visibility = View.GONE
|
||||||
}
|
}
|
||||||
hasEnable("hide_small_hd_icon") {
|
hasEnable("hide_small_hd_icon") {
|
||||||
(it.thisObject.getObjectAs<ImageView>("mSmallHd")).visibility = View.GONE
|
(it.thisObject.getObject("mSmallHd") as ImageView).visibility = View.GONE
|
||||||
}
|
}
|
||||||
hasEnable("hide_hd_no_service_icon") {
|
hasEnable("hide_hd_no_service_icon") {
|
||||||
(it.thisObject.getObjectAs<ImageView>("mVolteNoService")).visibility = View.GONE
|
(it.thisObject.getObject("mVolteNoService") as ImageView).visibility =
|
||||||
|
View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
|
||||||
object HideMobileActivityIconForS : HookRegister() {
|
object HideMobileActivityIcon : HookRegister() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
|
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
|
||||||
name == "initViewState" && parameterCount == 1
|
name == "initViewState" && parameterCount == 1
|
||||||
@@ -27,9 +26,8 @@ object HideMobileActivityIconForS : HookRegister() {
|
|||||||
|
|
||||||
private fun hide(it: XC_MethodHook.MethodHookParam) {
|
private fun hide(it: XC_MethodHook.MethodHookParam) {
|
||||||
hasEnable("hide_mobile_activity_icon") {
|
hasEnable("hide_mobile_activity_icon") {
|
||||||
(it.thisObject.getObjectAs<ImageView>("mLeftInOut")).visibility = View.GONE
|
(it.thisObject.getObject("mLeftInOut") as ImageView).visibility = View.GONE
|
||||||
(it.thisObject.getObjectAs<ImageView>("mRightInOut")).visibility = View.GONE
|
(it.thisObject.getObject("mRightInOut") as ImageView).visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
|
||||||
object HideMobileTypeIconForS : HookRegister() {
|
object HideMobileTypeIcon : HookRegister() {
|
||||||
|
|
||||||
private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false)
|
private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false)
|
||||||
|
|
||||||
@@ -32,21 +32,20 @@ object HideMobileTypeIconForS : HookRegister() {
|
|||||||
private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
|
private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
|
||||||
hasEnable("hide_mobile_type_icon") {
|
hasEnable("hide_mobile_type_icon") {
|
||||||
if (isBigType) {
|
if (isBigType) {
|
||||||
(it.thisObject.getObjectAs<TextView>("mMobileType")).visibility =
|
(it.thisObject.getObject("mMobileType") as TextView).visibility =
|
||||||
View.GONE
|
View.GONE
|
||||||
(it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility =
|
(it.thisObject.getObject("mMobileTypeImage") as ImageView).visibility =
|
||||||
View.GONE
|
View.GONE
|
||||||
(it.thisObject.getObjectAs<TextView>("mMobileTypeSingle")).visibility =
|
(it.thisObject.getObject("mMobileTypeSingle") as TextView).visibility =
|
||||||
View.GONE
|
View.GONE
|
||||||
} else {
|
} else {
|
||||||
(it.thisObject.getObjectAs<TextView>("mMobileType")).visibility =
|
(it.thisObject.getObject("mMobileType") as TextView).visibility =
|
||||||
View.INVISIBLE
|
View.INVISIBLE
|
||||||
(it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility =
|
(it.thisObject.getObject("mMobileTypeImage") as ImageView).visibility =
|
||||||
View.INVISIBLE
|
View.INVISIBLE
|
||||||
(it.thisObject.getObjectAs<TextView>("mMobileTypeSingle")).visibility =
|
(it.thisObject.getObject("mMobileTypeSingle") as TextView).visibility =
|
||||||
View.INVISIBLE
|
View.INVISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object HideNetworkSpeedSplitterForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object HideNetworkSpeedSplitter : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.systemui.statusbar.views.NetworkSpeedSplitter") {
|
findMethod("com.android.systemui.statusbar.views.NetworkSpeedSplitter") {
|
||||||
name == "init"
|
name == "init"
|
||||||
@@ -18,5 +17,4 @@ object HideNetworkSpeedSplitterForS : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object HideSimIconForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object HideSimIcon : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy") {
|
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy") {
|
||||||
name == "hasCorrectSubs" && parameterTypes[0] == MutableList::class.java
|
name == "hasCorrectSubs" && parameterTypes[0] == MutableList::class.java
|
||||||
@@ -21,5 +20,4 @@ object HideSimIconForS : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
|
||||||
object HideStatusBarIconForS : HookRegister() {
|
object HideStatusBarIcon : HookRegister() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl") {
|
findMethod("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl") {
|
||||||
name == "setIconVisibility" && parameterCount == 2
|
name == "setIconVisibility" && parameterCount == 2
|
||||||
@@ -77,11 +76,6 @@ object HideStatusBarIconForS : HookRegister() {
|
|||||||
"no_sim" -> hasEnable("hide_no_sim_icon") {
|
"no_sim" -> hasEnable("hide_no_sim_icon") {
|
||||||
it.args[1] = false
|
it.args[1] = false
|
||||||
}
|
}
|
||||||
//隐藏NFC图标
|
|
||||||
"nfc" -> hasEnable("hide_nfc_icon") {
|
|
||||||
it.args[1] = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,22 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object HideStatusBarNetworkSpeedSecondForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object HideStatusBarNetworkSpeedSecond : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.systemui.statusbar.views.NetworkSpeedView") {
|
findMethod("com.android.systemui.statusbar.views.NetworkSpeedView") {
|
||||||
name == "setNetworkSpeed" && parameterCount == 1
|
name == "setNetworkSpeed" && parameterTypes[0] == String::class.java
|
||||||
}.hookBefore {
|
}.hookBefore {
|
||||||
hasEnable("hide_status_bar_network_speed_second") {
|
hasEnable("hide_status_bar_network_speed_second") {
|
||||||
if (it.args[0] != null) {
|
if (it.args[0] != null) {
|
||||||
val mText = (it.args[0] as String)
|
(it.args[0] as String)
|
||||||
.replace("/", "")
|
.replace("/", "")
|
||||||
.replace("s", "")
|
.replace("s", "")
|
||||||
.replace("\'", "")
|
.replace("'", "")
|
||||||
.replace("วิ", "")
|
.replace("วิ", "")
|
||||||
it.args[0] = mText
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
|
||||||
object HideWifiActivityIconForS : HookRegister() {
|
object HideWifiActivityIcon : HookRegister() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
|
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
|
||||||
@@ -29,12 +29,12 @@ object HideWifiActivityIconForS : HookRegister() {
|
|||||||
private fun hide(it: XC_MethodHook.MethodHookParam) {
|
private fun hide(it: XC_MethodHook.MethodHookParam) {
|
||||||
//隐藏WIFI箭头
|
//隐藏WIFI箭头
|
||||||
hasEnable("hide_wifi_activity_icon") {
|
hasEnable("hide_wifi_activity_icon") {
|
||||||
(it.thisObject.getObjectAs<ImageView>("mWifiActivityView")).visibility =
|
(it.thisObject.getObject("mWifiActivityView") as ImageView).visibility =
|
||||||
View.INVISIBLE
|
View.INVISIBLE
|
||||||
}
|
}
|
||||||
//隐藏WIFI标准图标
|
//隐藏WIFI标准图标
|
||||||
hasEnable("hide_wifi_standard_icon") {
|
hasEnable("hide_wifi_standard_icon") {
|
||||||
(it.thisObject.getObjectAs<TextView>("mWifiStandardView")).visibility =
|
(it.thisObject.getObject("mWifiStandardView") as TextView).visibility =
|
||||||
View.INVISIBLE
|
View.INVISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@@ -8,14 +8,14 @@ import android.util.Log
|
|||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.*
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
object LockScreenClockDisplaySecondsForT : HookRegister() {
|
object LockScreenClockDisplaySeconds : HookRegister() {
|
||||||
|
|
||||||
private var nowTime: Date = Calendar.getInstance().time
|
private var nowTime: Date = Calendar.getInstance().time
|
||||||
|
|
||||||
@@ -37,7 +37,8 @@ object LockScreenClockDisplaySecondsForT : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000)
|
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000)
|
||||||
} catch (_: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,11 +60,17 @@ object LockScreenClockDisplaySecondsForT : HookRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateTime(it: XC_MethodHook.MethodHookParam, isVertical: Boolean) {
|
private fun updateTime(it: XC_MethodHook.MethodHookParam, isVertical: Boolean) {
|
||||||
val textV = it.thisObject.getObjectAs<TextView>("mTimeText")
|
val textV = it.thisObject.getObject("mTimeText") as TextView
|
||||||
val c: Context = textV.context
|
val c: Context = textV.context
|
||||||
|
|
||||||
Log.d("lock_screen_clock_display_seconds", "updateTime: ${it.thisObject.javaClass.simpleName}")
|
Log.d(
|
||||||
val is24 = Settings.System.getString(c.contentResolver, Settings.System.TIME_12_24) == "24"
|
"lock_screen_clock_display_seconds",
|
||||||
|
"updateTime: " + it.thisObject.javaClass.simpleName
|
||||||
|
)
|
||||||
|
val is24 = Settings.System.getString(
|
||||||
|
c.contentResolver,
|
||||||
|
Settings.System.TIME_12_24
|
||||||
|
) == "24"
|
||||||
|
|
||||||
nowTime = Calendar.getInstance().time
|
nowTime = Calendar.getInstance().time
|
||||||
|
|
||||||
@@ -75,13 +82,12 @@ object LockScreenClockDisplaySecondsForT : HookRegister() {
|
|||||||
@SuppressLint("SimpleDateFormat")
|
@SuppressLint("SimpleDateFormat")
|
||||||
private fun getTime(is24: Boolean, isVertical: Boolean): String {
|
private fun getTime(is24: Boolean, isVertical: Boolean): String {
|
||||||
var timePattern = ""
|
var timePattern = ""
|
||||||
timePattern += if (isVertical) { //垂直
|
if (isVertical) { //垂直
|
||||||
if (is24) "HH\nmm\nss" else "hh\nmm\nss"
|
timePattern += if (is24) "HH\nmm\nss" else "hh\nmm\nss"
|
||||||
} else { //水平
|
} else { //水平
|
||||||
if (is24) "HH:mm:ss" else "h:mm:ss"
|
timePattern += if (is24) "HH:mm:ss" else "h:mm:ss"
|
||||||
}
|
}
|
||||||
timePattern = SimpleDateFormat(timePattern).format(nowTime)
|
timePattern = SimpleDateFormat(timePattern).format(nowTime)
|
||||||
return timePattern
|
return timePattern
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,43 +1,62 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.app.AndroidAppHelper
|
|
||||||
import android.content.Context
|
|
||||||
import android.os.BatteryManager
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.init.InitFields
|
import com.github.kyuubiran.ezxhelper.init.InitFields
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.getObject
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.lt2333.simplicitytools.R
|
import com.lt2333.simplicitytools.R
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
import java.io.FileReader
|
import java.io.FileReader
|
||||||
import kotlin.math.abs
|
import java.lang.reflect.Method
|
||||||
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
object LockScreenCurrentForS : HookRegister() {
|
object LockScreenCurrent : HookRegister() {
|
||||||
|
|
||||||
override fun init() = hasEnable("lock_screen_charging_current") {
|
override fun init() = hasEnable("lock_screen_charging_current") {
|
||||||
findMethod("com.android.keyguard.charge.ChargeUtils") {
|
findMethod("com.android.keyguard.charge.ChargeUtils") {
|
||||||
name == "getChargingHintText" && parameterCount == 3
|
name == "getChargingHintText" && parameterCount == 3
|
||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
it.result = "${getCurrent()}\n${it.result}"
|
it.result = getCurrent() + "\n" + it.result
|
||||||
}
|
}
|
||||||
|
|
||||||
findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") {
|
findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") {
|
||||||
name == "onFinishInflate"
|
name == "onFinishInflate"
|
||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
(it.thisObject.getObject("mIndicationText") as TextView).isSingleLine = false
|
(it.thisObject.getObject(
|
||||||
|
"mIndicationText"
|
||||||
|
) as TextView).isSingleLine = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原始代码来自 CSDN
|
||||||
|
* https://blog.csdn.net/zhangyongfeiyong/article/details/53641809
|
||||||
|
*/
|
||||||
|
@SuppressLint("PrivateApi")
|
||||||
private fun getCurrent(): String {
|
private fun getCurrent(): String {
|
||||||
val batteryManager = AndroidAppHelper.currentApplication().getSystemService(Context.BATTERY_SERVICE) as BatteryManager
|
var result = ""
|
||||||
val current = abs(batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW) / 1000)
|
try {
|
||||||
return "${InitFields.moduleRes.getString(R.string.current_current)} ${current}mA"
|
val systemProperties = Class.forName("android.os.SystemProperties")
|
||||||
|
val get = systemProperties.getDeclaredMethod("get", String::class.java) as Method
|
||||||
|
val platName = get.invoke(null, "ro.hardware") as String
|
||||||
|
if (platName.startsWith("mt") || platName.startsWith("MT")) {
|
||||||
|
val filePath =
|
||||||
|
"/sys/class/power_supply/battery/device/FG_Battery_CurrentConsumption"
|
||||||
|
val current = (-getMeanCurrentVal(filePath, 5, 0) / 1000.0f).roundToInt()
|
||||||
|
result = "${InitFields.moduleRes.getString(R.string.current_current)} ${current}mA"
|
||||||
|
} else if (platName.startsWith("qcom")) {
|
||||||
|
val filePath = "/sys/class/power_supply/battery/current_now"
|
||||||
|
val current = (-getMeanCurrentVal(filePath, 5, 0) / 1000.0f).roundToInt()
|
||||||
|
result = "${InitFields.moduleRes.getString(R.string.current_current)} ${current}mA"
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,7 +93,7 @@ object LockScreenCurrentForS : HookRegister() {
|
|||||||
val i: Int = bufferedReader.readLine().toInt(10)
|
val i: Int = bufferedReader.readLine().toInt(10)
|
||||||
bufferedReader.close()
|
bufferedReader.close()
|
||||||
return i
|
return i
|
||||||
} catch (_: java.lang.Exception) {
|
} catch (localException: java.lang.Exception) {
|
||||||
}
|
}
|
||||||
return defaultValue
|
return defaultValue
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.app.KeyguardManager
|
import android.app.KeyguardManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@@ -8,13 +8,11 @@ import android.view.View
|
|||||||
import android.view.View.OnTouchListener
|
import android.view.View.OnTouchListener
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
import kotlin.math.abs
|
|
||||||
|
|
||||||
object LockScreenDoubleTapToSleepForT : HookRegister() {
|
|
||||||
|
|
||||||
|
object LockScreenDoubleTapToSleep : HookRegister() {
|
||||||
override fun init() = hasEnable("lock_screen_double_tap_to_sleep") {
|
override fun init() = hasEnable("lock_screen_double_tap_to_sleep") {
|
||||||
findMethod("com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer") {
|
findMethod("com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer") {
|
||||||
name == "onFinishInflate"
|
name == "onFinishInflate"
|
||||||
@@ -37,7 +35,7 @@ object LockScreenDoubleTapToSleepForT : HookRegister() {
|
|||||||
currentTouchTime = System.currentTimeMillis()
|
currentTouchTime = System.currentTimeMillis()
|
||||||
currentTouchX = event.x
|
currentTouchX = event.x
|
||||||
currentTouchY = event.y
|
currentTouchY = event.y
|
||||||
if (currentTouchTime - lastTouchTime < 250L && abs(currentTouchX - lastTouchX) < 100f && abs(
|
if (currentTouchTime - lastTouchTime < 250L && Math.abs(currentTouchX - lastTouchX) < 100f && Math.abs(
|
||||||
currentTouchY - lastTouchY
|
currentTouchY - lastTouchY
|
||||||
) < 100f
|
) < 100f
|
||||||
) {
|
) {
|
||||||
@@ -66,5 +64,4 @@ object LockScreenDoubleTapToSleepForT : HookRegister() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookReplace
|
import com.github.kyuubiran.ezxhelper.utils.hookReplace
|
||||||
import com.github.kyuubiran.ezxhelper.utils.invokeMethod
|
import com.github.kyuubiran.ezxhelper.utils.invokeMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
import com.github.kyuubiran.ezxhelper.utils.putObject
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object MaximumNumberOfNotificationIconsForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object MaximumNumberOfNotificationIcons : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
val icons = XSPUtils.getInt("maximum_number_of_notification_icons", 3)
|
val icons = XSPUtils.getInt("maximum_number_of_notification_icons", 3)
|
||||||
val dots = XSPUtils.getInt("maximum_number_of_notification_dots", 3)
|
val dots = XSPUtils.getInt("maximum_number_of_notification_dots", 3)
|
||||||
@@ -27,5 +26,4 @@ object MaximumNumberOfNotificationIconsForS : HookRegister() {
|
|||||||
it.thisObject.invokeMethod("updateState")
|
it.thisObject.invokeMethod("updateState")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.content.ComponentName
|
import android.content.ComponentName
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -10,13 +10,11 @@ import android.widget.Toast
|
|||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import cn.fkj233.ui.activity.dp2px
|
import cn.fkj233.ui.activity.dp2px
|
||||||
import com.github.kyuubiran.ezxhelper.utils.*
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
import com.lt2333.simplicitytools.utils.SystemProperties
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.view.WeatherView
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
|
||||||
import com.lt2333.simplicitytools.views.WeatherView
|
|
||||||
|
|
||||||
object NotificationWeatherForS : HookRegister() {
|
object NotificationWeather : HookRegister() {
|
||||||
|
|
||||||
override fun init() = hasEnable("notification_weather") {
|
override fun init() = hasEnable("notification_weather") {
|
||||||
var mWeatherView: TextView? = null
|
var mWeatherView: TextView? = null
|
||||||
@@ -24,22 +22,32 @@ object NotificationWeatherForS : HookRegister() {
|
|||||||
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
||||||
findMethod("com.android.systemui.qs.MiuiNotificationHeaderView") {
|
findMethod("com.android.systemui.qs.MiuiNotificationHeaderView") {
|
||||||
name == "onFinishInflate"
|
name == "onFinishInflate"
|
||||||
}.hookAfter { param ->
|
}.hookAfter {
|
||||||
val viewGroup = param.thisObject as ViewGroup
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
val context = viewGroup.context
|
val context = viewGroup.context
|
||||||
|
|
||||||
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
|
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
|
||||||
if (SystemProperties[context, "ro.build.date.utc"].toInt() >= 1647014400 &&
|
if (SystemProperties.get(context, "ro.build.date.utc")!!
|
||||||
!SystemProperties[context, "ro.build.version.incremental"].endsWith("XM")
|
.toInt() >= 1647014400 &&
|
||||||
|
|
||||||
|
!SystemProperties.get(
|
||||||
|
context,
|
||||||
|
"ro.build.version.incremental"
|
||||||
|
)!!.endsWith("DEV") &&
|
||||||
|
|
||||||
|
!SystemProperties.get(
|
||||||
|
context,
|
||||||
|
"ro.build.version.incremental"
|
||||||
|
)!!.endsWith("XM")
|
||||||
) {
|
) {
|
||||||
//获取原组件
|
//获取原组件
|
||||||
val bigTimeId =
|
val big_time_ID =
|
||||||
context.resources.getIdentifier("big_time", "id", context.packageName)
|
context.resources.getIdentifier("big_time", "id", context.packageName)
|
||||||
val bigTime: TextView = viewGroup.findViewById(bigTimeId)
|
val big_time: TextView = viewGroup.findViewById(big_time_ID)
|
||||||
|
|
||||||
val dateTimeId =
|
val date_time_ID =
|
||||||
context.resources.getIdentifier("date_time", "id", context.packageName)
|
context.resources.getIdentifier("date_time", "id", context.packageName)
|
||||||
val dateTime: TextView = viewGroup.findViewById(dateTimeId)
|
val date_time: TextView = viewGroup.findViewById(date_time_ID)
|
||||||
|
|
||||||
//创建新布局
|
//创建新布局
|
||||||
val mConstraintLayoutLp = LinearLayout.LayoutParams(
|
val mConstraintLayoutLp = LinearLayout.LayoutParams(
|
||||||
@@ -58,25 +66,25 @@ object NotificationWeatherForS : HookRegister() {
|
|||||||
mConstraintLayout =
|
mConstraintLayout =
|
||||||
ConstraintLayout(context).also { it.layoutParams = mConstraintLayoutLp }
|
ConstraintLayout(context).also { it.layoutParams = mConstraintLayoutLp }
|
||||||
|
|
||||||
(bigTime.parent as ViewGroup).addView(mConstraintLayout, 0)
|
(big_time.parent as ViewGroup).addView(mConstraintLayout, 0)
|
||||||
|
|
||||||
|
|
||||||
//从原布局中删除组件
|
//从原布局中删除组件
|
||||||
(bigTime.parent as ViewGroup).removeView(bigTime)
|
(big_time.parent as ViewGroup).removeView(big_time)
|
||||||
(dateTime.parent as ViewGroup).removeView(dateTime)
|
(date_time.parent as ViewGroup).removeView(date_time)
|
||||||
|
|
||||||
|
|
||||||
//添加组件至新布局
|
//添加组件至新布局
|
||||||
mConstraintLayout!!.addView(bigTime)
|
mConstraintLayout!!.addView(big_time)
|
||||||
mConstraintLayout!!.addView(dateTime)
|
mConstraintLayout!!.addView(date_time)
|
||||||
|
|
||||||
//组件属性
|
//组件属性
|
||||||
|
|
||||||
val dateTimeLp = ConstraintLayout.LayoutParams(
|
val date_time_LP = ConstraintLayout.LayoutParams(
|
||||||
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
||||||
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
||||||
).also {
|
).also {
|
||||||
it.startToEnd = bigTimeId
|
it.startToEnd = big_time_ID
|
||||||
it.bottomToBottom = 0
|
it.bottomToBottom = 0
|
||||||
it.marginStart = context.resources.getDimensionPixelSize(
|
it.marginStart = context.resources.getDimensionPixelSize(
|
||||||
context.resources.getIdentifier(
|
context.resources.getIdentifier(
|
||||||
@@ -87,7 +95,7 @@ object NotificationWeatherForS : HookRegister() {
|
|||||||
)
|
)
|
||||||
it.bottomMargin = dp2px(context, 5f)
|
it.bottomMargin = dp2px(context, 5f)
|
||||||
}
|
}
|
||||||
dateTime.layoutParams = dateTimeLp
|
date_time.layoutParams = date_time_LP
|
||||||
|
|
||||||
|
|
||||||
//创建天气组件
|
//创建天气组件
|
||||||
@@ -103,12 +111,12 @@ object NotificationWeatherForS : HookRegister() {
|
|||||||
}
|
}
|
||||||
mConstraintLayout!!.addView(mWeatherView)
|
mConstraintLayout!!.addView(mWeatherView)
|
||||||
|
|
||||||
val mweatherviewLp = ConstraintLayout.LayoutParams(
|
val mWeatherView_LP = ConstraintLayout.LayoutParams(
|
||||||
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
||||||
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
||||||
).also {
|
).also {
|
||||||
it.startToEnd = bigTimeId
|
it.startToEnd = big_time_ID
|
||||||
it.bottomToTop = dateTimeId
|
it.bottomToTop = date_time_ID
|
||||||
it.marginStart = context.resources.getDimensionPixelSize(
|
it.marginStart = context.resources.getDimensionPixelSize(
|
||||||
context.resources.getIdentifier(
|
context.resources.getIdentifier(
|
||||||
"notification_panel_time_date_space",
|
"notification_panel_time_date_space",
|
||||||
@@ -118,7 +126,7 @@ object NotificationWeatherForS : HookRegister() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
(mWeatherView as WeatherView).layoutParams = mweatherviewLp
|
(mWeatherView as WeatherView).layoutParams = mWeatherView_LP
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
val layoutParam =
|
val layoutParam =
|
||||||
@@ -180,9 +188,18 @@ object NotificationWeatherForS : HookRegister() {
|
|||||||
val context = viewGroup.context
|
val context = viewGroup.context
|
||||||
val mOrientation = viewGroup.getObject("mOrientation") as Int
|
val mOrientation = viewGroup.getObject("mOrientation") as Int
|
||||||
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
|
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
|
||||||
if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith(
|
if (SystemProperties.get(context, "ro.build.date.utc")!!
|
||||||
"DEV"
|
.toInt() >= 1647014400 &&
|
||||||
) && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM")
|
|
||||||
|
!SystemProperties.get(
|
||||||
|
context,
|
||||||
|
"ro.build.version.incremental"
|
||||||
|
)!!.endsWith("DEV") &&
|
||||||
|
|
||||||
|
!SystemProperties.get(
|
||||||
|
context,
|
||||||
|
"ro.build.version.incremental"
|
||||||
|
)!!.endsWith("XM")
|
||||||
) {
|
) {
|
||||||
if (mOrientation == 1) {
|
if (mOrientation == 1) {
|
||||||
mConstraintLayout!!.visibility = View.VISIBLE
|
mConstraintLayout!!.visibility = View.VISIBLE
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.content.ComponentName
|
import android.content.ComponentName
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -7,13 +7,12 @@ import android.view.ViewGroup
|
|||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.github.kyuubiran.ezxhelper.utils.*
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import com.lt2333.simplicitytools.views.WeatherView
|
import com.lt2333.simplicitytools.view.WeatherView
|
||||||
|
|
||||||
object OldNotificationWeatherForT : HookRegister() {
|
|
||||||
|
|
||||||
|
object OldNotificationWeather : HookRegister() {
|
||||||
override fun init() = hasEnable("notification_weather") {
|
override fun init() = hasEnable("notification_weather") {
|
||||||
var mWeatherView: TextView? = null
|
var mWeatherView: TextView? = null
|
||||||
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
||||||
@@ -94,5 +93,4 @@ object OldNotificationWeatherForT : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@@ -6,12 +6,12 @@ import com.github.kyuubiran.ezxhelper.utils.findMethod
|
|||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
import com.github.kyuubiran.ezxhelper.utils.putObject
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
object OldQSCustomForT : HookRegister() {
|
|
||||||
|
|
||||||
|
object OldQSCustom : HookRegister() {
|
||||||
override fun init() = hasEnable("old_qs_custom_switch") {
|
override fun init() = hasEnable("old_qs_custom_switch") {
|
||||||
val mRows = XSPUtils.getInt("qs_custom_rows", 3)
|
val mRows = XSPUtils.getInt("qs_custom_rows", 3)
|
||||||
val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2)
|
val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2)
|
||||||
@@ -39,12 +39,11 @@ object OldQSCustomForT : HookRegister() {
|
|||||||
val viewGroup = it.thisObject as ViewGroup
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
val mConfiguration: Configuration = viewGroup.context.resources.configuration
|
val mConfiguration: Configuration = viewGroup.context.resources.configuration
|
||||||
if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||||
viewGroup.putObject("mMaxAllowedRows", mRows)
|
XposedHelpers.setObjectField(viewGroup, "mMaxAllowedRows", mRows)
|
||||||
} else {
|
} else {
|
||||||
viewGroup.putObject("mMaxAllowedRows", mRowsHorizontal)
|
XposedHelpers.setObjectField(viewGroup, "mMaxAllowedRows", mRowsHorizontal)
|
||||||
}
|
}
|
||||||
viewGroup.requestLayout()
|
viewGroup.requestLayout()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
@@ -6,10 +6,10 @@ import com.github.kyuubiran.ezxhelper.utils.findMethod
|
|||||||
import com.github.kyuubiran.ezxhelper.utils.getObject
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object RemoveLockScreenCameraForT : HookRegister() {
|
object RemoveLockScreenCamera : HookRegister() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
//屏蔽右下角组件显示
|
//屏蔽右下角组件显示
|
||||||
@@ -38,6 +38,5 @@ object RemoveLockScreenCameraForT : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object RemoveTheLeftSideOfTheLockScreenForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object RemoveTheLeftSideOfTheLockScreen : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer") {
|
findMethod("com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer") {
|
||||||
name == "inflateLeftView"
|
name == "inflateLeftView"
|
||||||
@@ -16,5 +15,4 @@ object RemoveTheLeftSideOfTheLockScreenForS : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
@@ -12,13 +12,13 @@ import android.widget.TextView
|
|||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
||||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
|
||||||
object StatusBarBigMobileTypeIconForS : HookRegister() {
|
object StatusBarBigMobileTypeIcon : HookRegister() {
|
||||||
|
|
||||||
private val upAndDownPosition = XSPUtils.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
private val upAndDownPosition = XSPUtils.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
||||||
private val leftAndRightMargin =
|
private val leftAndRightMargin =
|
||||||
@@ -29,8 +29,8 @@ object StatusBarBigMobileTypeIconForS : HookRegister() {
|
|||||||
override fun init() = hasEnable("big_mobile_type_icon") {
|
override fun init() = hasEnable("big_mobile_type_icon") {
|
||||||
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
|
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
|
||||||
name == "init"
|
name == "init"
|
||||||
}.hookAfter { param ->
|
}.hookAfter {
|
||||||
val statusBarMobileView = param.thisObject as ViewGroup
|
val statusBarMobileView = it.thisObject as ViewGroup
|
||||||
val context: Context = statusBarMobileView.context
|
val context: Context = statusBarMobileView.context
|
||||||
val res: Resources = context.resources
|
val res: Resources = context.resources
|
||||||
|
|
||||||
@@ -69,13 +69,15 @@ object StatusBarBigMobileTypeIconForS : HookRegister() {
|
|||||||
val newLinearLayoutLP = LinearLayout.LayoutParams(
|
val newLinearLayoutLP = LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT
|
LinearLayout.LayoutParams.MATCH_PARENT
|
||||||
)
|
).also {
|
||||||
|
|
||||||
|
}
|
||||||
val newLinearlayout = LinearLayout(context).also {
|
val newLinearlayout = LinearLayout(context).also {
|
||||||
it.layoutParams = newLinearLayoutLP
|
it.layoutParams = newLinearLayoutLP
|
||||||
it.id = mobileContainerLeftId
|
it.id = mobileContainerLeftId
|
||||||
it.setPadding(leftAndRightMargin, 0, leftAndRightMargin, 0)
|
it.setPadding(leftAndRightMargin, 0, leftAndRightMargin, 0)
|
||||||
}
|
}
|
||||||
param.thisObject.putObject("mMobileLeftContainer", newLinearlayout)
|
XposedHelpers.setObjectField(it.thisObject, "mMobileLeftContainer", newLinearlayout)
|
||||||
rightParentLayout.addView(
|
rightParentLayout.addView(
|
||||||
newLinearlayout,
|
newLinearlayout,
|
||||||
mobileContainerRightIndex
|
mobileContainerRightIndex
|
||||||
@@ -119,5 +121,4 @@ object StatusBarBigMobileTypeIconForS : HookRegister() {
|
|||||||
}.hookReturnConstant(null)
|
}.hookReturnConstant(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
@@ -7,13 +7,11 @@ import android.view.View.OnTouchListener
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
import kotlin.math.abs
|
|
||||||
|
|
||||||
object StatusBarDoubleTapToSleepForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object StatusBarDoubleTapToSleep : HookRegister() {
|
||||||
override fun init() = hasEnable("status_bar_double_tap_to_sleep") {
|
override fun init() = hasEnable("status_bar_double_tap_to_sleep") {
|
||||||
findMethod("com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView") {
|
findMethod("com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView") {
|
||||||
name == "onFinishInflate"
|
name == "onFinishInflate"
|
||||||
@@ -36,7 +34,7 @@ object StatusBarDoubleTapToSleepForS : HookRegister() {
|
|||||||
currentTouchTime = System.currentTimeMillis()
|
currentTouchTime = System.currentTimeMillis()
|
||||||
currentTouchX = event.x
|
currentTouchX = event.x
|
||||||
currentTouchY = event.y
|
currentTouchY = event.y
|
||||||
if (currentTouchTime - lastTouchTime < 250L && abs(currentTouchX - lastTouchX) < 100f && abs(
|
if (currentTouchTime - lastTouchTime < 250L && Math.abs(currentTouchX - lastTouchX) < 100f && Math.abs(
|
||||||
currentTouchY - lastTouchY
|
currentTouchY - lastTouchY
|
||||||
) < 100f
|
) < 100f
|
||||||
) {
|
) {
|
||||||
@@ -61,5 +59,4 @@ object StatusBarDoubleTapToSleepForS : HookRegister() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,426 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
|
import android.app.KeyguardManager
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.res.Configuration
|
||||||
|
import android.content.res.Resources
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
import cn.fkj233.ui.activity.dp2px
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
|
||||||
|
object StatusBarLayout : HookRegister() {
|
||||||
|
|
||||||
|
private var statusBarLeft = 0
|
||||||
|
private var statusBarTop = 0
|
||||||
|
private var statusBarRight = 0
|
||||||
|
private var statusBarBottom = 0
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
var mLeftLayout: LinearLayout? = null
|
||||||
|
var mRightLayout: LinearLayout? = null
|
||||||
|
var mCenterLayout: LinearLayout? = null
|
||||||
|
var statusBar: ViewGroup? = null
|
||||||
|
|
||||||
|
fun updateLayout(context: Context) {
|
||||||
|
//判断屏幕方向
|
||||||
|
val mConfiguration: Configuration = context.resources.configuration
|
||||||
|
if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||||
|
mLeftLayout!!.setPadding(statusBarLeft, 0, 0, 0)
|
||||||
|
mRightLayout!!.setPadding(0, 0, statusBarRight, 0)
|
||||||
|
statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
|
||||||
|
} else {
|
||||||
|
//横屏状态
|
||||||
|
mLeftLayout!!.setPadding(175, 0, 0, 0)
|
||||||
|
mRightLayout!!.setPadding(0, 0, 175, 0)
|
||||||
|
statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
when (XSPUtils.getInt("status_bar_layout_mode", 0)) {
|
||||||
|
//默认
|
||||||
|
0 -> return
|
||||||
|
//时钟居中
|
||||||
|
1 -> {
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||||
|
name == "onViewCreated" && parameterCount == 2
|
||||||
|
}.hookAfter {
|
||||||
|
val MiuiPhoneStatusBarView: ViewGroup =
|
||||||
|
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||||
|
val context: Context = MiuiPhoneStatusBarView.context
|
||||||
|
val res: Resources = MiuiPhoneStatusBarView.resources
|
||||||
|
val statusBarId: Int =
|
||||||
|
res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||||
|
val statusBarContentsId: Int =
|
||||||
|
res.getIdentifier("status_bar_contents", "id", "com.android.systemui")
|
||||||
|
val systemIconAreaId: Int =
|
||||||
|
res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
||||||
|
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||||
|
val phoneStatusBarLeftContainerId: Int =
|
||||||
|
res.getIdentifier(
|
||||||
|
"phone_status_bar_left_container",
|
||||||
|
"id",
|
||||||
|
"com.android.systemui"
|
||||||
|
)
|
||||||
|
val notificationIconAreaInnerId: Int =
|
||||||
|
res.getIdentifier(
|
||||||
|
"notification_icon_area_inner",
|
||||||
|
"id",
|
||||||
|
"com.android.systemui"
|
||||||
|
)
|
||||||
|
statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId)
|
||||||
|
val statusBarContents: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(statusBarContentsId)
|
||||||
|
if (statusBar == null) return@hookAfter
|
||||||
|
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
|
||||||
|
val phoneStatusBarLeftContainer: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId)
|
||||||
|
val notificationIconAreaInner: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(notificationIconAreaInnerId)
|
||||||
|
val systemIconArea: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(systemIconAreaId)
|
||||||
|
|
||||||
|
(clock.parent as ViewGroup).removeView(clock)
|
||||||
|
(phoneStatusBarLeftContainer.parent as ViewGroup).removeView(
|
||||||
|
phoneStatusBarLeftContainer
|
||||||
|
)
|
||||||
|
(notificationIconAreaInner.parent as ViewGroup).removeView(
|
||||||
|
notificationIconAreaInner
|
||||||
|
)
|
||||||
|
(systemIconArea.parent as ViewGroup).removeView(systemIconArea)
|
||||||
|
|
||||||
|
val mConstraintLayout =
|
||||||
|
ConstraintLayout(context).also {
|
||||||
|
it.layoutParams = ConstraintLayout.LayoutParams(
|
||||||
|
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
mConstraintLayout.addView(notificationIconAreaInner)
|
||||||
|
|
||||||
|
val fullscreen_notification_icon_area_lp = LinearLayout.LayoutParams(
|
||||||
|
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||||
|
)
|
||||||
|
|
||||||
|
notificationIconAreaInner.layoutParams = fullscreen_notification_icon_area_lp
|
||||||
|
|
||||||
|
//增加一个左对齐布局
|
||||||
|
mLeftLayout = LinearLayout(context)
|
||||||
|
val LeftLp: LinearLayout.LayoutParams =
|
||||||
|
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
|
||||||
|
mLeftLayout!!.layoutParams = LeftLp
|
||||||
|
mLeftLayout!!.gravity = Gravity.START or Gravity.CENTER_VERTICAL
|
||||||
|
|
||||||
|
//增加一个居中布局
|
||||||
|
mCenterLayout = LinearLayout(context)
|
||||||
|
val CenterLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT
|
||||||
|
)
|
||||||
|
mCenterLayout!!.layoutParams = CenterLp
|
||||||
|
mCenterLayout!!.gravity = Gravity.CENTER or Gravity.CENTER_VERTICAL
|
||||||
|
mRightLayout = LinearLayout(context)
|
||||||
|
val RightLp: LinearLayout.LayoutParams =
|
||||||
|
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
|
||||||
|
mRightLayout!!.layoutParams = RightLp
|
||||||
|
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||||
|
mLeftLayout!!.addView(phoneStatusBarLeftContainer)
|
||||||
|
mLeftLayout!!.addView(mConstraintLayout)
|
||||||
|
|
||||||
|
mCenterLayout!!.addView(clock)
|
||||||
|
mRightLayout!!.addView(systemIconArea)
|
||||||
|
statusBarContents.addView(mLeftLayout, 0)
|
||||||
|
statusBarContents.addView(mCenterLayout)
|
||||||
|
statusBarContents.addView(mRightLayout)
|
||||||
|
|
||||||
|
statusBarLeft = statusBar!!.paddingLeft
|
||||||
|
statusBarTop = statusBar!!.paddingTop
|
||||||
|
statusBarRight = statusBar!!.paddingRight
|
||||||
|
statusBarBottom = statusBar!!.paddingBottom
|
||||||
|
|
||||||
|
|
||||||
|
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||||
|
val customLeftMargin = XSPUtils.getInt("status_bar_left_margin", 0)
|
||||||
|
if (customLeftMargin != 0) {
|
||||||
|
statusBarLeft = customLeftMargin
|
||||||
|
}
|
||||||
|
|
||||||
|
val customRightMargin = XSPUtils.getInt("status_bar_right_margin", 0)
|
||||||
|
if (customRightMargin != 0) {
|
||||||
|
statusBarRight = customRightMargin
|
||||||
|
}
|
||||||
|
updateLayout(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.PhoneStatusBarView") {
|
||||||
|
name == "updateLayoutForCutout"
|
||||||
|
}.hookAfter {
|
||||||
|
hasEnable("layout_compatibility_mode") {
|
||||||
|
val context = (it.thisObject as ViewGroup).context
|
||||||
|
updateLayout(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//时钟居右
|
||||||
|
2 -> {
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||||
|
name == "onViewCreated" && parameterCount == 2
|
||||||
|
}.hookAfter {
|
||||||
|
val MiuiPhoneStatusBarView =
|
||||||
|
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||||
|
val context: Context = MiuiPhoneStatusBarView.context
|
||||||
|
val res: Resources = MiuiPhoneStatusBarView.resources
|
||||||
|
|
||||||
|
//组件ID
|
||||||
|
val statusBarId: Int =
|
||||||
|
res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||||
|
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||||
|
val batteryId: Int = res.getIdentifier("battery", "id", "com.android.systemui")
|
||||||
|
|
||||||
|
//查找组件
|
||||||
|
statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId)
|
||||||
|
if (statusBar == null) return@hookAfter
|
||||||
|
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
|
||||||
|
val battery: ViewGroup = MiuiPhoneStatusBarView.findViewById(batteryId)
|
||||||
|
|
||||||
|
//新建布局
|
||||||
|
val RightLp = LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT
|
||||||
|
).also {
|
||||||
|
it.marginStart = dp2px(context, 5f)
|
||||||
|
}
|
||||||
|
mRightLayout = LinearLayout(context).also {
|
||||||
|
it.layoutParams = RightLp
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加布局与组件
|
||||||
|
battery.addView(mRightLayout)
|
||||||
|
(clock.parent as ViewGroup).removeView(clock)
|
||||||
|
mRightLayout!!.addView(clock)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//时钟居中+图标居左
|
||||||
|
3 -> {
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||||
|
name == "onViewCreated" && parameterCount == 2
|
||||||
|
}.hookAfter {
|
||||||
|
val MiuiPhoneStatusBarView =
|
||||||
|
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||||
|
val context: Context = MiuiPhoneStatusBarView.context
|
||||||
|
val res: Resources = MiuiPhoneStatusBarView.resources
|
||||||
|
val statusBarId: Int =
|
||||||
|
res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||||
|
val statusBarContentsId: Int =
|
||||||
|
res.getIdentifier("status_bar_contents", "id", "com.android.systemui")
|
||||||
|
val systemIconAreaId: Int =
|
||||||
|
res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
||||||
|
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||||
|
val phoneStatusBarLeftContainerId: Int =
|
||||||
|
res.getIdentifier(
|
||||||
|
"phone_status_bar_left_container",
|
||||||
|
"id",
|
||||||
|
"com.android.systemui"
|
||||||
|
)
|
||||||
|
val fullscreenNotificationIconAreaId: Int =
|
||||||
|
res.getIdentifier(
|
||||||
|
"fullscreen_notification_icon_area",
|
||||||
|
"id",
|
||||||
|
"com.android.systemui"
|
||||||
|
)
|
||||||
|
val statusIconsId: Int =
|
||||||
|
res.getIdentifier(
|
||||||
|
"statusIcons",
|
||||||
|
"id",
|
||||||
|
"com.android.systemui"
|
||||||
|
)
|
||||||
|
val systemIconsId: Int =
|
||||||
|
res.getIdentifier(
|
||||||
|
"system_icons",
|
||||||
|
"id",
|
||||||
|
"com.android.systemui"
|
||||||
|
)
|
||||||
|
val batteryId: Int =
|
||||||
|
res.getIdentifier(
|
||||||
|
"battery",
|
||||||
|
"id",
|
||||||
|
"com.android.systemui"
|
||||||
|
)
|
||||||
|
val notificationIconAreaInnerId: Int =
|
||||||
|
res.getIdentifier(
|
||||||
|
"notification_icon_area_inner",
|
||||||
|
"id",
|
||||||
|
"com.android.systemui"
|
||||||
|
)
|
||||||
|
|
||||||
|
statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId)
|
||||||
|
val statusBarContents: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(statusBarContentsId)
|
||||||
|
if (statusBar == null) return@hookAfter
|
||||||
|
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
|
||||||
|
val phoneStatusBarLeftContainer: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId)
|
||||||
|
val fullscreenNotificationIconArea: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(fullscreenNotificationIconAreaId)
|
||||||
|
val systemIconArea: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(systemIconAreaId)
|
||||||
|
val statusIcons: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(statusIconsId)
|
||||||
|
val systemIcons: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(systemIconsId)
|
||||||
|
val battery: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(batteryId)
|
||||||
|
val notificationIconAreaInner: ViewGroup =
|
||||||
|
MiuiPhoneStatusBarView.findViewById(notificationIconAreaInnerId)
|
||||||
|
|
||||||
|
(clock.parent as ViewGroup).removeView(clock)
|
||||||
|
(phoneStatusBarLeftContainer.parent as ViewGroup).removeView(
|
||||||
|
phoneStatusBarLeftContainer
|
||||||
|
)
|
||||||
|
(systemIconArea.parent as ViewGroup).removeView(systemIconArea)
|
||||||
|
(statusIcons.parent as ViewGroup).removeView(statusIcons)
|
||||||
|
(systemIcons.parent as ViewGroup).removeView(systemIcons)
|
||||||
|
(battery.parent as ViewGroup).removeView(battery)
|
||||||
|
(fullscreenNotificationIconArea.parent as ViewGroup).removeView(
|
||||||
|
fullscreenNotificationIconArea
|
||||||
|
)
|
||||||
|
|
||||||
|
val mConstraintLayout =
|
||||||
|
ConstraintLayout(context).also {
|
||||||
|
it.layoutParams = ConstraintLayout.LayoutParams(
|
||||||
|
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
mConstraintLayout.addView(fullscreenNotificationIconArea)
|
||||||
|
mConstraintLayout.addView(battery)
|
||||||
|
|
||||||
|
|
||||||
|
battery.layoutParams = ConstraintLayout.LayoutParams(
|
||||||
|
ConstraintLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||||
|
).also {
|
||||||
|
it.endToEnd = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fullscreenNotificationIconArea.layoutParams = ConstraintLayout.LayoutParams(
|
||||||
|
0,
|
||||||
|
ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||||
|
).also {
|
||||||
|
it.startToEnd = batteryId
|
||||||
|
it.endToEnd = 0
|
||||||
|
}
|
||||||
|
fullscreenNotificationIconArea.layoutDirection = View.LAYOUT_DIRECTION_RTL
|
||||||
|
|
||||||
|
|
||||||
|
//增加一个左对齐布局
|
||||||
|
mLeftLayout = LinearLayout(context)
|
||||||
|
val LeftLp: LinearLayout.LayoutParams =
|
||||||
|
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
|
||||||
|
mLeftLayout!!.layoutParams = LeftLp
|
||||||
|
mLeftLayout!!.gravity = Gravity.START or Gravity.CENTER_VERTICAL
|
||||||
|
|
||||||
|
//增加一个居中布局
|
||||||
|
mCenterLayout = LinearLayout(context)
|
||||||
|
val CenterLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT
|
||||||
|
)
|
||||||
|
mCenterLayout!!.layoutParams = CenterLp
|
||||||
|
mCenterLayout!!.gravity = Gravity.CENTER or Gravity.CENTER_VERTICAL
|
||||||
|
|
||||||
|
//增加一个右布局
|
||||||
|
mRightLayout = LinearLayout(context)
|
||||||
|
val RightLp: LinearLayout.LayoutParams =
|
||||||
|
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
|
||||||
|
mRightLayout!!.layoutParams = RightLp
|
||||||
|
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||||
|
|
||||||
|
|
||||||
|
mLeftLayout!!.addView(phoneStatusBarLeftContainer)
|
||||||
|
mLeftLayout!!.addView(statusIcons)
|
||||||
|
statusIcons.layoutDirection = View.LAYOUT_DIRECTION_RTL
|
||||||
|
|
||||||
|
mCenterLayout!!.addView(clock)
|
||||||
|
|
||||||
|
mRightLayout!!.addView(mConstraintLayout)
|
||||||
|
fullscreenNotificationIconArea.layoutDirection = View.LAYOUT_DIRECTION_RTL
|
||||||
|
|
||||||
|
|
||||||
|
statusBarContents.addView(mLeftLayout, 0)
|
||||||
|
statusBarContents.addView(mCenterLayout)
|
||||||
|
statusBarContents.addView(mRightLayout)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
statusBarLeft = statusBar!!.paddingLeft
|
||||||
|
statusBarTop = statusBar!!.paddingTop
|
||||||
|
statusBarRight = statusBar!!.paddingRight
|
||||||
|
statusBarBottom = statusBar!!.paddingBottom
|
||||||
|
|
||||||
|
|
||||||
|
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||||
|
val customLeftMargin = XSPUtils.getInt("status_bar_left_margin", 0)
|
||||||
|
if (customLeftMargin != 0) {
|
||||||
|
statusBarLeft = customLeftMargin
|
||||||
|
}
|
||||||
|
|
||||||
|
val customRightMargin = XSPUtils.getInt("status_bar_right_margin", 0)
|
||||||
|
if (customRightMargin != 0) {
|
||||||
|
statusBarRight = customRightMargin
|
||||||
|
}
|
||||||
|
updateLayout(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//兼容模式
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.PhoneStatusBarView") {
|
||||||
|
name == "updateLayoutForCutout"
|
||||||
|
}.hookAfter {
|
||||||
|
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||||
|
val context = (it.thisObject as ViewGroup).context
|
||||||
|
updateLayout(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//解决重叠
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.MiuiCollapsedStatusBarFragment") {
|
||||||
|
name == "showClock" && parameterTypes[0] == Boolean::class.java
|
||||||
|
}.hookAfter {
|
||||||
|
val MiuiPhoneStatusBarView =
|
||||||
|
XposedHelpers.getObjectField(it.thisObject, "mStatusBar") as ViewGroup
|
||||||
|
val res = MiuiPhoneStatusBarView.resources
|
||||||
|
val status_bar_ID =
|
||||||
|
res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||||
|
val status_bar = MiuiPhoneStatusBarView.findViewById<ViewGroup>(status_bar_ID)
|
||||||
|
//非锁屏下整个状态栏布局
|
||||||
|
val keyguardMgr =
|
||||||
|
status_bar.context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
|
||||||
|
if (keyguardMgr.isKeyguardLocked) {
|
||||||
|
status_bar!!.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
status_bar!!.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object StatusBarNetworkSpeedRefreshSpeedForS : HookRegister() {
|
|
||||||
|
|
||||||
|
object StatusBarNetworkSpeedRefreshSpeed : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.systemui.statusbar.policy.NetworkSpeedController") {
|
findMethod("com.android.systemui.statusbar.policy.NetworkSpeedController") {
|
||||||
name == "postUpdateNetworkSpeedDelay" && parameterTypes[0] == Long::class.java
|
name == "postUpdateNetworkSpeedDelay" && parameterTypes[0] == Long::class.java
|
||||||
@@ -16,5 +15,4 @@ object StatusBarNetworkSpeedRefreshSpeedForS : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,258 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.res.Resources
|
||||||
|
import android.os.Handler
|
||||||
|
import android.provider.Settings
|
||||||
|
import android.util.TypedValue
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import java.lang.reflect.Method
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
object StatusBarTimeCustomization : HookRegister() {
|
||||||
|
|
||||||
|
private val isYear = XSPUtils.getBoolean("status_bar_time_year", false)
|
||||||
|
private val isMonth = XSPUtils.getBoolean("status_bar_time_month", false)
|
||||||
|
private val isDay = XSPUtils.getBoolean("status_bar_time_day", false)
|
||||||
|
private val isWeek = XSPUtils.getBoolean("status_bar_time_week", false)
|
||||||
|
private val isHideSpace = XSPUtils.getBoolean("status_bar_time_hide_space", false)
|
||||||
|
private val isDoubleLine = XSPUtils.getBoolean("status_bar_time_double_line", false)
|
||||||
|
private val isSecond = XSPUtils.getBoolean("status_bar_time_seconds", false)
|
||||||
|
private val isDoubleHour = XSPUtils.getBoolean("status_bar_time_double_hour", false)
|
||||||
|
private val isPeriod = XSPUtils.getBoolean("status_bar_time_period", true)
|
||||||
|
private val getClockSize = XSPUtils.getInt("status_bar_clock_size", 0)
|
||||||
|
private val isOpen = XSPUtils.getBoolean("custom_clock_switch", false)
|
||||||
|
private val isCenterAlign =
|
||||||
|
XSPUtils.getBoolean("status_bar_time_double_line_center_align", false)
|
||||||
|
private val getClockDoubleSize = XSPUtils.getInt("status_bar_clock_double_line_size", 0)
|
||||||
|
private var nowTime: Date? = null
|
||||||
|
private var str = ""
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
override fun init() {
|
||||||
|
if (isOpen) {
|
||||||
|
var c: Context? = null
|
||||||
|
|
||||||
|
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||||
|
paramCount == 3
|
||||||
|
}.hookAfter {
|
||||||
|
try {
|
||||||
|
c = it.args[0] as Context
|
||||||
|
val textV = it.thisObject as TextView
|
||||||
|
if (textV.resources.getResourceEntryName(textV.id) != "clock") return@hookAfter
|
||||||
|
textV.isSingleLine = false
|
||||||
|
if (isDoubleLine) {
|
||||||
|
str = "\n"
|
||||||
|
var clockDoubleLineSize = 7F
|
||||||
|
if (getClockDoubleSize != 0) {
|
||||||
|
clockDoubleLineSize = getClockDoubleSize.toFloat()
|
||||||
|
}
|
||||||
|
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockDoubleLineSize)
|
||||||
|
textV.setLineSpacing(0F, 0.8F)
|
||||||
|
} else {
|
||||||
|
if (getClockSize != 0) {
|
||||||
|
val clockSize = getClockSize.toFloat()
|
||||||
|
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSize)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
||||||
|
val r = Runnable {
|
||||||
|
d.isAccessible = true
|
||||||
|
d.invoke(textV)
|
||||||
|
}
|
||||||
|
|
||||||
|
class T : TimerTask() {
|
||||||
|
override fun run() {
|
||||||
|
Handler(textV.context.mainLooper).post(r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
|
||||||
|
name == "updateTime"
|
||||||
|
}.hookAfter {
|
||||||
|
try {
|
||||||
|
val textV = it.thisObject as TextView
|
||||||
|
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
||||||
|
val t = Settings.System.getString(
|
||||||
|
c!!.contentResolver,
|
||||||
|
Settings.System.TIME_12_24
|
||||||
|
)
|
||||||
|
val is24 = t == "24"
|
||||||
|
nowTime = Calendar.getInstance().time
|
||||||
|
textV.text = getDate(c!!) + str + getTime(c!!, is24)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isCenterAlign) {
|
||||||
|
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||||
|
name == "onViewCreated" && parameterCount == 2
|
||||||
|
}.hookAfter {
|
||||||
|
val MiuiPhoneStatusBarView =
|
||||||
|
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||||
|
val res: Resources = MiuiPhoneStatusBarView.resources
|
||||||
|
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||||
|
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
|
||||||
|
clock.gravity = Gravity.CENTER
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SimpleDateFormat")
|
||||||
|
private fun getDate(context: Context): String {
|
||||||
|
var datePattern = ""
|
||||||
|
val isZh = isZh(context)
|
||||||
|
|
||||||
|
if (isYear) {
|
||||||
|
if (isZh) {
|
||||||
|
datePattern += "YY年"
|
||||||
|
// if (!isHideSpace) datePattern = "$datePattern "
|
||||||
|
} else {
|
||||||
|
datePattern += "YY"
|
||||||
|
if (isMonth || isDay) datePattern += "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isMonth) {
|
||||||
|
if (isZh) {
|
||||||
|
datePattern += "M月"
|
||||||
|
// if (!isHideSpace) datePattern = "$datePattern "
|
||||||
|
} else {
|
||||||
|
datePattern += "M"
|
||||||
|
if (isDay) datePattern += "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isDay) {
|
||||||
|
datePattern += if (isZh) {
|
||||||
|
"d日"
|
||||||
|
} else {
|
||||||
|
"d"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isWeek) {
|
||||||
|
if (!isHideSpace) datePattern = "$datePattern "
|
||||||
|
datePattern += "E"
|
||||||
|
if (!isDoubleLine) {
|
||||||
|
if (!isHideSpace) datePattern = "$datePattern "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datePattern = SimpleDateFormat(datePattern).format(nowTime)
|
||||||
|
return datePattern
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SimpleDateFormat")
|
||||||
|
private fun getTime(context: Context, t: Boolean): String {
|
||||||
|
var timePattern = ""
|
||||||
|
val isZh = isZh(context)
|
||||||
|
timePattern += if (t) "HH:mm" else "h:mm"
|
||||||
|
if (isSecond) timePattern += ":ss"
|
||||||
|
timePattern = SimpleDateFormat(timePattern).format(nowTime)
|
||||||
|
if (isZh) timePattern = getPeriod(isZh) + timePattern else timePattern += getPeriod(isZh)
|
||||||
|
timePattern = getDoubleHour() + timePattern
|
||||||
|
return timePattern
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SimpleDateFormat")
|
||||||
|
private fun getPeriod(isZh: Boolean): String {
|
||||||
|
var period = ""
|
||||||
|
if (isPeriod) {
|
||||||
|
if (isZh) {
|
||||||
|
when (SimpleDateFormat("HH").format(nowTime)) {
|
||||||
|
"00", "01", "02", "03", "04", "05" -> {
|
||||||
|
period = "凌晨"
|
||||||
|
}
|
||||||
|
"06", "07", "08", "09", "10", "11" -> {
|
||||||
|
period = "上午"
|
||||||
|
}
|
||||||
|
"12" -> {
|
||||||
|
period = "中午"
|
||||||
|
}
|
||||||
|
"13", "14", "15", "16", "17" -> {
|
||||||
|
period = "下午"
|
||||||
|
}
|
||||||
|
"18" -> {
|
||||||
|
period = "傍晚"
|
||||||
|
}
|
||||||
|
"19", "20", "21", "22", "23" -> {
|
||||||
|
period = "晚上"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
period = SimpleDateFormat("a").format(nowTime)
|
||||||
|
if (!isHideSpace) {
|
||||||
|
period = " $period"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return period
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SimpleDateFormat")
|
||||||
|
private fun getDoubleHour(): String {
|
||||||
|
var doubleHour = ""
|
||||||
|
if (isDoubleHour) {
|
||||||
|
when (SimpleDateFormat("HH").format(nowTime)) {
|
||||||
|
"23", "00" -> {
|
||||||
|
doubleHour = "子时"
|
||||||
|
}
|
||||||
|
"01", "02" -> {
|
||||||
|
doubleHour = "丑时"
|
||||||
|
}
|
||||||
|
"03", "04" -> {
|
||||||
|
doubleHour = "寅时"
|
||||||
|
}
|
||||||
|
"05", "06" -> {
|
||||||
|
doubleHour = "卯时"
|
||||||
|
}
|
||||||
|
"07", "08" -> {
|
||||||
|
doubleHour = "辰时"
|
||||||
|
}
|
||||||
|
"09", "10" -> {
|
||||||
|
doubleHour = "巳时"
|
||||||
|
}
|
||||||
|
"11", "12" -> {
|
||||||
|
doubleHour = "午时"
|
||||||
|
}
|
||||||
|
"13", "14" -> {
|
||||||
|
doubleHour = "未时"
|
||||||
|
}
|
||||||
|
"15", "16" -> {
|
||||||
|
doubleHour = "申时"
|
||||||
|
}
|
||||||
|
"17", "18" -> {
|
||||||
|
doubleHour = "酉时"
|
||||||
|
}
|
||||||
|
"19", "20" -> {
|
||||||
|
doubleHour = "戌时"
|
||||||
|
}
|
||||||
|
"21", "22" -> {
|
||||||
|
doubleHour = "亥时"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isHideSpace) {
|
||||||
|
doubleHour += " "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return doubleHour
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun isZh(context: Context): Boolean {
|
||||||
|
val locale = context.resources.configuration.locale
|
||||||
|
val language = locale.language
|
||||||
|
return language.endsWith("zh")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
|
import com.github.kyuubiran.ezxhelper.utils.hookMethod
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
|
||||||
|
object WaveCharge: HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
hasEnable("enable_wave_charge_animation") {
|
||||||
|
findMethod("com.android.keyguard.charge.ChargeUtils") {
|
||||||
|
name == "supportWaveChargeAnimation"
|
||||||
|
}.hookMethod {
|
||||||
|
after { param ->
|
||||||
|
val ex = Throwable()
|
||||||
|
val stackElement = ex.stackTrace
|
||||||
|
var mResult = false
|
||||||
|
val classTrue = setOf(
|
||||||
|
"com.android.keyguard.charge.ChargeUtils",
|
||||||
|
"com.android.keyguard.charge.container.MiuiChargeContainerView"
|
||||||
|
)
|
||||||
|
for (i in stackElement.indices) {
|
||||||
|
when (stackElement[i].className) {
|
||||||
|
in classTrue -> {
|
||||||
|
mResult = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
param.result = mResult
|
||||||
|
}
|
||||||
|
}
|
||||||
|
findMethod("com.android.keyguard.charge.wave.WaveView") {
|
||||||
|
name == "updateWaveHeight"
|
||||||
|
}.hookMethod {
|
||||||
|
after { param ->
|
||||||
|
XposedHelpers.setIntField(param.thisObject, "mWaveXOffset", 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.rules.all.thememanager
|
package com.lt2333.simplicitytools.hook.app.thememanager
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object RemoveAdsForAll : HookRegister() {
|
|
||||||
|
|
||||||
|
object RemoveAds : HookRegister() {
|
||||||
override fun init() {
|
override fun init() {
|
||||||
findMethod("com.android.thememanager.basemodule.ad.model.AdInfoResponse") {
|
findMethod("com.android.thememanager.basemodule.ad.model.AdInfoResponse") {
|
||||||
name == "isAdValid" && parameterCount == 1
|
name == "isAdValid" && parameterCount == 1
|
||||||
@@ -16,5 +15,4 @@ object RemoveAdsForAll : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.android.AllowUntrustedTouchesForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.android.DeleteOnPostNotificationForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.android.DisableFlagSecureForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.corepatch.CorePatchMainHook
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.android.MaxWallpaperScaleForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.android.RemoveSmallWindowRestrictionsForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.android.SystemPropertiesHookForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.t.android.MaxWallpaperScaleForT
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.t.android.SystemPropertiesHookForT
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object Android : AppRegister() {
|
|
||||||
override val packageName: String = "android"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
//核心破解
|
|
||||||
CorePatchMainHook().handleLoadPackage(lpparam)
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
DisableFlagSecureForAll, //允许截图
|
|
||||||
DeleteOnPostNotificationForAll, //上层显示
|
|
||||||
RemoveSmallWindowRestrictionsForS, //解除小窗限制
|
|
||||||
MaxWallpaperScaleForT, //壁纸缩放比例
|
|
||||||
SystemPropertiesHookForT, //SystemPropertiesHook
|
|
||||||
AllowUntrustedTouchesForAll, //允许不受信任的触摸
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
DisableFlagSecureForAll, //允许截图
|
|
||||||
DeleteOnPostNotificationForAll, //上层显示
|
|
||||||
RemoveSmallWindowRestrictionsForS, //解除小窗限制
|
|
||||||
MaxWallpaperScaleForS, //壁纸缩放比例
|
|
||||||
SystemPropertiesHookForS, //SystemPropertiesHook
|
|
||||||
AllowUntrustedTouchesForAll, //允许不受信任的触摸
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.cast.ForceSupportSendAppForAll
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object Cast : AppRegister() {
|
|
||||||
override val packageName: String = "com.milink.service"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
ForceSupportSendAppForAll, //强制允许所有应用接力
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
ForceSupportSendAppForAll, //强制允许所有应用接力
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.mediaeditor.UnlockUnlimitedCroppingForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.t.mediaeditor.UnlockUnlimitedCroppingForT
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object MediaEditor : AppRegister() {
|
|
||||||
override val packageName: String = "com.miui.mediaeditor"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
UnlockUnlimitedCroppingForT, //解锁裁切最小值
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
UnlockUnlimitedCroppingForS, //解锁裁切最小值
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.miuihome.AlwaysShowStatusBarClockForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.miuihome.DisableRecentViewWallpaperDarkeningForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.miuihome.DoubleTapToSleepForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.miuihome.ModifyRecentViewRemoveCardAnimForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.miuihome.RemoveSmallWindowRestrictionForMiuiHomeForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.miuihome.ScrollIconNameForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.miuihome.ShortcutAddSmallWindowForAll
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object MiuiHome : AppRegister() {
|
|
||||||
override val packageName: String = "com.miui.home"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
AlwaysShowStatusBarClockForAll, //时钟显示时钟
|
|
||||||
DoubleTapToSleepForAll, //双击锁屏
|
|
||||||
DisableRecentViewWallpaperDarkeningForAll, //取消后台壁纸压暗效果
|
|
||||||
ModifyRecentViewRemoveCardAnimForAll, //横向排布后台划卡动画
|
|
||||||
ScrollIconNameForAll, //滚动显示应用标题
|
|
||||||
RemoveSmallWindowRestrictionForMiuiHomeForAll, //取消小窗限制
|
|
||||||
ShortcutAddSmallWindowForAll, //快捷菜单添加小窗
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
AlwaysShowStatusBarClockForAll, //时钟显示时钟
|
|
||||||
DoubleTapToSleepForAll, //双击锁屏
|
|
||||||
DisableRecentViewWallpaperDarkeningForAll, //取消后台壁纸压暗效果
|
|
||||||
ModifyRecentViewRemoveCardAnimForAll, //横向排布后台划卡动画
|
|
||||||
ScrollIconNameForAll, //滚动显示应用标题
|
|
||||||
RemoveSmallWindowRestrictionForMiuiHomeForAll, //取消小窗限制
|
|
||||||
ShortcutAddSmallWindowForAll, //快捷菜单添加小窗
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
|
||||||
import com.lt2333.simplicitytools.utils.hasEnable
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.XposedBridge
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object PackageInstaller : AppRegister() {
|
|
||||||
|
|
||||||
override val packageName: String = "com.miui.packageinstaller"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
hasEnable("pkg_installer_count_checking") {
|
|
||||||
findMethod("com.miui.packageInstaller.model.RiskControlRules") {
|
|
||||||
name == "getCurrentLevel"
|
|
||||||
}.hookBefore { param ->
|
|
||||||
XposedBridge.log("Hooked getCurrentLevel, param result = ${param.result}")
|
|
||||||
param.result = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.powerkeeper.LockMaxFpsForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.DoNotClearAppForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.MakeMilletMoreAggressiveForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelistForS
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object PowerKeeper : AppRegister() {
|
|
||||||
override val packageName: String = "com.miui.powerkeeper"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
LockMaxFpsForAll, //锁定最高刷新率
|
|
||||||
PreventRecoveryOfBatteryOptimizationWhitelistForS, //防止恢复电池优化白名单
|
|
||||||
DoNotClearAppForS,//阻止杀后台
|
|
||||||
MakeMilletMoreAggressiveForS,//使 Millet 更激进
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
LockMaxFpsForAll, //锁定最高刷新率
|
|
||||||
PreventRecoveryOfBatteryOptimizationWhitelistForS, //防止恢复电池优化白名单
|
|
||||||
DoNotClearAppForS,//阻止杀后台
|
|
||||||
MakeMilletMoreAggressiveForS,//使 Millet 更激进
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.reardisplay.RearDisplayWeatherForAll
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object RearDisplay : AppRegister() {
|
|
||||||
override val packageName: String = "com.xiaomi.misubscreenui"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
RearDisplayWeatherForAll, //背屏显示天气
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
RearDisplayWeatherForAll, //背屏显示天气
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.screenshot.UnlockUnlimitedCroppingForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.t.mediaeditor.UnlockUnlimitedCroppingForT
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object ScreenShot : AppRegister() {
|
|
||||||
override val packageName: String = "com.miui.screenshot"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
UnlockUnlimitedCroppingForT, //解锁裁切限制
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
UnlockUnlimitedCroppingForS, //解锁裁切限制
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.securitycenter.LockOneHundredForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.securitycenter.RemoveMacroBlacklistForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.securitycenter.RemoveOpenAppConfirmationPopupForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.securitycenter.SkipWaitingTimeForAll
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.securitycenter.ShowBatteryTemperatureForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.t.securitycenter.ShowBatteryTemperatureForT
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object SecurityCenter : AppRegister() {
|
|
||||||
override val packageName: String = "com.miui.securitycenter"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
SkipWaitingTimeForAll, //跳过 5/10秒等待时间
|
|
||||||
LockOneHundredForAll, //锁定 100分
|
|
||||||
RemoveMacroBlacklistForAll, //去除自动连招黑名单
|
|
||||||
ShowBatteryTemperatureForT, //显示电池温度
|
|
||||||
RemoveOpenAppConfirmationPopupForAll, //去除打开应用弹窗
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
SkipWaitingTimeForAll, //跳过 5/10秒等待时间
|
|
||||||
LockOneHundredForAll, //锁定 100分
|
|
||||||
RemoveMacroBlacklistForAll, //去除自动连招黑名单
|
|
||||||
ShowBatteryTemperatureForS, //显示电池温度
|
|
||||||
RemoveOpenAppConfirmationPopupForAll, //去除打开应用弹窗
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.all.settings.ShowNotificationImportanceForAll
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object Settings : AppRegister() {
|
|
||||||
override val packageName: String = "com.android.settings"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
ShowNotificationImportanceForAll, //显示通知重要程度
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
ShowNotificationImportanceForAll, //显示通知重要程度
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hooks.apps
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.BatteryPercentageForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.CanNotificationSlideForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.ControlCenterWeatherForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.CustomMobileTypeTextForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.DoubleLineNetworkSpeedForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideBatteryIconForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideHDIconForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideMobileActivityIconForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideMobileTypeIconForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideNetworkSpeedSplitterForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideSimIconForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideStatusBarIconForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideStatusBarNetworkSpeedSecondForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.HideWifiActivityIconForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.LockScreenClockDisplaySecondsForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.LockScreenCurrentForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.LockScreenDoubleTapToSleepForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.MaximumNumberOfNotificationIconsForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.NewNotificationWeatherForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.NotificationWeatherForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.OldNotificationWeatherForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.OldQSCustomForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.RemoveLockScreenCameraForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.RemoveTheLeftSideOfTheLockScreenForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.ShowWifiStandardForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.StatusBarBigMobileTypeIconForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.StatusBarDoubleTapToSleepForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.StatusBarLayoutForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.StatusBarNetworkSpeedRefreshSpeedForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.StatusBarTimeCustomizationForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.WaveChargeForS
|
|
||||||
import com.lt2333.simplicitytools.hooks.rules.t.systemui.*
|
|
||||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object SystemUI : AppRegister() {
|
|
||||||
override val packageName: String = "com.android.systemui"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
when (Build.VERSION.SDK_INT) {
|
|
||||||
Build.VERSION_CODES.TIRAMISU -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
HideStatusBarIconForT, //隐藏状态栏图标
|
|
||||||
HideBatteryIconForT, //隐藏电池
|
|
||||||
HideHDIconForT, //隐藏HD图标
|
|
||||||
HideSimIconForT, //隐藏SIM卡图标
|
|
||||||
HideMobileActivityIconForT, //隐藏移动箭头图标
|
|
||||||
HideMobileTypeIconForT, //隐藏移动类型图标
|
|
||||||
HideStatusBarNetworkSpeedSecondForT, //隐藏状态栏网速/s
|
|
||||||
HideWifiActivityIconForT, //隐藏WIFI活动箭头图标
|
|
||||||
MaximumNumberOfNotificationIconsForT, //通知图标上限
|
|
||||||
StatusBarNetworkSpeedRefreshSpeedForT, //状态栏网速秒刷新
|
|
||||||
StatusBarTimeCustomizationForT, //状态栏时钟自定义
|
|
||||||
RemoveTheLeftSideOfTheLockScreenForT, //移除锁屏负一屏功能
|
|
||||||
RemoveLockScreenCameraForT, //移除锁屏相机功能
|
|
||||||
NotificationWeatherForT, //通知面板天气
|
|
||||||
NewNotificationWeatherForT, // 新控制中心天气
|
|
||||||
OldNotificationWeatherForT,
|
|
||||||
ControlCenterWeatherForT, //控制中心天气
|
|
||||||
StatusBarLayoutForT, //状态栏布局
|
|
||||||
HideNetworkSpeedSplitterForT, //隐藏时钟与实时网速之间的分隔符
|
|
||||||
WaveChargeForT, //Alpha充电动画
|
|
||||||
LockScreenCurrentForT, //锁屏电流
|
|
||||||
LockScreenDoubleTapToSleepForT, //锁屏下双击锁屏
|
|
||||||
StatusBarDoubleTapToSleepForT, //双击状态栏锁屏
|
|
||||||
OldQSCustomForT, //旧版快速设置自定义
|
|
||||||
DoubleLineNetworkSpeedForT, //双排网速
|
|
||||||
StatusBarBigMobileTypeIconForT, //大移动类型
|
|
||||||
BatteryPercentageForT, //电量百分比
|
|
||||||
CustomMobileTypeTextForT, //自定义移动类型文本
|
|
||||||
CanNotificationSlideForT, //允许下滑通知打开小窗
|
|
||||||
LockScreenClockDisplaySecondsForT, // 锁屏时钟显示秒
|
|
||||||
ShowWifiStandardForT, // 显示 WIFI 角标
|
|
||||||
DisableBluetoothTemporarilyOffForT, //禁用临时蓝牙关闭
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Build.VERSION_CODES.S -> {
|
|
||||||
autoInitHooks(
|
|
||||||
lpparam,
|
|
||||||
HideStatusBarIconForS, //隐藏状态栏图标
|
|
||||||
HideBatteryIconForS, //隐藏电池
|
|
||||||
HideHDIconForS, //隐藏HD图标
|
|
||||||
HideSimIconForS, //隐藏SIM卡图标
|
|
||||||
HideMobileActivityIconForS, //隐藏移动箭头图标
|
|
||||||
HideMobileTypeIconForS, //隐藏移动类型图标
|
|
||||||
HideStatusBarNetworkSpeedSecondForS, //隐藏状态栏网速/s
|
|
||||||
HideWifiActivityIconForS, //隐藏WIFI活动箭头图标
|
|
||||||
MaximumNumberOfNotificationIconsForS, //通知图标上限
|
|
||||||
StatusBarNetworkSpeedRefreshSpeedForS, //状态栏网速秒刷新
|
|
||||||
StatusBarTimeCustomizationForS, //状态栏时钟自定义
|
|
||||||
RemoveTheLeftSideOfTheLockScreenForS, //移除锁屏负一屏功能
|
|
||||||
RemoveLockScreenCameraForS, //移除锁屏相机功能
|
|
||||||
NotificationWeatherForS, //通知面板天气
|
|
||||||
NewNotificationWeatherForS, // 新控制中心天气
|
|
||||||
OldNotificationWeatherForS,
|
|
||||||
ControlCenterWeatherForS, //控制中心天气
|
|
||||||
StatusBarLayoutForS, //状态栏布局
|
|
||||||
HideNetworkSpeedSplitterForS, //隐藏时钟与实时网速之间的分隔符
|
|
||||||
WaveChargeForS, //Alpha充电动画
|
|
||||||
LockScreenCurrentForS, //锁屏电流
|
|
||||||
LockScreenDoubleTapToSleepForS, //锁屏下双击锁屏
|
|
||||||
StatusBarDoubleTapToSleepForS, //双击状态栏锁屏
|
|
||||||
OldQSCustomForS, //旧版快速设置自定义
|
|
||||||
DoubleLineNetworkSpeedForS, //双排网速
|
|
||||||
StatusBarBigMobileTypeIconForS, //大移动类型
|
|
||||||
BatteryPercentageForS, //电量百分比
|
|
||||||
CustomMobileTypeTextForS, //自定义移动类型文本
|
|
||||||
CanNotificationSlideForS, //允许下滑通知打开小窗
|
|
||||||
LockScreenClockDisplaySecondsForS, // 锁屏时钟显示秒
|
|
||||||
ShowWifiStandardForS, // 显示 WIFI 角标
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user