mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
Compare commits
253 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1401ddcc52 | ||
|
|
eb7779ea84 | ||
|
|
317340bf6f | ||
|
|
bc26ba512c | ||
|
|
cd28e662a1 | ||
|
|
f67d387020 | ||
|
|
f2354022aa | ||
|
|
d7a1af8846 | ||
|
|
8a1c8a85c3 | ||
|
|
12848808d3 | ||
|
|
7f23f07209 | ||
|
|
54b31ea478 | ||
|
|
44e6995da1 | ||
|
|
12e76869dd | ||
|
|
97212d74d3 | ||
|
|
e152a5ba74 | ||
|
|
efc77eb518 | ||
|
|
8cad8e371c | ||
|
|
990ea8ef7e | ||
|
|
4ce55d1fb3 | ||
|
|
1feb754385 | ||
|
|
a107f71986 | ||
|
|
2177850498 | ||
|
|
5e4160aed4 | ||
|
|
99da21e762 | ||
|
|
8fe9d09624 | ||
|
|
de220825a2 | ||
|
|
4ed3e40e99 | ||
|
|
5f5bc6572c | ||
|
|
b3859653ef | ||
|
|
7dcfdcced7 | ||
|
|
f2a4f06301 | ||
|
|
90294a1599 | ||
|
|
2b7e5e0833 | ||
|
|
4a5e83cfda | ||
|
|
b4bc91043e | ||
|
|
d07bd2aaf1 | ||
|
|
8bd401b88f | ||
|
|
2b36ad29d8 | ||
|
|
3e0d94ab81 | ||
|
|
7914d51168 | ||
|
|
d8cf1bdc34 | ||
|
|
2f69115907 | ||
|
|
4295af9cc5 | ||
|
|
179c82d563 | ||
|
|
6d1aa2e824 | ||
|
|
5c12c0aa56 | ||
|
|
e63b9a861d | ||
|
|
5b3ad4dd6a | ||
|
|
b781f59486 | ||
|
|
5a74882005 | ||
|
|
0c71f68362 | ||
|
|
f39d7d601d | ||
|
|
ebb5e1435b | ||
|
|
40c24cbb40 | ||
|
|
2830c8f48a | ||
|
|
2bc68e9724 | ||
|
|
56512abb33 | ||
|
|
cf10dc2e05 | ||
|
|
916522331d | ||
|
|
60f61649fb | ||
|
|
4bbfd4b7d2 | ||
|
|
6945b205c9 | ||
|
|
6693a23b21 | ||
|
|
dad4c50c79 | ||
|
|
50c4513229 | ||
|
|
49ec54c98a | ||
|
|
0058de24ac | ||
|
|
ff09f77b43 | ||
|
|
3abafe1cf9 | ||
|
|
6a70d0c20f | ||
|
|
efa375ba0c | ||
|
|
bc04edade1 | ||
|
|
55519f096b | ||
|
|
87a8059a06 | ||
|
|
8e85c34db3 | ||
|
|
72ad0479df | ||
|
|
479251fb67 | ||
|
|
dec3bc0a42 | ||
|
|
32f2fc7215 | ||
|
|
4246e2910e | ||
|
|
3cd3b87707 | ||
|
|
693b707922 | ||
|
|
90466bb3fb | ||
|
|
cef006ced2 | ||
|
|
2a94e1da69 | ||
|
|
94beae5f45 | ||
|
|
a63fd5510a | ||
|
|
24b0fbbd48 | ||
|
|
d38b79aec2 | ||
|
|
8f1453f420 | ||
|
|
b1373d7141 | ||
|
|
7e922f3ec6 | ||
|
|
8d45df61e3 | ||
|
|
57895c7f2c | ||
|
|
1af01b391b | ||
|
|
6108f9c4ba | ||
|
|
d709dd87e9 | ||
|
|
c0ae491954 | ||
|
|
a9c8528671 | ||
|
|
2761c288f8 | ||
|
|
a9cf0bcca0 | ||
|
|
9f92186e5f | ||
|
|
5197f11ecb | ||
|
|
396e9bf453 | ||
|
|
8e6485cd0f | ||
|
|
afb3316595 | ||
|
|
432ec13c05 | ||
|
|
f2f133c5b9 | ||
|
|
320a393a7c | ||
|
|
117c18b45e | ||
|
|
1ad1b75eff | ||
|
|
201d9550d2 | ||
|
|
1f0f2d31f2 | ||
|
|
0d34d3a4bb | ||
|
|
93f6eaf74d | ||
|
|
61b6dc448e | ||
|
|
cad773ec99 | ||
|
|
bfda4f0df3 | ||
|
|
e32718eedf | ||
|
|
b2e465ba3d | ||
|
|
919694fce7 | ||
|
|
f5ff3e78c4 | ||
|
|
3619fbf4d3 | ||
|
|
7acd0aaff8 | ||
|
|
785208c1ab | ||
|
|
d108f46a19 | ||
|
|
a44a29b7b7 | ||
|
|
29e9bb34ab | ||
|
|
1a15df5822 | ||
|
|
dad17170ff | ||
|
|
3aca588693 | ||
|
|
cd731f7a21 | ||
|
|
5e35cfb3e3 | ||
|
|
daa3c02d1a | ||
|
|
f83d439374 | ||
|
|
176682fa38 | ||
|
|
c02d9e1874 | ||
|
|
d8baadae59 | ||
|
|
d2035121ce | ||
|
|
b29bfb45f9 | ||
|
|
657c65164f | ||
|
|
5c3ca4caa4 | ||
|
|
08b4abf08c | ||
|
|
acdbd23248 | ||
|
|
2bed96532f | ||
|
|
314fc7b46f | ||
|
|
ff94fce5d0 | ||
|
|
d56d291e51 | ||
|
|
fc1800932b | ||
|
|
181869687e | ||
|
|
5ee5dd71b1 | ||
|
|
b6d8529624 | ||
|
|
243bc39dd6 | ||
|
|
4332ac6ed8 | ||
|
|
8309c9a69a | ||
|
|
62561d4c34 | ||
|
|
4c13ad4152 | ||
|
|
6f91cab9b8 | ||
|
|
ca2ffa4c3f | ||
|
|
f44f095c65 | ||
|
|
68c67d139b | ||
|
|
2b1eaf6634 | ||
|
|
c91a46cabb | ||
|
|
a7947d5a2f | ||
|
|
bb8150583c | ||
|
|
a4fe68c141 | ||
|
|
61f64ba7bb | ||
|
|
bfff5cc446 | ||
|
|
509fef5e06 | ||
|
|
f88ff6db15 | ||
|
|
2b352738f5 | ||
|
|
085b375dc6 | ||
|
|
7c13214e2d | ||
|
|
469f004baa | ||
|
|
eec755d642 | ||
|
|
14ca833ec1 | ||
|
|
8bcb89b04d | ||
|
|
f2df033393 | ||
|
|
ab41dea173 | ||
|
|
7d9f45b92f | ||
|
|
8c08466ed6 | ||
|
|
801ade5859 | ||
|
|
984b909197 | ||
|
|
0a6b114354 | ||
|
|
f6653aef78 | ||
|
|
1f7dbba6a8 | ||
|
|
87a2f04b65 | ||
|
|
25dba39daf | ||
|
|
7ad1bcb763 | ||
|
|
1aee169089 | ||
|
|
8eb42fdf38 | ||
|
|
fddf3ffb76 | ||
|
|
6e4e8ed97b | ||
|
|
e5e64821a8 | ||
|
|
8ab8330c94 | ||
|
|
7c8f061c30 | ||
|
|
406b1a740b | ||
|
|
54e3b0ab29 | ||
|
|
5fcb39bb58 | ||
|
|
bc9469a9b6 | ||
|
|
61b24111f1 | ||
|
|
a87bf7318b | ||
|
|
9bd6aee5e9 | ||
|
|
dfa47653f0 | ||
|
|
92b345af77 | ||
|
|
dfd1c660f5 | ||
|
|
d431798808 | ||
|
|
ff95c6d782 | ||
|
|
2f23263333 | ||
|
|
788e46cb39 | ||
|
|
fcfd29a86b | ||
|
|
3d4720fc42 | ||
|
|
2f26cedb2b | ||
|
|
6f30dcdac5 | ||
|
|
8488332cec | ||
|
|
157e087c99 | ||
|
|
ffdf296357 | ||
|
|
987f33b584 | ||
|
|
7cc2819307 | ||
|
|
a6df8ff014 | ||
|
|
8c13c702e9 | ||
|
|
fcf57c3796 | ||
|
|
830397a590 | ||
|
|
3fd32b4ec8 | ||
|
|
7a5c39620b | ||
|
|
05493d35d4 | ||
|
|
2f1930f704 | ||
|
|
1e6eb58dab | ||
|
|
11908a7381 | ||
|
|
117acc99f7 | ||
|
|
e3909c5996 | ||
|
|
da80efc8ba | ||
|
|
fabbd19929 | ||
|
|
e608c504fe | ||
|
|
b483ce52c8 | ||
|
|
2421b5d285 | ||
|
|
63e360cc62 | ||
|
|
d4d6605c7b | ||
|
|
dc7e45e4ad | ||
|
|
df72a5f363 | ||
|
|
cd0aaef385 | ||
|
|
b71fa8a15e | ||
|
|
323cb2bffa | ||
|
|
029ad43508 | ||
|
|
8c6deb16cf | ||
|
|
93bdeaba0b | ||
|
|
d2ff9d61e7 | ||
|
|
780db8dfa5 | ||
|
|
dcc26b0e43 | ||
|
|
eaaa802054 | ||
|
|
99f47443eb | ||
|
|
0433cbe5ab |
50
.github/workflows/dev.yml
vendored
Normal file
50
.github/workflows/dev.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
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 }}
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Android CI
|
||||
name: PR Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -13,10 +13,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: set up JDK 11
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
- name: set up JDK 17
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '11'
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
- uses: actions/cache@v2
|
||||
@@ -32,24 +34,9 @@ jobs:
|
||||
path: |
|
||||
~/.gradle/caches/build-cache-*
|
||||
key: gradle-builds-${{ github.sha }}
|
||||
|
||||
- name: Init Submodule
|
||||
run: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
- name: Build with Gradle
|
||||
run: bash ./gradlew assemble
|
||||
|
||||
- name: Upload Release APK
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: SimplicityTools_Release
|
||||
path: "app/build/outputs/apk/release/*.apk"
|
||||
|
||||
- name: Upload Debug APK
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Simplicity Tools_Debug
|
||||
path: "app/build/outputs/apk/debug/*.apk"
|
||||
|
||||
run: bash ./gradlew :app:packageDebug
|
||||
120
README.md
120
README.md
@@ -1,139 +1,67 @@
|
||||
<div align="center">
|
||||
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
|
||||
<h1>Simplicity Tools</h1>
|
||||
<p>
|
||||
<b><a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README_EN.md">English</a> 丨 简体中文</b>
|
||||
</p>
|
||||
<h1>WooBox For MIUI</h1>
|
||||
<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/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/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>
|
||||
|
||||
---
|
||||
|
||||
### 模块说明
|
||||
|
||||
仅支持MIUI13(Android12)。其余版本可能无效,请不要安装使用。
|
||||
目前处于开发初期阶段,功能较少,后续将逐步完善。
|
||||
|
||||
开发者:[酷安@乌堆小透明](http://www.coolapk.com/u/883441)
|
||||
|
||||
---
|
||||
|
||||
### 已实现功能
|
||||
<details>
|
||||
<summary>点击展开详情</summary>
|
||||
|
||||
- 状态栏
|
||||
- 状态栏网速秒刷新
|
||||
- 隐藏状态栏电量(%)
|
||||
- 隐藏状态栏网速(/s)单位
|
||||
- 解除通知图标个数上限
|
||||
- 状态栏布局
|
||||
- 时间居中
|
||||
- 兼容模式
|
||||
- 左边距自定义
|
||||
- 右边距自定义
|
||||
- 状态栏时钟格式
|
||||
- 显示年份开关
|
||||
- 显示月份开关
|
||||
- 显示日期开关
|
||||
- 显示星期开关
|
||||
- 显示时辰开关
|
||||
- 显示时段开关
|
||||
- 显示秒数开关
|
||||
- 隐藏间隔开关
|
||||
- 双行显示开关
|
||||
- 时钟大小自定义
|
||||
- 双排时钟大小自定义
|
||||
- 状态栏图标
|
||||
- 隐藏电池图标开关
|
||||
- 隐藏充电图标开关
|
||||
- 隐藏GPS图标开关
|
||||
- 隐藏蓝牙图标开关
|
||||
- 隐藏蓝牙电量图标开关
|
||||
- 隐藏小HD图标开关
|
||||
- 隐藏大HD图标开关
|
||||
- 隐藏HD无服务开关
|
||||
- 隐藏SIM卡一图标开关
|
||||
- 隐藏SIM卡二图标开关
|
||||
- 隐藏无SIM卡图标开关
|
||||
- 隐藏移动类型图标开关
|
||||
- 隐藏移动箭头图标开关
|
||||
- 隐藏WIFI图标开关
|
||||
- 隐藏WIFI箭头开关
|
||||
- 隐藏WIFI标准开关
|
||||
- 隐藏WiFi辅助图标开关
|
||||
- 隐藏WIFI热点图标开关
|
||||
- 隐藏VPN图标开关
|
||||
- 隐藏飞行模式图标开关
|
||||
- 隐藏闹钟图标开关
|
||||
- 隐藏耳机图标开关
|
||||
- 隐藏声音、勿扰图标开关
|
||||
- 隐藏网速分隔符
|
||||
- 通知面板
|
||||
- 显示天气开关
|
||||
- 显示天气地区开关
|
||||
- 控制中心
|
||||
- 显示天气开关
|
||||
- 显示天气地区开关
|
||||
- 锁屏
|
||||
- 移除锁屏侧边功能
|
||||
- 移除锁屏相机功能
|
||||
- 桌面
|
||||
- 始终显示桌面时钟
|
||||
- 系统框架
|
||||
- 移除上层显示通知
|
||||
- 允许截图(支持磁贴)
|
||||
- 解除安装限制(支持降级、不同签名、无签名安装)
|
||||
- 解除不支持小窗应用限制
|
||||
- 性能
|
||||
- 锁定当前刷新率上限(支持磁贴)
|
||||
- 防止恢复电池优化白名单
|
||||
- 手机管家
|
||||
- 跳过5/10秒警告时间
|
||||
- 锁定 100 分
|
||||
- 去除游戏自动连招黑名单
|
||||
- 相册编辑
|
||||
- 解锁无限裁切图片/截图功能
|
||||
- 系统更新
|
||||
- 移除OTA验证
|
||||
- 设置
|
||||
- 显示通知重要程度
|
||||
- 去广告
|
||||
- 移除主题壁纸广告
|
||||
|
||||
</details>
|
||||
当前仅基于`Android13`进行开发,`Android12`几乎不再维护。也有基于`Android13`开发,但是能在`Android12`使用的情况,请广大社区使用`Android12`的开发者自行测试和修复后提交`Pull Request`。
|
||||
|
||||
---
|
||||
|
||||
### 模块截图
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
### 下载地址
|
||||
|
||||
Xposed仓库下载:[点击此处下载最新发行版](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases)
|
||||
Xposed
|
||||
仓库下载:[点击此处下载最新发行版](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases)
|
||||
|
||||
酷安下载:[点击此处下载最新发行版](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
|
||||
|
||||
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
|
||||
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
|
||||
[MonwF/customiuizer](https://github.com/MonwF/customiuizer)
|
||||
|
||||
##### GNU General Public License v2.0
|
||||
|
||||
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
|
||||
|
||||
##### GNU Lesser General Public License v2.1
|
||||
|
||||
[577fkj/blockmiui](https://github.com/577fkj/blockmiui)
|
||||
|
||||
##### Apache License 2.0
|
||||
|
||||
[KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper)
|
||||
|
||||
---
|
||||
|
||||
### License
|
||||
|
||||
[GNU General Public License v3.0](https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE)
|
||||
|
||||
122
README_EN.md
122
README_EN.md
@@ -1,113 +1,24 @@
|
||||
<div align="center">
|
||||
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
|
||||
<h1>Simplicity Tools</h1>
|
||||
<p>
|
||||
<b>English 丨 <a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README.md">简体中文</a></b>
|
||||
</p>
|
||||
<h1>WooBox For MIUI</h1>
|
||||
<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/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/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>
|
||||
|
||||
---
|
||||
|
||||
### Description
|
||||
### Module Description
|
||||
|
||||
Only MIUI13 (Android12) is supported. The rest of the versions may not be valid, please do not install and use.
|
||||
It is in the early stage of development, with fewer functions, and will be improved gradually.
|
||||
|
||||
---
|
||||
|
||||
### Features
|
||||
<details>
|
||||
<summary>Click to expand details</summary>
|
||||
|
||||
- Status Bar
|
||||
- Status bar web speed second refresh
|
||||
- Hide status bar power (%)
|
||||
- Hide status bar speed (/) unit
|
||||
- Unlock the maximum number of notification icons
|
||||
- Status bar layout
|
||||
- Time centered
|
||||
- Compatible mode
|
||||
- Left margin customization
|
||||
- Right margin customization
|
||||
- Status bar clock format
|
||||
- Show year switch
|
||||
- Show month switch
|
||||
- Show date switch
|
||||
- Show day switch
|
||||
- Show chinese twelve hour switch
|
||||
- Display AM/PM switch
|
||||
- Display seconds switch
|
||||
- Hide space switch
|
||||
- Double line display switch
|
||||
- Clock size customization
|
||||
- Double row clock size customization
|
||||
- Status bar icons
|
||||
- Hide battery icon switch
|
||||
- Hide charging icon switch
|
||||
- Hide GPS icon switch
|
||||
- Hide Bluetooth icon switch
|
||||
- Hide Bluetooth power icon switch
|
||||
- Hide small HD icon switch
|
||||
- Hide large HD icon switch
|
||||
- Hide HD no service switch
|
||||
- Hide SIM card one icon switch
|
||||
- Hide SIM card two icon switch
|
||||
- Hide SIM-less icon switch
|
||||
- Hide mobile type icon switch
|
||||
- Hide mobile arrow icon switch
|
||||
- Hide WIFI icon switch
|
||||
- Hide WIFI arrow switch
|
||||
- Hide WIFI standard switch
|
||||
- Hide WiFi auxiliary icon switch
|
||||
- Hide WIFI hotspot icon switch
|
||||
- Hide VPN icon switch
|
||||
- Hide Airplane Mode icon switch
|
||||
- Hide alarm clock icon switch
|
||||
- Hide headset icon switch
|
||||
- Hide sound, do not disturb icon switch
|
||||
- Hide internet speed separator
|
||||
- Notification panel
|
||||
- Show weather switch
|
||||
- Show weather area switch
|
||||
- Control Center
|
||||
- Show weather switch
|
||||
- Show weather area switch
|
||||
- Lock Screen
|
||||
- Remove lock screen side function
|
||||
- Remove lock screen camera function
|
||||
- Home
|
||||
- Always show desktop clock
|
||||
- System Framework
|
||||
- Remove upper display notifications
|
||||
- Allow screenshots (tile support)
|
||||
- CorePatch (support downgrade, different signature, unsigned installation)
|
||||
- Unlock unsupported small windows applications
|
||||
- Nature
|
||||
- Lock current refresh rate cap (tile support)
|
||||
- Prevent recovery of battery optimization whitelist
|
||||
- Phone Manager
|
||||
- Skip 5/10 seconds warning time
|
||||
- Lock 100 points
|
||||
- Remove game macro blacklist
|
||||
- Album editing
|
||||
- Unlock unlimited crop image/screenshot function
|
||||
- System Update
|
||||
- Remove OTA authentication
|
||||
- Settings
|
||||
- Show notification importance
|
||||
- Remove Ads
|
||||
- Remove theme manager ads
|
||||
|
||||
</details>
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
### Screenshot
|
||||
|
||||

|
||||
|
||||
---
|
||||
@@ -116,21 +27,36 @@ It is in the early stage of development, with fewer functions, and will be impro
|
||||
|
||||
Xposed Repo:[Click here to download the latest release](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases)
|
||||
|
||||
|
||||
---
|
||||
|
||||
### 改进翻译
|
||||
[](https://crowdin.com/project/simplicitytools)[Click here to Crowdin](https://crowdin.com/project/simplicitytools)
|
||||
### Participate in translation
|
||||
|
||||
[](https://crowdin.com/project/simplicitytools) [Click here to Crowdin](https://crowdin.com/project/simplicitytools)
|
||||
|
||||
---
|
||||
|
||||
## Third party open source references
|
||||
|
||||
##### GNU General Public License v3.0
|
||||
|
||||
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
|
||||
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
|
||||
[MonwF/customiuizer](https://github.com/MonwF/customiuizer)
|
||||
|
||||
##### GNU General Public License v2.0
|
||||
|
||||
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
|
||||
|
||||
##### GNU Lesser General Public License v2.1
|
||||
|
||||
[577fkj/blockmiui](https://github.com/577fkj/blockmiui)
|
||||
|
||||
##### Apache License 2.0
|
||||
|
||||
[KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper)
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
[GNU General Public License v3.0](https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE)
|
||||
|
||||
@@ -6,22 +6,21 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 32
|
||||
buildToolsVersion = "32.0.0"
|
||||
compileSdk = 33
|
||||
defaultConfig {
|
||||
applicationId = "com.lt2333.simplicitytools"
|
||||
minSdk = 31
|
||||
targetSdk = 32
|
||||
versionCode = 42
|
||||
versionName = "1.4.1"
|
||||
targetSdk = 33
|
||||
versionCode = 75
|
||||
versionName = "1.7.5"
|
||||
buildConfigField("String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
setProguardFiles(listOf("proguard-rules.pro")
|
||||
)
|
||||
setProguardFiles(listOf("proguard-rules.pro"))
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
@@ -44,23 +43,20 @@ android {
|
||||
}
|
||||
applicationVariants.all {
|
||||
outputs.all {
|
||||
(this as BaseVariantOutputImpl).outputFileName =
|
||||
"Simplicity_Tools_Xposed-$versionName-$name.apk"
|
||||
(this as BaseVariantOutputImpl).outputFileName = "WooBoxForMIUI-$versionName-$name.apk"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
|
||||
//API
|
||||
compileOnly("de.robv.android.xposed:api:82")
|
||||
implementation("com.github.kyuubiran:EzXHelper:1.0.3")
|
||||
//UI
|
||||
implementation(project(":blockmiui"))
|
||||
|
||||
val appCenterSdkVersion = "4.3.1"
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||
//APP Center
|
||||
val appCenterSdkVersion = "4.4.3"
|
||||
implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}")
|
||||
implementation("com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}")
|
||||
|
||||
implementation("com.github.kyuubiran:EzXHelper:0.7.4")
|
||||
|
||||
}
|
||||
6
app/proguard-rules.pro
vendored
6
app/proguard-rules.pro
vendored
@@ -23,6 +23,12 @@
|
||||
public void *(de.robv.android.xposed.callbacks.XC_LoadPackage$LoadPackageParam);
|
||||
}
|
||||
|
||||
-keep class * implements de.robv.android.xposed.IXposedHookZygoteInit {
|
||||
public void *(de.robv.android.xposed.IXposedHookZygoteInit$StartupParam);
|
||||
}
|
||||
|
||||
-keep class * extends com.lt2333.simplicitytools.utils.xposed.EasyXposedInit
|
||||
|
||||
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
|
||||
public static void check*(...);
|
||||
public static void throw*(...);
|
||||
|
||||
@@ -11,20 +11,23 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name=".activity.SettingsActivity"
|
||||
android:name=".activity.MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity-alias
|
||||
android:label="WooBox"
|
||||
android:name=".launcher"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:targetActivity=".activity.SettingsActivity">
|
||||
android:targetActivity=".activity.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@@ -45,7 +48,7 @@
|
||||
android:resource="@array/xposed_scope" />
|
||||
|
||||
<service
|
||||
android:name=".tile.LockMaxFpsTile"
|
||||
android:name=".tiles.LockMaxFpsTile"
|
||||
android:exported="true"
|
||||
android:icon="@drawable/ic_fps"
|
||||
android:label="@string/lock_max"
|
||||
@@ -56,7 +59,7 @@
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".tile.AllowScreenshots"
|
||||
android:name=".tiles.AllowScreenshots"
|
||||
android:exported="true"
|
||||
android:icon="@drawable/ic_baseline_fullscreen_24"
|
||||
android:label="@string/allow_screenshots"
|
||||
|
||||
@@ -1 +1 @@
|
||||
com.lt2333.simplicitytools.hook.MainHook
|
||||
com.lt2333.simplicitytools.hooks.MainHook
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 45 KiB |
@@ -0,0 +1,78 @@
|
||||
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
@@ -0,0 +1,200 @@
|
||||
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()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
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()
|
||||
}))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
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)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
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"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
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") })
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
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")
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,740 @@
|
||||
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)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
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)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
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"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
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") })
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
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")
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,680 @@
|
||||
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,38 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.init.EzXHelperInit
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.hook.app.*
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XSharedPreferences
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
class MainHook : IXposedHookLoadPackage {
|
||||
private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
if (prefs.getBoolean("main_switch", true)) {
|
||||
EzXHelperInit.initHandleLoadPackage(lpparam)
|
||||
EzXHelperInit.setEzClassLoader(lpparam.classLoader)
|
||||
when (lpparam.packageName) {
|
||||
//Android
|
||||
"android" -> Android().handleLoadPackage(lpparam)
|
||||
//系统界面
|
||||
"com.android.systemui" -> SystemUI().handleLoadPackage(lpparam)
|
||||
//电量与性能
|
||||
"com.miui.powerkeeper" -> PowerKeeper().handleLoadPackage(lpparam)
|
||||
//桌面
|
||||
"com.miui.home" -> MiuiHome().handleLoadPackage(lpparam)
|
||||
//手机管家
|
||||
"com.miui.securitycenter" -> SecurityCenter().handleLoadPackage(lpparam)
|
||||
//相册编辑
|
||||
"com.miui.mediaeditor" -> MediaEditor().handleLoadPackage(lpparam)
|
||||
//系统更新
|
||||
"com.android.updater" -> Updater().handleLoadPackage(lpparam)
|
||||
//设置
|
||||
"com.android.settings" -> Settings().handleLoadPackage(lpparam)
|
||||
//主题壁纸
|
||||
"com.android.thememanager" -> ThemeManager().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.android.DeleteOnPostNotification
|
||||
import com.lt2333.simplicitytools.hook.app.android.DisableFlagSecure
|
||||
import com.lt2333.simplicitytools.hook.app.android.MaxWallpaperScale
|
||||
import com.lt2333.simplicitytools.hook.app.android.RemoveSmallWindowRestrictions
|
||||
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatch
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class Android : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
//核心破解
|
||||
CorePatch().handleLoadPackage(lpparam)
|
||||
//允许截图
|
||||
DisableFlagSecure().handleLoadPackage(lpparam)
|
||||
//上层显示
|
||||
DeleteOnPostNotification().handleLoadPackage(lpparam)
|
||||
//解除小窗限制
|
||||
RemoveSmallWindowRestrictions().handleLoadPackage(lpparam)
|
||||
//壁纸缩放比例
|
||||
MaxWallpaperScale().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.mediaeditor.UnlockUnlimitedCropping
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
class MediaEditor : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
//解锁裁切最小值
|
||||
UnlockUnlimitedCropping().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.miuihome.AlwaysDisplayTime
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
class MiuiHome : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
//时钟显示时钟
|
||||
AlwaysDisplayTime().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.powerkeeper.LockMaxFps
|
||||
import com.lt2333.simplicitytools.hook.app.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelist
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
class PowerKeeper : IXposedHookLoadPackage {
|
||||
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
//锁定最高刷新率
|
||||
LockMaxFps().handleLoadPackage(lpparam)
|
||||
//防止恢复电池优化白名单
|
||||
PreventRecoveryOfBatteryOptimizationWhitelist().handleLoadPackage(lpparam)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.securitycenter.LockOneHundred
|
||||
import com.lt2333.simplicitytools.hook.app.securitycenter.RemoveMacroBlacklist
|
||||
import com.lt2333.simplicitytools.hook.app.securitycenter.ShowBatteryTemperature
|
||||
import com.lt2333.simplicitytools.hook.app.securitycenter.SkipWaitingTime
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
class SecurityCenter : IXposedHookLoadPackage {
|
||||
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
//跳过 5/10秒等待时间
|
||||
SkipWaitingTime().handleLoadPackage(lpparam)
|
||||
//锁定 100分
|
||||
LockOneHundred().handleLoadPackage(lpparam)
|
||||
//去除自动连招黑名单
|
||||
RemoveMacroBlacklist().handleLoadPackage(lpparam)
|
||||
//显示电池温度
|
||||
ShowBatteryTemperature().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.settings.ShowNotificationImportance
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class Settings: IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
ShowNotificationImportance().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.systemui.*
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
class SystemUI : IXposedHookLoadPackage {
|
||||
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
//隐藏飞行模式图标
|
||||
HideAirplaneIcon().handleLoadPackage(lpparam)
|
||||
//隐藏闹钟图标
|
||||
HideAlarmIcon().handleLoadPackage(lpparam)
|
||||
//隐藏电池
|
||||
HideBatteryIcon().handleLoadPackage(lpparam)
|
||||
//隐藏蓝牙电量
|
||||
HideBluetoothHandsfreeBatteryIcon().handleLoadPackage(lpparam)
|
||||
//隐藏蓝牙图标
|
||||
HideBluetoothIcon().handleLoadPackage(lpparam)
|
||||
//隐藏GPS图标
|
||||
HideGPSIcon().handleLoadPackage(lpparam)
|
||||
//隐藏HD图标
|
||||
HideHDIcon().handleLoadPackage(lpparam)
|
||||
//隐藏耳机图标
|
||||
HideHeadsetIcon().handleLoadPackage(lpparam)
|
||||
//隐藏热点图标
|
||||
HideHotspotIcon().handleLoadPackage(lpparam)
|
||||
//隐藏无SIM卡图标
|
||||
HideNoSimIcon().handleLoadPackage(lpparam)
|
||||
//隐藏SIM卡图标
|
||||
HideSimIcon().handleLoadPackage(lpparam)
|
||||
//隐藏移动箭头图标
|
||||
HideMobileActivityIcon().handleLoadPackage(lpparam)
|
||||
//隐藏移动类型图标
|
||||
HideMobileTypeIcon().handleLoadPackage(lpparam)
|
||||
//隐藏辅助WIFI图标
|
||||
HideSlaveWifiIcon().handleLoadPackage(lpparam)
|
||||
//隐藏状态栏网速/s
|
||||
HideStatusBarNetworkSpeedSecond().handleLoadPackage(lpparam)
|
||||
//隐藏音量勿扰图标
|
||||
HideVolumeZenIcon().handleLoadPackage(lpparam)
|
||||
//隐藏VPN图标
|
||||
HideVpnIcon().handleLoadPackage(lpparam)
|
||||
//隐藏WIFI图标
|
||||
HideWifiIcon().handleLoadPackage(lpparam)
|
||||
//隐藏WIFI活动箭头图标
|
||||
HideWifiActivityIcon().handleLoadPackage(lpparam)
|
||||
//移除通知图标上限
|
||||
RemoveTheMaximumNumberOfNotificationIcons().handleLoadPackage(lpparam)
|
||||
//状态栏网速秒刷新
|
||||
StatusBarNetworkSpeedRefreshSpeed().handleLoadPackage(lpparam)
|
||||
//状态栏时钟自定义
|
||||
StatusBarTimeCustomization().handleLoadPackage(lpparam)
|
||||
//移除锁屏负一屏功能
|
||||
RemoveTheLeftSideOfTheLockScreen().handleLoadPackage(lpparam)
|
||||
//移除锁屏相机功能
|
||||
RemoveLockScreenCamera().handleLoadPackage(lpparam)
|
||||
//通知面板天气
|
||||
NotificationWeather().handleLoadPackage(lpparam)
|
||||
OldNotificationWeather().handleLoadPackage(lpparam)
|
||||
//控制中心天气
|
||||
ControlCenterWeather().handleLoadPackage(lpparam)
|
||||
//TODO:状态栏电流
|
||||
//StatusBarCurrent().handleLoadPackage(lpparam)
|
||||
//状态栏布局
|
||||
StatusBarLayout().handleLoadPackage(lpparam)
|
||||
//隐藏时钟与实时网速之间的分隔符
|
||||
HideNetworkSpeedSplitter().handleLoadPackage(lpparam)
|
||||
//Alpha充电动画
|
||||
WaveCharge().handleLoadPackage(lpparam)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.thememanager.RemoveAds
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
class ThemeManager : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
//移除主题壁纸的广告
|
||||
RemoveAds().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class Updater : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (XSPUtils.getBoolean("remove_ota_validate", false)) {
|
||||
var letter = 'a'
|
||||
for (i in 0..25) {
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.android.updater.common.utils.$letter", lpparam.classLoader
|
||||
) ?: continue
|
||||
if (classIfExists.declaredFields.size >= 9 && classIfExists.declaredMethods.size > 60) {
|
||||
classIfExists.hookBeforeMethod("T") {
|
||||
it.result = false
|
||||
}
|
||||
return
|
||||
}
|
||||
letter++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class DeleteOnPostNotification : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.server.wm.AlertWindowNotification".hookBeforeMethod(lpparam.classLoader, "onPostNotification") {
|
||||
hasEnable("delete_on_post_notification") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class DisableFlagSecure : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.server.wm.WindowState".hookBeforeMethod(lpparam.classLoader, "isSecureLocked") {
|
||||
hasEnable("disable_flag_secure") {
|
||||
it.result = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
|
||||
import android.app.Service
|
||||
import android.icu.text.DisplayContext
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import com.lt2333.simplicitytools.util.setFloatField
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class MaxWallpaperScale : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.server.wm.WallpaperController".hookAfterMethod(lpparam.classLoader, "WallpaperController", Service::class.java, DisplayContext::class.java
|
||||
) {
|
||||
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
|
||||
it.thisObject.setFloatField("mMaxWallpaperScale", value)
|
||||
}
|
||||
"com.android.server.wm.WallpaperController".hookBeforeMethod(lpparam.classLoader, "zoomOutToScale", Float::class.java) {
|
||||
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
|
||||
it.thisObject.setFloatField("mMaxWallpaperScale", value)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
|
||||
import android.content.Context
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class RemoveSmallWindowRestrictions : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
|
||||
// 强制所有活动设为可以调整大小
|
||||
"com.android.server.wm.Task".hookBeforeMethod(lpparam.classLoader, "isResizeable") {
|
||||
hasEnable("remove_small_window_restrictions") {
|
||||
it.result = true
|
||||
}
|
||||
}
|
||||
|
||||
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(lpparam.classLoader, "getFreeformBlackList") {
|
||||
hasEnable("remove_small_window_restrictions") {
|
||||
it.result = (it.result as MutableList<*>).apply { clear() }
|
||||
}
|
||||
}
|
||||
|
||||
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(lpparam.classLoader, "getFreeformBlackListFromCloud", Context::class.java) {
|
||||
hasEnable("remove_small_window_restrictions") {
|
||||
it.result = (it.result as MutableList<*>).apply { clear() }
|
||||
}
|
||||
}
|
||||
|
||||
"android.util.MiuiMultiWindowUtils".hookAfterMethod(lpparam.classLoader, "supportFreeform") {
|
||||
hasEnable("remove_small_window_restrictions") {
|
||||
it.result = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.mediaeditor
|
||||
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class UnlockUnlimitedCropping :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
//解锁图库裁切最小值
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector",
|
||||
lpparam.classLoader
|
||||
)
|
||||
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",
|
||||
lpparam.classLoader
|
||||
)
|
||||
|
||||
XposedHelpers.findAndHookMethod(
|
||||
classIfExists2,
|
||||
"calculateMinSize",
|
||||
object : XC_MethodHook() {
|
||||
override fun beforeHookedMethod(param: MethodHookParam) {
|
||||
if (XSPUtils.getBoolean("unlock_unlimited_cropping",false)) {
|
||||
param.result = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.miuihome
|
||||
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class AlwaysDisplayTime : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.home.launcher.Workspace",
|
||||
lpparam.classLoader
|
||||
)
|
||||
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,28 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class LockMaxFps : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.powerkeeper.statemachine.DisplayFrameSetting",
|
||||
lpparam.classLoader
|
||||
)
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class PreventRecoveryOfBatteryOptimizationWhitelist : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.powerkeeper.statemachine.ForceDozeController",
|
||||
lpparam.classLoader
|
||||
)
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||
|
||||
import android.view.View
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class LockOneHundred : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
|
||||
//防止点击重新检测
|
||||
val mainContentFrameClass = "com.miui.securityscan.ui.main.MainContentFrame".findClass(lpparam.classLoader)
|
||||
mainContentFrameClass.hookBeforeMethod("onClick", View::class.java) {
|
||||
if (XSPUtils.getBoolean("lock_one_hundred", false)) {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
|
||||
//锁定100分
|
||||
var scoreManagerClass = "com.miui.securityscan.scanner.ScoreManager".findClass(lpparam.classLoader)
|
||||
scoreManagerClass.hookBeforeMethod("B") {
|
||||
if (XSPUtils.getBoolean("lock_one_hundred", false)) {
|
||||
it.result = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class RemoveMacroBlacklist : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
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", lpparam.classLoader
|
||||
) ?: 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,68 +0,0 @@
|
||||
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.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
import java.lang.reflect.Field
|
||||
|
||||
class ShowBatteryTemperature: IXposedHookLoadPackage {
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (!XSPUtils.getBoolean("battery_life_function", false)) return
|
||||
val a = "com.miui.powercenter.a\$a".findClass(lpparam.classLoader)
|
||||
"com.miui.powercenter.a".hookBeforeMethod(lpparam.classLoader, "b", Context::class.java) {
|
||||
it.result = getBatteryTemperature(it.args[0] as Context).toString()
|
||||
}
|
||||
a.hookAfterMethod("run") {
|
||||
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 = 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)
|
||||
}
|
||||
}
|
||||
private fun getBatteryTemperature(context: Context): Int {
|
||||
return context.registerReceiver(
|
||||
null as BroadcastReceiver?,
|
||||
IntentFilter("android.intent.action.BATTERY_CHANGED")
|
||||
)!!.getIntExtra("temperature", 0) / 10
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class SkipWaitingTime : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
|
||||
val textViewClass = "android.widget.TextView".findClass(lpparam.classLoader)
|
||||
textViewClass.hookBeforeMethod(
|
||||
"setText",
|
||||
CharSequence::class.java,
|
||||
TextView.BufferType::class.java,
|
||||
Boolean::class.java,
|
||||
Int::class.java
|
||||
) {
|
||||
if (XSPUtils.getBoolean("skip_waiting_time", false)) {
|
||||
if (it.args.isNotEmpty() && it.args[0]?.toString()?.startsWith("确定(") == true
|
||||
) {
|
||||
it.args[0] = "确定"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
textViewClass.hookBeforeMethod(
|
||||
"setEnabled",
|
||||
Boolean::class.java
|
||||
) {
|
||||
if (XSPUtils.getBoolean("skip_waiting_time", false)) {
|
||||
it.args[0] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.settings
|
||||
|
||||
import android.app.NotificationChannel
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class ShowNotificationImportance : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val channelNotificationSettingsClass = "com.android.settings.notification.ChannelNotificationSettings".findClass(lpparam.classLoader)
|
||||
channelNotificationSettingsClass.hookBeforeMethod("removeDefaultPrefs") {
|
||||
if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBeforeMethod
|
||||
val importance = it.thisObject.callMethod("findPreference", "importance") ?: return@hookBeforeMethod
|
||||
val mChannel = it.thisObject.getObjectField("mChannel") as NotificationChannel
|
||||
val index = importance.callMethod("findSpinnerIndexOfValue", mChannel.importance.toString()) as Int
|
||||
if (index < 0) return@hookBeforeMethod
|
||||
importance.callMethod("setValueIndex", index)
|
||||
XposedHelpers.setAdditionalInstanceField(importance, "channelNotificationSettings", it.thisObject)
|
||||
it.result = null
|
||||
}
|
||||
|
||||
val dropDownPreferenceClass = XposedHelpers.findClass("androidx.preference.Preference", lpparam.classLoader)
|
||||
dropDownPreferenceClass.hookAfterMethod("callChangeListener", Any::class.java) {
|
||||
val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfterMethod
|
||||
val mChannel = channelNotificationSettings.getObjectField("mChannel") as NotificationChannel
|
||||
mChannel.callMethod("setImportance", (it.args[0] as String).toInt())
|
||||
val mBackend = channelNotificationSettings.getObjectField("mBackend") ?: return@hookAfterMethod
|
||||
val mPkg = channelNotificationSettings.getObjectField("mPkg") as String
|
||||
val mUid = channelNotificationSettings.getIntField("mUid")
|
||||
mBackend.callMethod("updateChannel", mPkg, mUid, mChannel)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import com.lt2333.simplicitytools.view.WeatherView
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class ControlCenterWeather : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("control_center_weather") {
|
||||
var mWeatherView: TextView? = null
|
||||
val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false)
|
||||
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
||||
lpparam.classLoader,
|
||||
"onFinishInflate"
|
||||
) {
|
||||
val viewGroup = it.thisObject as ViewGroup
|
||||
val context = viewGroup.context
|
||||
val layoutParam =
|
||||
loadClass("androidx.constraintlayout.widget.ConstraintLayout\$LayoutParams")
|
||||
.getConstructor(Int::class.java, Int::class.java).newInstance(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
) as ViewGroup.MarginLayoutParams
|
||||
layoutParam.setObjectField(
|
||||
"bottomToTop",
|
||||
context.resources.getIdentifier("date_time", "id", context.packageName)
|
||||
)
|
||||
layoutParam.setObjectField(
|
||||
"startToEnd",
|
||||
context.resources.getIdentifier("big_time", "id", context.packageName)
|
||||
)
|
||||
|
||||
layoutParam.marginStart = context.resources.getDimensionPixelSize(
|
||||
context.resources.getIdentifier(
|
||||
"notification_panel_time_date_space",
|
||||
"dimen",
|
||||
context.packageName
|
||||
)
|
||||
)
|
||||
|
||||
mWeatherView = WeatherView(context, isDisplayCity).apply {
|
||||
setTextAppearance(
|
||||
context.resources.getIdentifier(
|
||||
"TextAppearance.QSControl.Date",
|
||||
"style",
|
||||
context.packageName
|
||||
)
|
||||
)
|
||||
layoutParams = layoutParam
|
||||
}
|
||||
viewGroup.addView(mWeatherView)
|
||||
|
||||
(mWeatherView as WeatherView).setOnClickListener {
|
||||
try {
|
||||
val intent = Intent().apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
component = ComponentName(
|
||||
"com.miui.weather2",
|
||||
"com.miui.weather2.ActivityWeatherMain"
|
||||
)
|
||||
}
|
||||
context.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
//解决横屏重叠
|
||||
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
||||
lpparam.classLoader,
|
||||
"updateLayout"
|
||||
) {
|
||||
val mOrientation = it.thisObject.getObjectField("mOrientation") as Int
|
||||
if (mOrientation == 1) {
|
||||
mWeatherView!!.visibility = View.VISIBLE
|
||||
} else {
|
||||
mWeatherView!!.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideAirplaneIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val iconState = "com.android.systemui.statusbar.policy.NetworkController\$IconState"
|
||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(lpparam.classLoader, "setIsAirplaneMode", iconState) {
|
||||
hasEnable("hide_airplane_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideAlarmIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarPolicy".hookBeforeMethod(lpparam.classLoader, "onMiuiAlarmChanged") {
|
||||
hasEnable("hide_alarm_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideBatteryIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(lpparam.classLoader, "updateResources") {
|
||||
|
||||
//隐藏电池图标
|
||||
hasEnable("hide_battery_icon") {
|
||||
(it.thisObject.getObjectField("mBatteryIconView") as ImageView).visibility = View.GONE
|
||||
if (it.thisObject.getObjectField("mBatteryStyle") == 1) {
|
||||
(it.thisObject.getObjectField("mBatteryDigitalView") as FrameLayout).visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
//隐藏电池内的百分比
|
||||
hasEnable("hide_battery_percentage_icon") {
|
||||
(it.thisObject.getObjectField("mBatteryPercentMarkView") as TextView).textSize = 0F
|
||||
}
|
||||
|
||||
//隐藏电池百分号
|
||||
hasEnable("hide_battery_percentage_icon") {
|
||||
(it.thisObject.getObjectField("mBatteryPercentMarkView") as TextView).textSize = 0F
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(lpparam.classLoader, "updateChargeAndText") {
|
||||
//隐藏电池充电图标
|
||||
hasEnable("hide_battery_charging_icon") {
|
||||
(it.thisObject.getObjectField("mBatteryChargingInView") as ImageView).visibility = View.GONE
|
||||
(it.thisObject.getObjectField("mBatteryChargingView") as ImageView).visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.content.Intent
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideBluetoothHandsfreeBatteryIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarPolicy".hookBeforeMethod(lpparam.classLoader, "updateBluetoothHandsfreeBattery", Intent::class.java) {
|
||||
hasEnable("hide_bluetooth_battery_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideBluetoothIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarPolicy".hookBeforeMethod(lpparam.classLoader, "updateBluetooth", String::class.java) {
|
||||
hasEnable("hide_bluetooth_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideGPSIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.PhoneStatusBarPolicy".hookBeforeMethod(lpparam.classLoader, "updateLocationFromController") {
|
||||
hasEnable("hide_gps_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideHDIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
|
||||
hasEnable("hide_big_hd_icon") {
|
||||
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE
|
||||
}
|
||||
hasEnable("hide_small_hd_icon") {
|
||||
(it.thisObject.getObjectField("mSmallHd") as ImageView).visibility = View.GONE
|
||||
}
|
||||
hasEnable("hide_hd_no_service_icon") {
|
||||
(it.thisObject.getObjectField("mVolteNoService") as ImageView).visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) {
|
||||
hasEnable("hide_big_hd_icon") {
|
||||
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE
|
||||
}
|
||||
hasEnable("hide_small_hd_icon") {
|
||||
(it.thisObject.getObjectField("mSmallHd") as ImageView).visibility = View.GONE
|
||||
}
|
||||
hasEnable("hide_hd_no_service_icon") {
|
||||
(it.thisObject.getObjectField("mVolteNoService") as ImageView).visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.content.Intent
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideHeadsetIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarPolicy".hookBeforeMethod(lpparam.classLoader, "updateHeadsetPlug", Intent::class.java) {
|
||||
hasEnable("hide_headset_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideHotspotIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.PhoneStatusBarPolicy\$2".hookBeforeMethod(lpparam.classLoader, "onHotspotChanged", Boolean::class.java, Int::class.java) {
|
||||
hasEnable("hide_hotspot_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideMobileActivityIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
|
||||
hasEnable("hide_mobile_activity_icon") {
|
||||
(it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE
|
||||
(it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) {
|
||||
hasEnable("hide_mobile_activity_icon") {
|
||||
(it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE
|
||||
(it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideMobileTypeIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
|
||||
hasEnable("hide_mobile_type_icon") {
|
||||
(it.thisObject.getObjectField("mMobileType") as TextView).visibility = View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility = View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) {
|
||||
hasEnable("hide_mobile_type_icon") {
|
||||
(it.thisObject.getObjectField("mMobileType") as TextView).visibility = View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility = View.INVISIBLE
|
||||
(it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideNetworkSpeedSplitter : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val networkSpeedSplitterClass = "com.android.systemui.statusbar.views.NetworkSpeedSplitter".findClass(lpparam.classLoader)
|
||||
networkSpeedSplitterClass.hookAfterMethod("init") {
|
||||
if (XSPUtils.getBoolean("hide_network_speed_splitter", false)) {
|
||||
val textView = it.thisObject as TextView
|
||||
textView.text = " "
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideNoSimIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.MiuiStatusBarSignalPolicy".hookBeforeMethod(lpparam.classLoader, "setNoSims", Boolean::class.javaPrimitiveType, Boolean::class.javaPrimitiveType) {
|
||||
hasEnable("hide_no_sim_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideSimIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(lpparam.classLoader, "hasCorrectSubs", MutableList::class.java) {
|
||||
val list = it.args[0] as MutableList<*>
|
||||
val size = list.size
|
||||
hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) {
|
||||
list.removeAt(1)
|
||||
}
|
||||
hasEnable("hide_sim_one_icon", extraCondition = { size >= 1 }) {
|
||||
list.removeAt(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideSlaveWifiIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.policy.SlaveWifiSignalController".hookBeforeMethod(lpparam.classLoader, "updateIconState") {
|
||||
hasEnable("hide_slave_wifi_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import com.lt2333.simplicitytools.util.isNonNull
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideStatusBarNetworkSpeedSecond :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.views.NetworkSpeedView".hookBeforeMethod(lpparam.classLoader, "setNetworkSpeed", String::class.java) {
|
||||
hasEnable("hide_status_bar_network_speed_second") {
|
||||
it.args[0].isNonNull { s ->
|
||||
it.args[0] = (s as String)
|
||||
.replace("/", "")
|
||||
.replace("s", "")
|
||||
.replace("'", "")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideVolumeZenIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarPolicy".hookBeforeMethod(lpparam.classLoader, "updateVolumeZen") {
|
||||
hasEnable("hide_volume_zen_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideVpnIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(lpparam.classLoader, "updateVpn") {
|
||||
hasEnable("hide_vpn_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideWifiActivityIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState"
|
||||
"com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
|
||||
//隐藏WIFI箭头
|
||||
hasEnable("hide_wifi_activity_icon") {
|
||||
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE
|
||||
}
|
||||
//隐藏WIFI标准图标
|
||||
hasEnable("hide_wifi_standard_icon") {
|
||||
(it.thisObject.getObjectField("mWifiStandardView") as TextView).visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) {
|
||||
//隐藏WIFI箭头
|
||||
hasEnable("hide_wifi_activity_icon") {
|
||||
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE
|
||||
}
|
||||
//隐藏WIFI标准图标
|
||||
hasEnable("hide_wifi_standard_icon") {
|
||||
(it.thisObject.getObjectField("mWifiStandardView") as TextView).visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class HideWifiIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState"
|
||||
"com.android.systemui.statusbar.phone.MiuiStatusBarSignalPolicy".hookBeforeMethod(lpparam.classLoader, "updateWifiIconWithState", iconState) {
|
||||
hasEnable("hide_wifi_icon") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import com.lt2333.simplicitytools.view.WeatherView
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class NotificationWeather : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("notification_weather") {
|
||||
var mWeatherView: TextView? = null
|
||||
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
||||
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(lpparam.classLoader, "onFinishInflate") {
|
||||
val viewGroup = it.thisObject as ViewGroup
|
||||
val context = viewGroup.context
|
||||
val layoutParam = loadClass("androidx.constraintlayout.widget.ConstraintLayout\$LayoutParams").getConstructor(Int::class.java, Int::class.java).newInstance(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) as ViewGroup.MarginLayoutParams
|
||||
layoutParam.setObjectField("bottomToTop", context.resources.getIdentifier("date_time", "id", context.packageName))
|
||||
layoutParam.setObjectField("startToEnd", context.resources.getIdentifier("big_time", "id", context.packageName))
|
||||
layoutParam.marginStart = context.resources.getDimensionPixelSize(context.resources.getIdentifier("notification_panel_time_date_space", "dimen", context.packageName))
|
||||
mWeatherView = WeatherView(context, isDisplayCity).apply {
|
||||
setTextAppearance(context.resources.getIdentifier("TextAppearance.QSControl.Date", "style", context.packageName))
|
||||
layoutParams = layoutParam
|
||||
}
|
||||
viewGroup.addView(mWeatherView)
|
||||
(mWeatherView as WeatherView).setOnClickListener {
|
||||
try {
|
||||
val intent = Intent().apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
component = ComponentName("com.miui.weather2", "com.miui.weather2.ActivityWeatherMain")
|
||||
}
|
||||
context.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
//解决横屏重叠
|
||||
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(lpparam.classLoader, "updateLayout") {
|
||||
val mOrientation = it.thisObject.getObjectField("mOrientation") as Int
|
||||
if (mOrientation == 1) {
|
||||
mWeatherView!!.visibility = View.VISIBLE
|
||||
} else {
|
||||
mWeatherView!!.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import com.lt2333.simplicitytools.view.WeatherView
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class OldNotificationWeather : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("notification_weather") {
|
||||
var mWeatherView: TextView? = null
|
||||
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
||||
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(lpparam.classLoader, "onFinishInflate") {
|
||||
val viewGroup = it.thisObject as ViewGroup
|
||||
val context = viewGroup.context
|
||||
val layoutParam = loadClass("androidx.constraintlayout.widget.ConstraintLayout\$LayoutParams")
|
||||
.getConstructor(Int::class.java, Int::class.java)
|
||||
.newInstance(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) as ViewGroup.MarginLayoutParams
|
||||
|
||||
layoutParam.setObjectField("engToStart", context.resources.getIdentifier("notification_shade_shortcut", "id", context.packageName))
|
||||
layoutParam.setObjectField("topToTop", context.resources.getIdentifier("notification_shade_shortcut", "id", context.packageName))
|
||||
layoutParam.setObjectField("bottomToBottom", context.resources.getIdentifier("notification_shade_shortcut", "id", context.packageName))
|
||||
|
||||
mWeatherView = WeatherView(context, isDisplayCity).apply {
|
||||
setTextAppearance(context.resources.getIdentifier("TextAppearance.StatusBar.Expanded.Clock.QuickSettingDate", "style", context.packageName))
|
||||
layoutParams = layoutParam
|
||||
}
|
||||
viewGroup.addView(mWeatherView)
|
||||
(mWeatherView as WeatherView).setOnClickListener {
|
||||
try {
|
||||
val intent = Intent().apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
component = ComponentName("com.miui.weather2", "com.miui.weather2.ActivityWeatherMain")
|
||||
}
|
||||
context.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(context, "启动失败,可能是不支持", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
//解决横屏重叠
|
||||
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(lpparam.classLoader, "updateLayout") {
|
||||
val mOritation = it.thisObject.getObjectField("mOrientation") as Int
|
||||
if (mOritation == 1) {
|
||||
mWeatherView!!.visibility = View.VISIBLE
|
||||
} else {
|
||||
mWeatherView!!.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class RemoveLockScreenCamera : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
|
||||
//屏蔽右下角组件显示
|
||||
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".hookAfterMethod(lpparam.classLoader, "onFinishInflate") {
|
||||
hasEnable("remove_lock_screen_camera") {
|
||||
(it.thisObject.getObjectField("mRightAffordanceViewLayout") as LinearLayout).visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
//屏蔽滑动撞墙动画
|
||||
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(lpparam.classLoader, "onTouchMove", Float::class.java, Float::class.java) {
|
||||
hasEnable("remove_lock_screen_camera") {
|
||||
it.result = false
|
||||
}
|
||||
}
|
||||
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(lpparam.classLoader, "reset") {
|
||||
hasEnable("remove_lock_screen_camera") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class RemoveTheLeftSideOfTheLockScreen : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer".hookBeforeMethod(lpparam.classLoader, "inflateLeftView") {
|
||||
hasEnable("remove_the_left_side_of_the_lock_screen") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.callMethod
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.replaceMethod
|
||||
import com.lt2333.simplicitytools.util.setIntField
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class RemoveTheMaximumNumberOfNotificationIcons : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("remove_the_maximum_number_of_notification_icons") {
|
||||
"com.android.systemui.statusbar.phone.NotificationIconContainer".replaceMethod(lpparam.classLoader, "miuiShowNotificationIcons", Boolean::class.java) {
|
||||
if (it.args[0] as Boolean) {
|
||||
it.thisObject.setIntField("MAX_DOTS", 30)
|
||||
it.thisObject.setIntField("MAX_STATIC_ICONS", 30)
|
||||
it.thisObject.setIntField("MAX_VISIBLE_ICONS_ON_LOCK", 30)
|
||||
} else {
|
||||
it.thisObject.setIntField("MAX_DOTS", 0)
|
||||
it.thisObject.setIntField("MAX_STATIC_ICONS", 0)
|
||||
it.thisObject.setIntField("MAX_VISIBLE_ICONS_ON_LOCK", 0)
|
||||
}
|
||||
it.thisObject.callMethod("updateState")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class StatusBarCurrent :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val miuiPhoneStatusBarViewClass =
|
||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView".findClass(lpparam.classLoader)
|
||||
miuiPhoneStatusBarViewClass.hookAfterMethod("onFinishInflate") { param ->
|
||||
val viewGroup = param.thisObject as ViewGroup
|
||||
val textView = TextView(viewGroup.context).also {
|
||||
it.text = "Text"
|
||||
it.textSize = 14F
|
||||
}
|
||||
viewGroup.addView(textView)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.content.res.Resources
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.LinearLayout
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class StatusBarLayout : IXposedHookLoadPackage {
|
||||
|
||||
private var mLeftLayout: LinearLayout? = null
|
||||
private var mRightLayout: LinearLayout? = null
|
||||
private var mCenterLayout: LinearLayout? = null
|
||||
private var status_bar: ViewGroup? = null
|
||||
|
||||
private var status_bar_left = 0
|
||||
private var status_bar_top = 0
|
||||
private var status_bar_right = 0
|
||||
private var status_bar_bottom = 0
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (!XSPUtils.getBoolean("status_bar_time_center", false)) return
|
||||
|
||||
val collapsedStatusBarFragmentClass =
|
||||
"com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(lpparam.classLoader)
|
||||
|
||||
collapsedStatusBarFragmentClass.hookAfterMethod(
|
||||
"onViewCreated",
|
||||
View::class.java,
|
||||
Bundle::class.java
|
||||
) { param ->
|
||||
val MiuiPhoneStatusBarView: ViewGroup =
|
||||
param.thisObject.getObjectField("mStatusBar") as ViewGroup
|
||||
val context: Context = MiuiPhoneStatusBarView.context
|
||||
val res: Resources = MiuiPhoneStatusBarView.resources
|
||||
val status_bar_ID: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||
val status_bar_contents_ID: Int =
|
||||
res.getIdentifier("status_bar_contents", "id", "com.android.systemui")
|
||||
val system_icon_area_ID: Int =
|
||||
res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
||||
val clock_ID: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||
val phone_status_bar_left_container_ID: Int =
|
||||
res.getIdentifier("phone_status_bar_left_container", "id", "com.android.systemui")
|
||||
val fullscreen_notification_icon_area_ID: Int =
|
||||
res.getIdentifier("fullscreen_notification_icon_area", "id", "com.android.systemui")
|
||||
status_bar = MiuiPhoneStatusBarView.findViewById(status_bar_ID)
|
||||
val status_bar_contents: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(status_bar_contents_ID)
|
||||
if (status_bar == null) return@hookAfterMethod
|
||||
val Clock: View = MiuiPhoneStatusBarView.findViewById(clock_ID)
|
||||
val phone_status_bar_left_container: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(phone_status_bar_left_container_ID)
|
||||
val fullscreen_notification_icon_area: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(fullscreen_notification_icon_area_ID)
|
||||
val system_icon_area: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(system_icon_area_ID)
|
||||
|
||||
(Clock.parent as ViewGroup).removeView(Clock)
|
||||
(phone_status_bar_left_container.parent as ViewGroup).removeView(
|
||||
phone_status_bar_left_container
|
||||
)
|
||||
(fullscreen_notification_icon_area.parent as ViewGroup).removeView(
|
||||
fullscreen_notification_icon_area
|
||||
)
|
||||
(system_icon_area.parent as ViewGroup).removeView(system_icon_area)
|
||||
|
||||
val mConstraintLayoutLp = ConstraintLayout.LayoutParams(
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
|
||||
val mConstraintLayout =
|
||||
ConstraintLayout(context).also { it.layoutParams = mConstraintLayoutLp }
|
||||
|
||||
mConstraintLayout.addView(fullscreen_notification_icon_area)
|
||||
|
||||
val fullscreen_notification_icon_area_lp = FrameLayout.LayoutParams(
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
|
||||
fullscreen_notification_icon_area.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(phone_status_bar_left_container)
|
||||
mLeftLayout!!.addView(mConstraintLayout)
|
||||
|
||||
mCenterLayout!!.addView(Clock)
|
||||
mRightLayout!!.addView(system_icon_area)
|
||||
status_bar_contents.addView(mLeftLayout, 0)
|
||||
status_bar_contents.addView(mCenterLayout)
|
||||
status_bar_contents.addView(mRightLayout)
|
||||
|
||||
status_bar_left = status_bar!!.paddingLeft
|
||||
status_bar_top = status_bar!!.paddingTop
|
||||
status_bar_right = status_bar!!.paddingRight
|
||||
status_bar_bottom = status_bar!!.paddingBottom
|
||||
|
||||
|
||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||
val custom_left_margin = XSPUtils.getInt("status_bar_left_margin", 0)
|
||||
if (custom_left_margin != 0) {
|
||||
status_bar_left = custom_left_margin
|
||||
}
|
||||
|
||||
val custom_right_margin = XSPUtils.getInt("status_bar_right_margin", 0)
|
||||
if (custom_right_margin != 0) {
|
||||
status_bar_right = custom_right_margin
|
||||
}
|
||||
updateLayout(context)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
val phoneStatusBarViewClass =
|
||||
"com.android.systemui.statusbar.phone.PhoneStatusBarView".findClass(lpparam.classLoader)
|
||||
|
||||
phoneStatusBarViewClass.hookAfterMethod("updateLayoutForCutout") {
|
||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||
val context = (it.thisObject as ViewGroup).context
|
||||
updateLayout(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun updateLayout(context: Context) {
|
||||
//判断屏幕方向
|
||||
val mConfiguration: Configuration = context.resources.configuration
|
||||
if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||
mLeftLayout!!.setPadding(status_bar_left, 0, 0, 0)
|
||||
mRightLayout!!.setPadding(0, 0, status_bar_right, 0)
|
||||
status_bar!!.setPadding(0, status_bar_top, 0, status_bar_bottom)
|
||||
} else {
|
||||
//横屏状态
|
||||
mLeftLayout!!.setPadding(175, 0, 0, 0)
|
||||
mRightLayout!!.setPadding(0, 0, 175, 0)
|
||||
status_bar!!.setPadding(0, status_bar_top, 0, status_bar_bottom)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class StatusBarNetworkSpeedRefreshSpeed :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(lpparam.classLoader, "postUpdateNetworkSpeedDelay", Long::class.java) {
|
||||
hasEnable("status_bar_network_speed_refresh_speed") {
|
||||
it.args[0] = 1000L
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,234 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.provider.Settings
|
||||
import android.util.AttributeSet
|
||||
import android.util.TypedValue
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hookAfterConstructor
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
import java.lang.reflect.Method
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
class StatusBarTimeCustomization : IXposedHookLoadPackage {
|
||||
|
||||
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 getClockDoubleSize = XSPUtils.getInt("status_bar_clock_double_line_size", 0)
|
||||
private var now_time: Date? = null
|
||||
private var str = ""
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (isOpen) {
|
||||
var c: Context? = null
|
||||
val miuiClockClass = "com.android.systemui.statusbar.views.MiuiClock".findClass(lpparam.classLoader)
|
||||
miuiClockClass.hookAfterConstructor(Context::class.java, AttributeSet::class.java, Integer.TYPE) {
|
||||
try {
|
||||
c = it.args[0] as Context
|
||||
val textV = it.thisObject as TextView
|
||||
textV.isSingleLine = false
|
||||
if (isDoubleLine) {
|
||||
str = "\n"
|
||||
var clock_double_line_size = 7F
|
||||
if (getClockDoubleSize != 0) {
|
||||
clock_double_line_size = getClockDoubleSize.toFloat()
|
||||
}
|
||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clock_double_line_size)
|
||||
} else {
|
||||
if (getClockSize != 0) {
|
||||
val clock_size = getClockSize.toFloat()
|
||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clock_size)
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
if (textV.resources.getResourceEntryName(textV.id) == "clock")
|
||||
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000)
|
||||
} catch (e: java.lang.Exception) {
|
||||
}
|
||||
}
|
||||
miuiClockClass.hookAfterMethod("updateTime") {
|
||||
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)
|
||||
now_time = Calendar.getInstance().time
|
||||
textV.text = getDate(c!!, t) + str + getTime(c!!, t)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
private fun getDate(context: Context, t: String): 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(now_time)
|
||||
return datePattern
|
||||
}
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
private fun getTime(context: Context, t: String): String {
|
||||
var timePattern = ""
|
||||
val isZh = isZh(context)
|
||||
timePattern += if (t == "24") "HH:mm" else "h:mm"
|
||||
if (isSecond) timePattern += ":ss"
|
||||
timePattern = SimpleDateFormat(timePattern).format(now_time)
|
||||
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(now_time)) {
|
||||
"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(now_time)
|
||||
if (!isHideSpace) {
|
||||
period = " $period"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return period
|
||||
}
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
private fun getDoubleHour(): String {
|
||||
var doubleHour = ""
|
||||
if (isDoubleHour) {
|
||||
when (SimpleDateFormat("HH").format(now_time)) {
|
||||
"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")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
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 de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class WaveCharge : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
||||
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,17 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.thememanager
|
||||
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class RemoveAds : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.thememanager.basemodule.ad.model.AdInfoResponse".hookBeforeMethod(lpparam.classLoader, "isAdValid", "com.android.thememanager.basemodule.ad.model.AdInfo".findClass(lpparam.classLoader)) {
|
||||
hasEnable("remove_thememanager_ads") {
|
||||
it.result = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.lt2333.simplicitytools.hooks
|
||||
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.hooks.apps.*
|
||||
import com.lt2333.simplicitytools.hooks.rules.all.corepatch.CorePatchMainHook
|
||||
import com.lt2333.simplicitytools.utils.xposed.EasyXposedInit
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.IXposedHookZygoteInit
|
||||
import de.robv.android.xposed.XSharedPreferences
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class MainHook : EasyXposedInit() {
|
||||
private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
||||
|
||||
override val registeredApp: List<AppRegister> = listOf(
|
||||
Android, // Android
|
||||
SystemUI, // 系统界面
|
||||
PowerKeeper, // 电量与性能
|
||||
MiuiHome, // 桌面
|
||||
SecurityCenter, // 手机管家
|
||||
MediaEditor, // 相册编辑
|
||||
Updater, // 系统更新
|
||||
Settings, // 设置
|
||||
ThemeManager, // 主题壁纸
|
||||
ScreenShot, // 截屏
|
||||
Cast, //投屏
|
||||
RearDisplay, //背屏
|
||||
PackageInstaller, // 应用包管理组件
|
||||
)
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
||||
if (prefs.getBoolean("main_switch", true)) {
|
||||
super.handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
|
||||
override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
|
||||
super.initZygote(startupParam)
|
||||
CorePatchMainHook().initZygote(startupParam)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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, //允许不受信任的触摸
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
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, //强制允许所有应用接力
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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, //解锁裁切最小值
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
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, //快捷菜单添加小窗
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
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 更激进
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
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, //背屏显示天气
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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, //解锁裁切限制
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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, //去除打开应用弹窗
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
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, //显示通知重要程度
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
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 角标
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.all.thememanager.RemoveAdsForAll
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object ThemeManager : AppRegister() {
|
||||
override val packageName: String = "com.android.thememanager"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
RemoveAdsForAll, //移除主题壁纸的广告
|
||||
)
|
||||
}
|
||||
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
RemoveAdsForAll, //移除主题壁纸的广告
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
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.loadClassOrNull
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object Updater : AppRegister() {
|
||||
override val packageName: String = "com.android.updater"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
|
||||
hasEnable("remove_ota_validate") {
|
||||
Array(26) { "com.android.updater.common.utils.${'a' + it}" }
|
||||
.mapNotNull { loadClassOrNull(it) }
|
||||
.firstOrNull { it.declaredFields.size >= 9 && it.declaredMethods.size > 60 }
|
||||
?.findMethod { name == "T" && returnType == Boolean::class.java }
|
||||
?.hookReturnConstant(false)
|
||||
|
||||
findMethod("miui.util.FeatureParser") {
|
||||
name == "hasFeature" && parameterCount == 2
|
||||
}.hookBefore {
|
||||
if (it.args[0] == "support_ota_validate") {
|
||||
it.result = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.all.android
|
||||
|
||||
import android.content.Context
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object AllowUntrustedTouchesForAll : HookRegister() {
|
||||
override fun init() = hasEnable("allow_untrusted_touches") {
|
||||
findMethod("android.hardware.input.InputManager") {
|
||||
name == "getBlockUntrustedTouchesMode" && parameterTypes[0] == Context::class.java
|
||||
}.hookReturnConstant(0)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.all.android
|
||||
|
||||
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.HookRegister
|
||||
|
||||
object DeleteOnPostNotificationForAll : HookRegister() {
|
||||
override fun init() {
|
||||
findMethod("com.android.server.wm.AlertWindowNotification") {
|
||||
name == "onPostNotification"
|
||||
}.hookBefore {
|
||||
hasEnable("delete_on_post_notification") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.all.android
|
||||
|
||||
import android.os.Build
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAllConstructorBefore
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object DisableFlagSecureForAll : HookRegister() {
|
||||
override fun init() {
|
||||
findMethod("com.android.server.wm.WindowState") {
|
||||
name == "isSecureLocked"
|
||||
}.hookBefore {
|
||||
hasEnable("disable_flag_secure") {
|
||||
it.result = false
|
||||
}
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
|
||||
findMethod("com.android.server.wm.WindowSurfaceController") {
|
||||
name == "setSecure"
|
||||
}.hookBefore {
|
||||
it.args[0] = false
|
||||
}
|
||||
hookAllConstructorBefore("com.android.server.wm.WindowSurfaceController") {
|
||||
var flags = it.args[2] as Int
|
||||
val secureFlag = 128
|
||||
flags = flags and secureFlag.inv()
|
||||
it.args[2] = flags
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.all.cast
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object ForceSupportSendAppForAll : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("force_support_send_app") {
|
||||
findMethod("com.xiaomi.mirror.synergy.MiuiSynergySdk") {
|
||||
name == "isSupportSendApp"
|
||||
}.hookAfter {
|
||||
it.result = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.all.corepatch;
|
||||
|
||||
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.Signature;
|
||||
|
||||
import com.lt2333.simplicitytools.BuildConfig;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage;
|
||||
import de.robv.android.xposed.IXposedHookZygoteInit;
|
||||
import de.robv.android.xposed.XC_MethodHook;
|
||||
import de.robv.android.xposed.XC_MethodReplacement;
|
||||
import de.robv.android.xposed.XSharedPreferences;
|
||||
import de.robv.android.xposed.XposedHelpers;
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||
|
||||
public class CorePatchForQ extends XposedHelper implements IXposedHookLoadPackage, IXposedHookZygoteInit {
|
||||
XSharedPreferences prefs = new XSharedPreferences(BuildConfig.APPLICATION_ID, "config");
|
||||
|
||||
@Override
|
||||
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws IllegalAccessException, InvocationTargetException, InstantiationException {
|
||||
// 允许降级
|
||||
Class<?> packageClazz = XposedHelpers.findClass("android.content.pm.PackageParser.Package", loadPackageParam.classLoader);
|
||||
hookAllMethods("com.android.server.pm.PackageManagerService", loadPackageParam.classLoader, "checkDowngrade", new XC_MethodHook() {
|
||||
public void beforeHookedMethod(MethodHookParam methodHookParam) throws Throwable {
|
||||
super.beforeHookedMethod(methodHookParam);
|
||||
if (prefs.getBoolean("downgrade", true)) {
|
||||
Object packageInfoLite = methodHookParam.args[0];
|
||||
|
||||
if (prefs.getBoolean("downgrade", true)) {
|
||||
Field field = packageClazz.getField("mVersionCode");
|
||||
field.setAccessible(true);
|
||||
field.set(packageInfoLite, 0);
|
||||
field = packageClazz.getField("mVersionCodeMajor");
|
||||
field.setAccessible(true);
|
||||
field.set(packageInfoLite, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
hookAllMethods("android.util.jar.StrictJarVerifier", loadPackageParam.classLoader, "verifyMessageDigest",
|
||||
new ReturnConstant(prefs, "authcreak", true));
|
||||
hookAllMethods("android.util.jar.StrictJarVerifier", loadPackageParam.classLoader, "verify",
|
||||
new ReturnConstant(prefs, "authcreak", true));
|
||||
hookAllMethods("java.security.MessageDigest", loadPackageParam.classLoader, "isEqual",
|
||||
new ReturnConstant(prefs, "authcreak", true));
|
||||
hookAllMethods("com.android.server.pm.PackageManagerServiceUtils", loadPackageParam.classLoader, "verifySignatures",
|
||||
new ReturnConstant(prefs, "authcreak", false));
|
||||
|
||||
Class<?> signingDetails = XposedHelpers.findClass("android.content.pm.PackageParser.SigningDetails", loadPackageParam.classLoader);
|
||||
Constructor<?> findConstructorExact = XposedHelpers.findConstructorExact(signingDetails, Signature[].class, Integer.TYPE);
|
||||
findConstructorExact.setAccessible(true);
|
||||
Class<?> packageParserException = XposedHelpers.findClass("android.content.pm.PackageParser.PackageParserException", loadPackageParam.classLoader);
|
||||
Field error = XposedHelpers.findField(packageParserException, "error");
|
||||
error.setAccessible(true);
|
||||
Object[] signingDetailsArgs = new Object[2];
|
||||
signingDetailsArgs[0] = new Signature[]{new Signature(SIGNATURE)};
|
||||
signingDetailsArgs[1] = 1;
|
||||
final Object newInstance = findConstructorExact.newInstance(signingDetailsArgs);
|
||||
hookAllMethods("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "verifyV1Signature", new XC_MethodHook() {
|
||||
public void afterHookedMethod(MethodHookParam methodHookParam) throws Throwable {
|
||||
super.afterHookedMethod(methodHookParam);
|
||||
if (prefs.getBoolean("authcreak", true)) {
|
||||
Throwable throwable = methodHookParam.getThrowable();
|
||||
if (throwable != null) {
|
||||
Throwable cause = throwable.getCause();
|
||||
if (throwable.getClass() == packageParserException) {
|
||||
if (error.getInt(throwable) == -103) {
|
||||
methodHookParam.setResult(newInstance);
|
||||
}
|
||||
}
|
||||
if (cause != null && cause.getClass() == packageParserException) {
|
||||
if (error.getInt(cause) == -103) {
|
||||
methodHookParam.setResult(newInstance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//New package has a different signature
|
||||
//处理覆盖安装但签名不一致
|
||||
hookAllMethods(signingDetails, "checkCapability", new XC_MethodHook() {
|
||||
@Override
|
||||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||
super.beforeHookedMethod(param);
|
||||
if (prefs.getBoolean("digestCreak", true)) {
|
||||
if ((Integer) param.args[1] != 4 && prefs.getBoolean("authcreak", true)) {
|
||||
param.setResult(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
hookAllMethods(signingDetails, "checkCapabilityRecover",
|
||||
new XC_MethodHook() {
|
||||
@Override
|
||||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||
super.beforeHookedMethod(param);
|
||||
if (prefs.getBoolean("digestCreak", true)) {
|
||||
if ((Integer) param.args[1] != 4 && prefs.getBoolean("authcreak", true)) {
|
||||
param.setResult(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// if app is system app, allow to use hidden api, even if app not using a system signature
|
||||
findAndHookMethod("android.content.pm.ApplicationInfo", loadPackageParam.classLoader, "isPackageWhitelistedForHiddenApis", new XC_MethodHook() {
|
||||
@Override
|
||||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||
super.beforeHookedMethod(param);
|
||||
if (prefs.getBoolean("digestCreak", true)) {
|
||||
ApplicationInfo info = (ApplicationInfo) param.thisObject;
|
||||
if ((info.flags & ApplicationInfo.FLAG_SYSTEM) != 0
|
||||
|| (info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
|
||||
param.setResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initZygote(StartupParam startupParam) {
|
||||
hookAllMethods("android.content.pm.PackageParser", null, "getApkSigningVersion", XC_MethodReplacement.returnConstant(1));
|
||||
hookAllConstructors("android.util.jar.StrictJarVerifier", new XC_MethodHook() {
|
||||
@Override
|
||||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||
super.beforeHookedMethod(param);
|
||||
if (prefs.getBoolean("enhancedMode", false)) {
|
||||
param.args[3] = Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,61 +1,82 @@
|
||||
/**
|
||||
* 代码来自 https://github.com/LSPosed/CorePatch
|
||||
* GPL-2.0 License
|
||||
**/
|
||||
package com.lt2333.simplicitytools.hooks.rules.all.corepatch;
|
||||
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
|
||||
import android.app.AndroidAppHelper;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.Signature;
|
||||
import android.util.Log;
|
||||
|
||||
import com.lt2333.simplicitytools.BuildConfig;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Member;
|
||||
import java.lang.reflect.Method;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage;
|
||||
import de.robv.android.xposed.IXposedHookZygoteInit;
|
||||
import de.robv.android.xposed.XC_MethodHook;
|
||||
import de.robv.android.xposed.XC_MethodReplacement;
|
||||
import de.robv.android.xposed.XSharedPreferences;
|
||||
import de.robv.android.xposed.XposedBridge;
|
||||
import de.robv.android.xposed.XposedHelpers;
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||
|
||||
public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
public class CorePatchForR extends XposedHelper implements IXposedHookLoadPackage, IXposedHookZygoteInit {
|
||||
XSharedPreferences prefs = new XSharedPreferences(BuildConfig.APPLICATION_ID, "config");
|
||||
String TAG = "ST-CorePatch";
|
||||
|
||||
@Override
|
||||
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,
|
||||
"checkDowngrade",
|
||||
"com.android.server.pm.parsing.pkg.AndroidPackage",
|
||||
"android.content.pm.PackageInfoLite",
|
||||
new ReturnConstant(prefs, "corepatch", null));
|
||||
new ReturnConstant(prefs, "downgrade", null));
|
||||
|
||||
// exists on flyme 9(Android 11) only
|
||||
findAndHookMethod("com.android.server.pm.PackageManagerService", loadPackageParam.classLoader,
|
||||
"checkDowngrade",
|
||||
"android.content.pm.PackageInfoLite",
|
||||
"android.content.pm.PackageInfoLite",
|
||||
new ReturnConstant(prefs, "downgrade", true));
|
||||
|
||||
|
||||
// apk内文件修改后 digest校验会失败
|
||||
hookAllMethods("android.util.jar.StrictJarVerifier", loadPackageParam.classLoader, "verifyMessageDigest",
|
||||
new ReturnConstant(prefs, "corepatch", true));
|
||||
new ReturnConstant(prefs, "authcreak", true));
|
||||
hookAllMethods("android.util.jar.StrictJarVerifier", loadPackageParam.classLoader, "verify",
|
||||
new ReturnConstant(prefs, "corepatch", true));
|
||||
new ReturnConstant(prefs, "authcreak", true));
|
||||
hookAllMethods("java.security.MessageDigest", loadPackageParam.classLoader, "isEqual",
|
||||
new ReturnConstant(prefs, "corepatch", true));
|
||||
new ReturnConstant(prefs, "authcreak", true));
|
||||
|
||||
// Targeting R+ (version " + Build.VERSION_CODES.R + " and above) requires"
|
||||
// + " the resources.arsc of installed APKs to be stored uncompressed"
|
||||
// + " and aligned on a 4-byte boundary
|
||||
// target >=30 的情况下 resources.arsc 必须是未压缩的且4K对齐
|
||||
hookAllMethods("android.content.res.AssetManager", loadPackageParam.classLoader, "containsAllocatedTable",
|
||||
new ReturnConstant(prefs, "corepatch", false));
|
||||
new ReturnConstant(prefs, "authcreak", false));
|
||||
|
||||
// No signature found in package of version " + minSignatureSchemeVersion
|
||||
// + " or newer for package " + apkPath
|
||||
findAndHookMethod("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "getMinimumSignatureSchemeVersionForTargetSdk", int.class,
|
||||
new ReturnConstant(prefs, "corepatch", 0));
|
||||
new ReturnConstant(prefs, "authcreak", 0));
|
||||
findAndHookMethod("com.android.apksig.ApkVerifier", loadPackageParam.classLoader, "getMinimumSignatureSchemeVersionForTargetSdk", int.class,
|
||||
new ReturnConstant(prefs, "authcreak", 0));
|
||||
|
||||
// Package " + packageName + " signatures do not match previously installed version; ignoring!"
|
||||
// public boolean checkCapability(String sha256String, @CertCapabilities int flags) {
|
||||
@@ -66,7 +87,7 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
// Don't handle PERMISSION (grant SIGNATURE permissions to pkgs with this cert)
|
||||
// Or applications will have all privileged permissions
|
||||
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/content/pm/PackageParser.java;l=5947?q=CertCapabilities
|
||||
if (prefs.getBoolean("corepatch", true)) {
|
||||
if (prefs.getBoolean("authcreak", true)) {
|
||||
if ((Integer) param.args[1] != 4) {
|
||||
param.setResult(true);
|
||||
}
|
||||
@@ -83,7 +104,7 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
Class<?> sJarClass = XposedHelpers.findClass("android.util.jar.StrictJarFile", loadPackageParam.classLoader);
|
||||
Constructor<?> constructorExact = XposedHelpers.findConstructorExact(sJarClass, String.class, boolean.class, boolean.class);
|
||||
constructorExact.setAccessible(true);
|
||||
Class<?> signingDetails = XposedHelpers.findClass("android.content.pm.PackageParser.SigningDetails", loadPackageParam.classLoader);
|
||||
Class<?> signingDetails = getSigningDetails(loadPackageParam.classLoader);
|
||||
Constructor<?> findConstructorExact = XposedHelpers.findConstructorExact(signingDetails, Signature[].class, Integer.TYPE);
|
||||
findConstructorExact.setAccessible(true);
|
||||
Class<?> packageParserException = XposedHelpers.findClass("android.content.pm.PackageParser.PackageParserException", loadPackageParam.classLoader);
|
||||
@@ -91,20 +112,68 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
error.setAccessible(true);
|
||||
Object[] signingDetailsArgs = new Object[2];
|
||||
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() {
|
||||
public void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||
super.afterHookedMethod(param);
|
||||
if (prefs.getBoolean("digestCreak", true)) {
|
||||
if (!prefs.getBoolean("UsePreSig", false)) {
|
||||
final Object block = constructor.newInstance(param.args[0]);
|
||||
Object[] infos = (Object[]) XposedHelpers.callMethod(block, "getSignerInfos");
|
||||
Object info = infos[0];
|
||||
List<X509Certificate> verifiedSignerCertChain = (List<X509Certificate>) XposedHelpers.callMethod(info, "getCertificateChain", block);
|
||||
param.setResult(verifiedSignerCertChain.toArray(
|
||||
new X509Certificate[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
hookAllMethods("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "verifyV1Signature", new XC_MethodHook() {
|
||||
public void afterHookedMethod(MethodHookParam methodHookParam) throws Throwable {
|
||||
super.afterHookedMethod(methodHookParam);
|
||||
if (prefs.getBoolean("corepatch", true)) {
|
||||
if (prefs.getBoolean("authcreak", true)) {
|
||||
Throwable throwable = methodHookParam.getThrowable();
|
||||
if (throwable != null) {
|
||||
Integer parseErr = 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;
|
||||
if (prefs.getBoolean("corepatch", true)) {
|
||||
final Object origJarFile = constructorExact.newInstance(methodHookParam.args[0], true, false);
|
||||
try {
|
||||
if (prefs.getBoolean("UsePreSig", false)) {
|
||||
PackageManager PM = AndroidAppHelper.currentApplication().getPackageManager();
|
||||
if (PM == null) {
|
||||
XposedBridge.log("E: " + BuildConfig.APPLICATION_ID + " Cannot get the Package Manager... Are you using MiUI?");
|
||||
} else {
|
||||
PackageInfo pI;
|
||||
if (parseErr != null) {
|
||||
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) {
|
||||
|
||||
}
|
||||
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 Certificate[][] lastCerts = (Certificate[][]) XposedHelpers.callStaticMethod(ASV, "loadCertificates", origJarFile, manifestEntry);
|
||||
final Certificate[][] lastCerts;
|
||||
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);
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
if (lastSigs != null) {
|
||||
signingDetailsArgs[0] = lastSigs;
|
||||
} else {
|
||||
@@ -117,9 +186,9 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
if (signingDetailsWithDigests != null) {
|
||||
Constructor<?> signingDetailsWithDigestsConstructorExact = XposedHelpers.findConstructorExact(signingDetailsWithDigests, signingDetails, Map.class);
|
||||
signingDetailsWithDigestsConstructorExact.setAccessible(true);
|
||||
newInstance = signingDetailsWithDigestsConstructorExact.newInstance(newInstance, null);
|
||||
newInstance = signingDetailsWithDigestsConstructorExact.newInstance(new Object[]{newInstance, null});
|
||||
}
|
||||
|
||||
if (throwable != null) {
|
||||
Throwable cause = throwable.getCause();
|
||||
if (throwable.getClass() == packageParserException) {
|
||||
if (error.getInt(throwable) == -103) {
|
||||
@@ -132,6 +201,12 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (parseErr != null && parseErr == -103) {
|
||||
Object input = methodHookParam.args[0];
|
||||
XposedHelpers.callMethod(input, "reset");
|
||||
methodHookParam.setResult(XposedHelpers.callMethod(input, "success", newInstance));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -145,7 +220,7 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
// Don't handle PERMISSION (grant SIGNATURE permissions to pkgs with this cert)
|
||||
// Or applications will have all privileged permissions
|
||||
// https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/content/pm/PackageParser.java;l=5947?q=CertCapabilities
|
||||
if (((Integer) param.args[1] != 4) && prefs.getBoolean("corepatch", true)) {
|
||||
if (((Integer) param.args[1] != 4) && prefs.getBoolean("digestCreak", true)) {
|
||||
param.setResult(true);
|
||||
}
|
||||
}
|
||||
@@ -155,7 +230,7 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
@Override
|
||||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||
super.beforeHookedMethod(param);
|
||||
if (prefs.getBoolean("corepatch", true)) {
|
||||
if (prefs.getBoolean("digestCreak", true)) {
|
||||
ApplicationInfo info = (ApplicationInfo) param.thisObject;
|
||||
if ((info.flags & ApplicationInfo.FLAG_SYSTEM) != 0
|
||||
|| (info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
|
||||
@@ -164,6 +239,37 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var utilClass = findClass("com.android.server.pm.PackageManagerServiceUtils", loadPackageParam.classLoader);
|
||||
if (utilClass != null) {
|
||||
for (var m : utilClass.getDeclaredMethods()) {
|
||||
if ("verifySignatures".equals(m.getName())) {
|
||||
try {
|
||||
XposedBridge.class.getDeclaredMethod("deoptimizeMethod", Member.class).invoke(null, m);
|
||||
} catch (Throwable e) {
|
||||
Log.e("CorePatch", "deoptimizing failed", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Class<?> getSigningDetails(ClassLoader classLoader) {
|
||||
return XposedHelpers.findClass("android.content.pm.PackageParser.SigningDetails", classLoader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initZygote(StartupParam startupParam) {
|
||||
|
||||
hookAllMethods("android.content.pm.PackageParser", null, "getApkSigningVersion", XC_MethodReplacement.returnConstant(1));
|
||||
hookAllConstructors("android.util.jar.StrictJarVerifier", new XC_MethodHook() {
|
||||
@Override
|
||||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||
if (prefs.getBoolean("enhancedMode", false)) {
|
||||
super.beforeHookedMethod(param);
|
||||
param.args[3] = Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.all.corepatch;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import de.robv.android.xposed.XC_MethodHook;
|
||||
import de.robv.android.xposed.XposedHelpers;
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||
|
||||
public class CorePatchForS extends CorePatchForR {
|
||||
@Override
|
||||
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws IllegalAccessException, InvocationTargetException, InstantiationException {
|
||||
super.handleLoadPackage(loadPackageParam);
|
||||
if (prefs.getBoolean("digestCreak", true) && prefs.getBoolean("UsePreSig", false)) {
|
||||
findAndHookMethod("com.android.server.pm.PackageManagerService", loadPackageParam.classLoader, "doesSignatureMatchForPermissions", String.class, "com.android.server.pm.parsing.pkg.ParsedPackage", int.class, new XC_MethodHook() {
|
||||
@Override
|
||||
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||
//If we decide to crack this then at least make sure they are same apks, avoid another one that tries to impersonate.
|
||||
if (param.getResult().equals(false)) {
|
||||
String pPname = (String) XposedHelpers.callMethod(param.args[1], "getPackageName");
|
||||
if (pPname.contentEquals((String) param.args[0])) {
|
||||
param.setResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.all.corepatch;
|
||||
|
||||
public class CorePatchForSv2 extends CorePatchForS{
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user