197 Commits

Author SHA1 Message Date
乌堆小透明
13d54c3b11 New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-08-09 04:37:40 +08:00
乌堆小透明
9c9986ba80 New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-08-09 04:37:33 +08:00
乌堆小透明
3926179403 New translations strings.xml (Thai)
[ci skip] New translations from Crowdin
2022-07-23 18:39:56 +08:00
乌堆小透明
1719cc62f6 New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin
2022-07-14 19:24:52 +08:00
乌堆小透明
343dd9e683 New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin
2022-07-04 14:24:19 +08:00
乌堆小透明
c69354cb0d New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-07-04 11:10:52 +08:00
乌堆小透明
719b777ea7 New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin
2022-06-29 20:46:33 +08:00
乌堆小透明
dc74fd665d New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-06-29 20:46:32 +08:00
乌堆小透明
91c3b8311b New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-06-29 19:05:28 +08:00
乌堆小透明
a414e2a9c8 New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin
2022-06-29 19:05:17 +08:00
乌堆小透明
73325ee306 New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-06-29 19:05:12 +08:00
乌堆小透明
a9d43e9977 New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-06-29 19:05:07 +08:00
乌堆小透明
a0e0741924 New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-06-29 16:58:33 +08:00
乌堆小透明
a38d9c661c New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-06-29 16:58:23 +08:00
乌堆小透明
422189b16e New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-06-29 16:58:17 +08:00
乌堆小透明
12726a5831 New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-06-29 16:58:14 +08:00
乌堆小透明
999f9a088f New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-06-29 16:56:52 +08:00
乌堆小透明
49c293d30d New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-06-29 16:56:34 +08:00
LittleTurtle2333
87a8059a06 更新Strings.xml 2022-06-29 16:55:56 +08:00
乌堆小透明
8e85c34db3 Merge pull request #174
* New translations strings.xml (Vietnamese)

* New translations strings.xml (Vietnamese)

* New translations strings.xml (Vietnamese)

* New translations strings.xml (Portuguese, Brazilian)

* New translations strings.xml (Portuguese)

* New translations strings.xml (Portuguese, Brazilian)

* New translations strings.xml (Chinese Simplified)

* New translations strings.xml (Portuguese)
2022-06-29 16:52:43 +08:00
LittleTurtle2333
72ad0479df 更新时钟自定义极客模式 2022-06-29 16:44:19 +08:00
LittleTurtle2333
479251fb67 更新居中挖孔兼容模式(网速右显) 2022-06-29 16:43:58 +08:00
LittleTurtle2333
dec3bc0a42 更新功能界面 2022-06-29 16:43:27 +08:00
LittleTurtle2333
32f2fc7215 更新blockmiui版本 2022-06-29 16:37:10 +08:00
YuKongA
4246e2910e 修复 截图无限裁切 功能导致的崩溃问题 (#172)
* 同时更新依赖
* 允许应用横屏
2022-06-28 00:51:43 +08:00
LittleTurtle2333
3cd3b87707 更新版本号至 1.6.6 2022-06-16 16:26:30 +08:00
乌堆小透明
693b707922 New Crowdin updates (#164)
* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-06-16 15:18:28 +08:00
YuKongA
90466bb3fb Merge pull request #169
* 修复 隐藏网速单位 & 随便精简了下代码

* Update SettingsActivity.kt
2022-05-25 22:04:41 +08:00
YuKongA
cef006ced2 显示 WIFI 角标 (#166) 2022-05-17 00:22:48 +08:00
GSWXXN
2a94e1da69 显示电池温度适配新版手机管家&新增隐藏NFC图标 (#163) 2022-05-12 18:48:31 +08:00
乌堆小透明
94beae5f45 New Crowdin updates (#152)
* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin
2022-05-12 18:35:01 +08:00
LittleTurtle2333
a63fd5510a update blockmiui 2022-04-23 21:26:22 +08:00
LittleTurtle2333
24b0fbbd48 更新版本号至 1.6.5 2022-04-23 16:14:55 +08:00
LittleTurtle2333
d38b79aec2 升级 gradle 2022-04-23 16:14:24 +08:00
乌堆小透明
8f1453f420 New Crowdin updates (#142)
* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin
2022-04-23 16:11:20 +08:00
LittleTurtle2333
b1373d7141 移除KXH,迁移至EzXHelper 2022-04-23 15:30:00 +08:00
LittleTurtle2333
7e922f3ec6 更新依赖 2022-04-23 01:29:21 +08:00
LittleTurtle2333
8d45df61e3 修复重启作用域后闪退 2022-04-17 17:18:58 +08:00
YifePlayte
57895c7f2c 允许下滑大多数通知变成小窗 (#145)
* 允许下滑大多数通知变成小窗

* typo

* Update strings.xml
2022-04-17 03:01:20 +08:00
LittleTurtle2333
1af01b391b 更新WooBox图标 2022-04-16 23:57:25 +08:00
LittleTurtle2333
6108f9c4ba 更新WooBox图标 2022-04-16 22:18:37 +08:00
LittleTurtle2333
d709dd87e9 Update version to 1.6.4 2022-04-16 21:42:08 +08:00
LittleTurtle2333
c0ae491954 更换WooBox图标 2022-04-16 21:35:29 +08:00
LittleTurtle2333
a9c8528671 更换WooBox图标 2022-04-16 21:34:55 +08:00
LittleTurtle2333
2761c288f8 更名为WooBox 2022-04-16 04:08:25 +08:00
LittleTurtle2333
a9cf0bcca0 Update Blockmiui 2022-04-16 01:58:09 +08:00
LittleTurtle2333
9f92186e5f Update version to 1.6.3 2022-04-14 17:12:38 +08:00
LittleTurtle2333
5197f11ecb Update Blockmiui 2022-04-14 16:59:19 +08:00
乌堆小透明
396e9bf453 New Crowdin updates (#141)
* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-04-13 23:31:37 +08:00
LittleTurtle2333
8e6485cd0f Update version to 1.6.2 2022-04-13 23:28:46 +08:00
乌堆小透明
afb3316595 New Crowdin updates (#140)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-04-13 23:28:27 +08:00
LittleTurtle2333
432ec13c05 新增允许不受信任的触摸 2022-04-13 23:24:19 +08:00
LittleTurtle2333
f2f133c5b9 优化自定义媒体音量步数功能 2022-04-13 23:23:24 +08:00
LittleTurtle2333
320a393a7c Update version to 1.6.1 2022-04-12 17:48:01 +08:00
LittleTurtle2333
117c18b45e 修复隐藏图标页面白屏 2022-04-12 17:47:40 +08:00
LittleTurtle2333
1ad1b75eff Merge remote-tracking branch 'origin/main' 2022-04-12 17:28:16 +08:00
LittleTurtle2333
201d9550d2 Update version to 1.6.0 2022-04-12 17:27:51 +08:00
乌堆小透明
1f0f2d31f2 New Crowdin updates (#139)
* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-04-12 17:27:20 +08:00
LittleTurtle2333
0d34d3a4bb 新增自定义媒体音量阶数 2022-04-12 17:24:23 +08:00
乌堆小透明
93f6eaf74d Update blockmiui to New API (#138)
* update blockmiui to New API

* 更新blockmiui
2022-04-12 15:04:35 +08:00
LittleTurtle2333
61b6dc448e Update version to 1.5.9 2022-04-10 00:19:02 +08:00
乌堆小透明
cad773ec99 New Crowdin updates (#128)
* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Thai)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin
2022-04-10 00:16:20 +08:00
LittleTurtle2333
bfda4f0df3 更新strings.xml 2022-04-05 19:28:33 +08:00
LinW_
e32718eedf 锁屏时钟显示秒数 (#132)
* 锁屏时钟显示秒数

* 锁屏时钟显示秒数

* 锁屏时钟显示秒数
2022-04-05 19:23:54 +08:00
LittleTurtle2333
b2e465ba3d 修复背屏天气显示异常 2022-04-03 21:04:21 +08:00
LittleTurtle2333
919694fce7 Update version to 1.5.8 2022-04-03 17:47:34 +08:00
乌堆小透明
f5ff3e78c4 New Crowdin updates (#127)
* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-04-03 17:46:01 +08:00
LittleTurtle2333
3619fbf4d3 新增背屏天气 2022-04-03 17:33:22 +08:00
乌堆小透明
7acd0aaff8 New Crowdin updates (#125)
* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-04-03 00:05:57 +08:00
乌堆小透明
785208c1ab New Crowdin updates (#124)
* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-04-03 00:02:18 +08:00
乌堆小透明
d108f46a19 Update Crowdin configuration file 2022-04-02 23:34:41 +08:00
LittleTurtle2333
a44a29b7b7 细分核心破解 2022-04-02 23:14:54 +08:00
LittleTurtle2333
29e9bb34ab Merge remote-tracking branch 'origin/main' 2022-04-02 22:40:28 +08:00
LittleTurtle2333
1a15df5822 自定义移动类型文本 2022-04-02 22:39:59 +08:00
乌堆小透明
dad17170ff New Crowdin updates (#122)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-04-01 21:59:33 +08:00
乌堆小透明
3aca588693 New Crowdin updates (#118)
* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-03-31 17:55:10 +08:00
LittleTurtle2333
cd731f7a21 Update version to 1.5.7 2022-03-31 17:51:20 +08:00
LittleTurtle2333
5e35cfb3e3 新增自定义状态栏通知最大点数 2022-03-31 17:12:53 +08:00
LittleTurtle2333
daa3c02d1a 更改cast hook逻辑 2022-03-31 17:00:57 +08:00
LittleTurtle2333
f83d439374 revert: 在SystemUI 启用 AppCenter (#119) 2022-03-31 17:00:18 +08:00
LittleTurtle2333
176682fa38 修复部分机型时间居中+图标居左横屏FC 2022-03-31 16:59:45 +08:00
QQ little ice
c02d9e1874 在SystemUI 启用 AppCenter (#119)
* 在SystemUI 启用 AppCenter

* 移除设置界面AppCenter

Co-authored-by: LittleTurtle2333 <lturtle2333@outlook.com>
2022-03-30 02:49:15 +08:00
LittleTurtle2333
d8baadae59 Update version to 1.5.6 2022-03-29 16:48:00 +08:00
乌堆小透明
d2035121ce New Crowdin updates (#114) 2022-03-29 16:47:42 +08:00
LittleTurtle2333
b29bfb45f9 新增自定义通知图标上限 2022-03-29 16:43:25 +08:00
LittleTurtle2333
657c65164f 新增状态栏时钟居中+图标居左布局 2022-03-29 16:15:38 +08:00
LittleTurtle2333
5c3ca4caa4 Merge remote-tracking branch 'origin/main' 2022-03-28 23:57:08 +08:00
LittleTurtle2333
08b4abf08c 新增时钟居中+图标居左(未完成) 2022-03-28 23:56:56 +08:00
CDzungx
acdbd23248 Typo fixes (#117) 2022-03-28 04:10:32 +08:00
LittleTurtle2333
2bed96532f 新增状态栏时钟居右布局 2022-03-28 03:14:02 +08:00
LittleTurtle2333
314fc7b46f Update README.md 2022-03-28 02:17:19 +08:00
LittleTurtle2333
ff94fce5d0 修复开启时钟居中对齐后上移的问题 2022-03-28 02:12:49 +08:00
LittleTurtle2333
d56d291e51 Fix Thai cannot hide network speed unit 2022-03-27 19:43:04 +08:00
LittleTurtle2333
fc1800932b Update version to 1.5.5 2022-03-27 17:15:30 +08:00
乌堆小透明
181869687e New Crowdin updates (#111)
* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-03-27 17:11:50 +08:00
LittleTurtle2333
5ee5dd71b1 双排时钟支持居中对齐 2022-03-27 16:59:49 +08:00
LittleTurtle2333
b6d8529624 修复一堆格式错误的变量名 2022-03-27 16:41:01 +08:00
YifePlayte
243bc39dd6 新增强制允许所有应用接力 (#113) 2022-03-27 12:50:51 +08:00
LittleTurtle2333
4332ac6ed8 Update README.md 2022-03-27 03:22:23 +08:00
LittleTurtle2333
8309c9a69a 修复最新MIUI内测居中布局通知异常 2022-03-27 03:08:22 +08:00
LittleTurtle2333
62561d4c34 删除冗余代码 2022-03-27 02:13:11 +08:00
QQ little ice
4c13ad4152 Use EasyXposed (#112)
* add EasyXposed

* change hook entry

* [android] use EasyXposed

* [com.miui.mediaeditor] use EasyXposed

* [com.miui.home] use EasyXposed

* [com.miui.powerkeeper] use EasyXposed

* [com.miui.screenshot] use EasyXposed

* [com.miui.securitycenter] use EasyXposed

* [com.android.settings] use EasyXposed

* [com.android.thememanager] use EasyXposed

* [com.android.systemui] use EasyXposed
2022-03-27 02:07:02 +08:00
LittleTurtle2333
6f91cab9b8 Update version to 1.5.4 2022-03-26 16:31:52 +08:00
乌堆小透明
ca2ffa4c3f New Crowdin updates (#109)
* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-03-26 16:30:41 +08:00
LittleTurtle2333
f44f095c65 修复大移动类型左右边距范围异常 2022-03-26 16:23:06 +08:00
LittleTurtle2333
68c67d139b 新增大移动类型图标自定义 2022-03-26 16:07:55 +08:00
LittleTurtle2333
2b1eaf6634 新增电池百分比大小自定义 2022-03-26 16:07:14 +08:00
LittleTurtle2333
c91a46cabb 修复部分版本下拉时钟变小 2022-03-26 14:22:36 +08:00
LittleTurtle2333
a7947d5a2f 修复一处时钟错误 2022-03-26 00:32:48 +08:00
乌堆小透明
bb8150583c New Crowdin updates (#105) 2022-03-25 15:48:15 +08:00
LittleTurtle2333
a4fe68c141 revent:新增允许下滑所有通知变成小窗 (#104) 2022-03-24 16:58:51 +08:00
LittleTurtle2333
61f64ba7bb 修复开机时的一处错误 2022-03-24 16:45:11 +08:00
YifePlayte
bfff5cc446 新增允许下滑所有通知变成小窗 (#104) 2022-03-23 14:10:02 +08:00
乌堆小透明
509fef5e06 Update version to 1.5.3 2022-03-22 20:16:50 +08:00
乌堆小透明
f88ff6db15 New Crowdin updates (#102)
* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-03-22 20:16:15 +08:00
乌堆小透明
2b352738f5 重构大移动类型功能,使其自适应 2022-03-22 20:15:15 +08:00
乌堆小透明
085b375dc6 优化大移动类型宽度 2022-03-21 20:06:35 +08:00
乌堆小透明
7c13214e2d Update version to 1.5.2 2022-03-21 19:57:48 +08:00
乌堆小透明
469f004baa New Crowdin updates (#101)
* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-03-21 19:57:26 +08:00
乌堆小透明
eec755d642 优化大移动类型对齐 2022-03-21 19:54:34 +08:00
乌堆小透明
14ca833ec1 修复未激活模块磁贴服务FC 2022-03-21 19:45:26 +08:00
乌堆小透明
8bcb89b04d 新增大移动类型图标 2022-03-21 17:55:16 +08:00
乌堆小透明
f2df033393 Merge remote-tracking branch 'origin/main' 2022-03-21 15:52:46 +08:00
乌堆小透明
ab41dea173 Update version to 1.5.1 2022-03-21 15:52:37 +08:00
乌堆小透明
7d9f45b92f New Crowdin updates (#100)
* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-03-21 15:52:25 +08:00
乌堆小透明
8c08466ed6 修复网速单位KB/MB显示错误 2022-03-21 15:47:51 +08:00
乌堆小透明
801ade5859 优化双排网速,使用主题提供单位 2022-03-21 15:41:28 +08:00
乌堆小透明
984b909197 新增双排网速对齐切换 2022-03-21 15:31:25 +08:00
乌堆小透明
0a6b114354 修复双排网速图标显示异常 2022-03-20 17:52:17 +08:00
乌堆小透明
f6653aef78 New Crowdin updates (#96)
* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-03-20 17:51:51 +08:00
乌堆小透明
1f7dbba6a8 Merge remote-tracking branch 'origin/main' 2022-03-20 17:00:00 +08:00
乌堆小透明
87a2f04b65 Update version to 1.4.9 2022-03-20 16:57:39 +08:00
乌堆小透明
25dba39daf New translations strings.xml (Chinese Simplified) (#95)
[ci skip] New translations from Crowdin
2022-03-20 16:56:52 +08:00
乌堆小透明
7ad1bcb763 New translations strings.xml (Chinese Simplified) (#94)
[ci skip] New translations from Crowdin
2022-03-20 16:53:26 +08:00
乌堆小透明
1aee169089 New Crowdin updates (#93)
* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin
2022-03-20 16:49:46 +08:00
乌堆小透明
8eb42fdf38 update strings.xml 2022-03-20 16:44:47 +08:00
乌堆小透明
fddf3ffb76 update strings.xml 2022-03-20 16:44:11 +08:00
乌堆小透明
6e4e8ed97b Merge remote-tracking branch 'origin/main' 2022-03-20 16:40:45 +08:00
乌堆小透明
e5e64821a8 新增双排网速 2022-03-20 16:40:35 +08:00
乌堆小透明
8ab8330c94 New Crowdin updates (#91) 2022-03-20 15:08:40 +08:00
乌堆小透明
7c8f061c30 双排时钟最大大小提升至9 2022-03-20 14:09:08 +08:00
乌堆小透明
406b1a740b New Crowdin updates (#90)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin
2022-03-18 18:57:36 +08:00
乌堆小透明
54e3b0ab29 Merge remote-tracking branch 'origin/main' 2022-03-18 18:57:03 +08:00
乌堆小透明
5fcb39bb58 重命名旧版快速设置自定义 2022-03-18 18:56:51 +08:00
乌堆小透明
bc9469a9b6 New Crowdin updates (#89)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin
2022-03-18 18:10:57 +08:00
乌堆小透明
61b24111f1 Update version to 1.4.8 2022-03-18 18:07:42 +08:00
乌堆小透明
a87bf7318b update strings.xml 2022-03-18 18:03:42 +08:00
乌堆小透明
9bd6aee5e9 新增旧版快速开关排列 2022-03-18 17:45:55 +08:00
乌堆小透明
dfa47653f0 修复22.3.14之后解除截屏裁切限制失效的问题 2022-03-18 00:54:32 +08:00
乌堆小透明
92b345af77 Update version to 1.4.7 2022-03-17 19:35:12 +08:00
乌堆小透明
dfd1c660f5 新增状态栏DT2S 2022-03-17 19:34:29 +08:00
乌堆小透明
d431798808 update blockmiui 2022-03-17 18:41:23 +08:00
乌堆小透明
ff95c6d782 Merge remote-tracking branch 'origin/main' 2022-03-17 18:37:01 +08:00
乌堆小透明
2f23263333 新增第三方锁屏下DT2S 2022-03-17 18:36:50 +08:00
乌堆小透明
788e46cb39 New Crowdin updates (#86)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-03-17 01:43:54 +08:00
乌堆小透明
fcfd29a86b Update version to 1.4.6 2022-03-16 17:26:28 +08:00
乌堆小透明
3d4720fc42 New Crowdin updates (#85)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin
2022-03-16 17:15:00 +08:00
乌堆小透明
2f26cedb2b update strings.xml 2022-03-16 17:06:21 +08:00
乌堆小透明
6f30dcdac5 New Crowdin updates (#83)
* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin
2022-03-16 16:57:41 +08:00
乌堆小透明
8488332cec update strings.xml 2022-03-16 16:52:52 +08:00
乌堆小透明
157e087c99 update strings.xml 2022-03-16 16:28:40 +08:00
乌堆小透明
ffdf296357 修复其他页面无重启菜单的问题 2022-03-16 16:24:39 +08:00
乌堆小透明
987f33b584 新增桌面双击锁屏 2022-03-16 16:18:38 +08:00
乌堆小透明
7cc2819307 Merge remote-tracking branch 'origin/main' 2022-03-16 15:59:52 +08:00
乌堆小透明
a6df8ff014 Update README.md 2022-03-16 15:59:41 +08:00
乌堆小透明
8c13c702e9 New translations strings.xml (Spanish) (#80)
[ci skip] New translations from Crowdin
2022-03-16 00:28:29 +08:00
uaevuon
fcf57c3796 Refine english strings.xml (#81)
* Update strings.xml

* Update strings.xml
2022-03-16 00:28:10 +08:00
乌堆小透明
830397a590 修复下拉天气版本识别问题 2022-03-15 21:36:11 +08:00
乌堆小透明
3fd32b4ec8 Update version to 1.4.5 2022-03-15 21:09:01 +08:00
乌堆小透明
7a5c39620b New Crowdin updates (#77)
* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-03-15 21:08:22 +08:00
乌堆小透明
05493d35d4 修复22.3.12后下拉天气显示异常 2022-03-15 21:02:49 +08:00
乌堆小透明
2f1930f704 update blockmiui 2022-03-15 17:45:40 +08:00
乌堆小透明
1e6eb58dab 新增隐藏状态栏图标独立页面 2022-03-15 17:34:54 +08:00
乌堆小透明
11908a7381 Update version to 1.4.4 2022-03-15 01:07:12 +08:00
乌堆小透明
117acc99f7 New Crowdin updates (#75)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-03-15 01:05:47 +08:00
Ketal
e3909c5996 Update android.yml (#76)
* Update android.yml

* Update android.yml

Co-authored-by: 乌堆小透明 <lturtle2333@outlook.com>
2022-03-15 01:05:33 +08:00
乌堆小透明
da80efc8ba 重构隐藏图标功能 2022-03-15 00:58:36 +08:00
乌堆小透明
fabbd19929 New Crowdin updates (#74)
* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-03-14 17:50:55 +08:00
乌堆小透明
e608c504fe 新增去除打开应用弹窗 2022-03-14 17:31:35 +08:00
乌堆小透明
b483ce52c8 New Crowdin updates (#73) 2022-03-14 16:06:43 +08:00
乌堆小透明
2421b5d285 Update version to 1.4.3 2022-03-14 01:55:26 +08:00
乌堆小透明
63e360cc62 修复锁屏电流开关key错误 2022-03-14 01:54:31 +08:00
乌堆小透明
d4d6605c7b New Crowdin updates (#72)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-03-14 01:53:53 +08:00
乌堆小透明
dc7e45e4ad 优化锁屏电流显示 2022-03-14 01:48:02 +08:00
乌堆小透明
df72a5f363 New Crowdin updates (#71)
* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin
2022-03-14 00:57:54 +08:00
乌堆小透明
cd0aaef385 优化锁屏电流显示 2022-03-14 00:43:00 +08:00
乌堆小透明
b71fa8a15e 删除冗余文件 2022-03-14 00:39:56 +08:00
乌堆小透明
323cb2bffa New Crowdin updates (#70)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin
2022-03-13 23:10:48 +08:00
YuKongA
029ad43508 锁屏电流:改为充电时显示电池温度 (#69)
* Feature: 锁屏电流信息展示

* 锁屏电流:改为充电时显示电池温度

* Update strings.xml

* 充满后不再显示电流
2022-03-13 22:53:50 +08:00
乌堆小透明
8c6deb16cf New Crowdin updates (#67)
* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Ukrainian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Swedish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Serbian (Cyrillic))
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Polish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Norwegian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Korean)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hebrew)
[ci skip] New translations from Crowdin

* New translations strings.xml (Finnish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Greek)
[ci skip] New translations from Crowdin

* New translations strings.xml (German)
[ci skip] New translations from Crowdin

* New translations strings.xml (Danish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Czech)
[ci skip] New translations from Crowdin

* New translations strings.xml (Catalan)
[ci skip] New translations from Crowdin

* New translations strings.xml (Arabic)
[ci skip] New translations from Crowdin

* New translations strings.xml (Afrikaans)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin
2022-03-13 21:40:59 +08:00
乌堆小透明
93bdeaba0b New Crowdin updates (#64)
* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin
2022-03-13 20:51:59 +08:00
YuKongA
d2ff9d61e7 Feature: 锁屏电流信息展示 (#65) 2022-03-13 20:50:07 +08:00
乌堆小透明
780db8dfa5 Update version to 1.4.2 2022-03-13 17:45:17 +08:00
乌堆小透明
dcc26b0e43 Merge remote-tracking branch 'origin/main' 2022-03-13 17:41:36 +08:00
乌堆小透明
eaaa802054 修复旧版通知面板天气不显示 2022-03-13 17:41:26 +08:00
乌堆小透明
99f47443eb New Crowdin updates (#63)
* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin
2022-03-13 17:29:24 +08:00
乌堆小透明
0433cbe5ab New Crowdin updates (#62)
* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (French)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin
2022-03-13 16:10:54 +08:00
168 changed files with 7107 additions and 6827 deletions

View File

@@ -13,10 +13,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: set up JDK 11 with:
submodules: 'recursive'
- name: set up JDK 17
uses: actions/setup-java@v2 uses: actions/setup-java@v2
with: with:
java-version: '11' java-version: '17'
distribution: 'temurin' distribution: 'temurin'
cache: gradle cache: gradle
- uses: actions/cache@v2 - uses: actions/cache@v2
@@ -32,24 +34,9 @@ jobs:
path: | path: |
~/.gradle/caches/build-cache-* ~/.gradle/caches/build-cache-*
key: gradle-builds-${{ github.sha }} key: gradle-builds-${{ github.sha }}
- name: Init Submodule - name: Init Submodule
run: | run: |
git submodule init git submodule init
git submodule update git submodule update
- name: Build with Gradle - name: Build with Gradle
run: bash ./gradlew assemble run: bash ./gradlew :app:packageDebug
- 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"

100
README.md
View File

@@ -1,6 +1,6 @@
<div align="center"> <div align="center">
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo"> <img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
<h1>Simplicity Tools</h1> <h1>WooBox For MIUI</h1>
<p> <p>
<b><a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README_EN.md">English</a> 丨 简体中文</b> <b><a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README_EN.md">English</a> 丨 简体中文</b>
</p> </p>
@@ -15,100 +15,12 @@
### 模块说明 ### 模块说明
仅支持MIUI13Android12其余版本可能无效,请不要安装使用。 仅支持MIUI13Android12其余版本无法使用。
目前处于开发初期阶段,功能较少,后续将逐步完善。
开发者:[酷安@乌堆小透明](http://www.coolapk.com/u/883441) 开发者:[酷安@乌堆小透明](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>
---
### 模块截图 ### 模块截图
![截图](https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/cn.jpg) ![截图](https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/cn.jpg)
@@ -128,10 +40,16 @@ Xposed仓库下载[点击此处下载最新发行版](https://github.com/Xpos
--- ---
### 第三方开源引用 ### 第三方开源引用
##### GNU General Public License v3.0
[qqlittleice/MiuiHome](https://github.com/qqlittleice/MiuiHome)
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
##### GNU General Public License v2.0 ##### GNU General Public License v2.0
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch) [LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
##### GNU Lesser General Public License v2.1 ##### GNU Lesser General Public License v2.1
[577fkj/blockmiui](https://github.com/577fkj/blockmiui) [577fkj/blockmiui](https://github.com/577fkj/blockmiui)
##### Apache License 2.0
[KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper)
--- ---

View File

@@ -1,6 +1,6 @@
<div align="center"> <div align="center">
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo"> <img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
<h1>Simplicity Tools</h1> <h1>WooBox For MIUI</h1>
<p> <p>
<b>English 丨 <a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README.md">简体中文</a></b> <b>English 丨 <a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README.md">简体中文</a></b>
</p> </p>
@@ -15,95 +15,7 @@
### Description ### Description
Only MIUI13 (Android12) is supported. The rest of the versions may not be valid, please do not install and use. Only MIUI13 (Android12) is supported. The rest of the versions not be valid.
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>
--- ---
@@ -119,16 +31,22 @@ Xposed Repo[Click here to download the latest release](https://github.com/Xpo
--- ---
### 改进翻译 ### Participate in translation
[![Crowdin](https://badges.crowdin.net/simplicitytools/localized.svg)](https://crowdin.com/project/simplicitytools)[Click here to Crowdin](https://crowdin.com/project/simplicitytools) [![Crowdin](https://badges.crowdin.net/simplicitytools/localized.svg)](https://crowdin.com/project/simplicitytools)[Click here to Crowdin](https://crowdin.com/project/simplicitytools)
--- ---
## Third party open source references ## Third party open source references
##### GNU General Public License v3.0
[qqlittleice/MiuiHome](https://github.com/qqlittleice/MiuiHome)
[yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming)
[Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer)
##### GNU General Public License v2.0 ##### GNU General Public License v2.0
[LSPosed/CorePatch](https://github.com/LSPosed/CorePatch) [LSPosed/CorePatch](https://github.com/LSPosed/CorePatch)
##### GNU Lesser General Public License v2.1 ##### GNU Lesser General Public License v2.1
[577fkj/blockmiui](https://github.com/577fkj/blockmiui) [577fkj/blockmiui](https://github.com/577fkj/blockmiui)
##### Apache License 2.0
[KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper)
--- ---

View File

@@ -6,22 +6,21 @@ plugins {
} }
android { android {
compileSdk = 32 compileSdk = 33
buildToolsVersion = "32.0.0" buildToolsVersion = "33.0.0"
defaultConfig { defaultConfig {
applicationId = "com.lt2333.simplicitytools" applicationId = "com.lt2333.simplicitytools"
minSdk = 31 minSdk = 31
targetSdk = 32 targetSdk = 33
versionCode = 42 versionCode = 67
versionName = "1.4.1" versionName = "1.6.6"
} }
buildTypes { buildTypes {
release { release {
isMinifyEnabled = true isMinifyEnabled = true
isShrinkResources = true isShrinkResources = true
setProguardFiles(listOf("proguard-rules.pro") setProguardFiles(listOf("proguard-rules.pro"))
)
} }
} }
compileOptions { compileOptions {
@@ -44,23 +43,21 @@ android {
} }
applicationVariants.all { applicationVariants.all {
outputs.all { outputs.all {
(this as BaseVariantOutputImpl).outputFileName = (this as BaseVariantOutputImpl).outputFileName = "WooBoxForMIUI-$versionName-$name.apk"
"Simplicity_Tools_Xposed-$versionName-$name.apk"
} }
} }
} }
dependencies { dependencies {
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
//API //API
compileOnly("de.robv.android.xposed:api:82") compileOnly("de.robv.android.xposed:api:82")
implementation("com.github.kyuubiran:EzXHelper:0.9.2")
//UI //UI
implementation(project(":blockmiui")) implementation(project(":blockmiui"))
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
val appCenterSdkVersion = "4.3.1" //APP Center
val appCenterSdkVersion = "4.4.3"
implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}") implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}")
implementation("com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}") implementation("com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}")
implementation("androidx.core:core-splashscreen:1.0.0-rc01")
implementation("com.github.kyuubiran:EzXHelper:0.7.4")
} }

View File

@@ -23,6 +23,12 @@
public void *(de.robv.android.xposed.callbacks.XC_LoadPackage$LoadPackageParam); 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.util.xposed.EasyXposedInit
-assumenosideeffects class kotlin.jvm.internal.Intrinsics { -assumenosideeffects class kotlin.jvm.internal.Intrinsics {
public static void check*(...); public static void check*(...);
public static void throw*(...); public static void throw*(...);

View File

@@ -21,6 +21,7 @@
</activity> </activity>
<activity-alias <activity-alias
android:label="WooBox"
android:name=".launcher" android:name=".launcher"
android:enabled="true" android:enabled="true"
android:exported="true" android:exported="true"

View File

@@ -1 +1 @@
com.lt2333.simplicitytools.hook.MainHook com.lt2333.simplicitytools.hook.XposedEntry

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -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)
}
}
}
}

View File

@@ -0,0 +1,41 @@
package com.lt2333.simplicitytools.hook
import com.lt2333.simplicitytools.BuildConfig
import com.lt2333.simplicitytools.hook.app.*
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatch
import com.lt2333.simplicitytools.util.xposed.EasyXposedInit
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.IXposedHookZygoteInit
import de.robv.android.xposed.XSharedPreferences
import de.robv.android.xposed.callbacks.XC_LoadPackage
class XposedEntry : 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, //背屏
)
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)
CorePatch().initZygote(startupParam)
}
}

View File

@@ -1,26 +1,26 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.android.DeleteOnPostNotification import com.lt2333.simplicitytools.hook.app.android.*
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 com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatch
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.callbacks.XC_LoadPackage import de.robv.android.xposed.callbacks.XC_LoadPackage
class Android : IXposedHookLoadPackage { object Android : AppRegister() {
override val packageName: String = "android"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
//核心破解 //核心破解
CorePatch().handleLoadPackage(lpparam) CorePatch().handleLoadPackage(lpparam)
//允许截图
DisableFlagSecure().handleLoadPackage(lpparam) autoInitHooks(
//上层显示 lpparam,
DeleteOnPostNotification().handleLoadPackage(lpparam) DisableFlagSecure, //允许截图
//解除小窗限制 DeleteOnPostNotification, //上层显示
RemoveSmallWindowRestrictions().handleLoadPackage(lpparam) RemoveSmallWindowRestrictions, //解除小窗限制
//壁纸缩放比例 MaxWallpaperScale, //壁纸缩放比例
MaxWallpaperScale().handleLoadPackage(lpparam) SystemPropertiesHook, //SystemPropertiesHook
AllowUntrustedTouches, //允许不受信任的触摸
)
} }
} }

View File

@@ -0,0 +1,15 @@
package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.cast.ForceSupportSendApp
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage
object Cast: AppRegister() {
override val packageName: String = "com.milink.service"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
autoInitHooks(lpparam,
ForceSupportSendApp, //强制允许所有应用接力
)
}
}

View File

@@ -1,14 +1,15 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.mediaeditor.UnlockUnlimitedCropping import com.lt2333.simplicitytools.hook.app.mediaeditor.UnlockUnlimitedCropping
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.XposedBridge import de.robv.android.xposed.callbacks.XC_LoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
class MediaEditor : IXposedHookLoadPackage { object MediaEditor: AppRegister() {
override fun handleLoadPackage(lpparam: LoadPackageParam) { override val packageName: String = "com.miui.mediaeditor"
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
//解锁裁切最小值 override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
UnlockUnlimitedCropping().handleLoadPackage(lpparam) autoInitHooks(lpparam,
UnlockUnlimitedCropping, //解锁裁切最小值
)
} }
} }

View File

@@ -1,14 +1,17 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.miuihome.AlwaysDisplayTime import com.lt2333.simplicitytools.hook.app.miuihome.AlwaysDisplayTime
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.hook.app.miuihome.DoubleTapToSleep
import de.robv.android.xposed.XposedBridge import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam import de.robv.android.xposed.callbacks.XC_LoadPackage
class MiuiHome : IXposedHookLoadPackage { object MiuiHome: AppRegister() {
override fun handleLoadPackage(lpparam: LoadPackageParam) { override val packageName: String = "com.miui.home"
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
//时钟显示时钟 override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
AlwaysDisplayTime().handleLoadPackage(lpparam) autoInitHooks(lpparam,
AlwaysDisplayTime, //时钟显示时钟
DoubleTapToSleep, //双击锁屏
)
} }
} }

View File

@@ -2,18 +2,16 @@ package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.powerkeeper.LockMaxFps import com.lt2333.simplicitytools.hook.app.powerkeeper.LockMaxFps
import com.lt2333.simplicitytools.hook.app.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelist import com.lt2333.simplicitytools.hook.app.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelist
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.XposedBridge import de.robv.android.xposed.callbacks.XC_LoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
class PowerKeeper : IXposedHookLoadPackage { object PowerKeeper: AppRegister() {
override val packageName: String = "com.miui.powerkeeper"
override fun handleLoadPackage(lpparam: LoadPackageParam) {
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
//锁定最高刷新率
LockMaxFps().handleLoadPackage(lpparam)
//防止恢复电池优化白名单
PreventRecoveryOfBatteryOptimizationWhitelist().handleLoadPackage(lpparam)
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
autoInitHooks(lpparam,
LockMaxFps, //锁定最高刷新率
PreventRecoveryOfBatteryOptimizationWhitelist, //防止恢复电池优化白名单
)
} }
} }

View File

@@ -0,0 +1,15 @@
package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.reardisplay.RearDisplayWeather
import com.lt2333.simplicitytools.util.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) {
autoInitHooks(lpparam,
RearDisplayWeather, //背屏显示天气
)
}
}

View File

@@ -0,0 +1,15 @@
package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.screenshot.UnlockUnlimitedCropping
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage
object ScreenShot: AppRegister() {
override val packageName: String = "com.miui.screenshot"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
autoInitHooks(lpparam,
UnlockUnlimitedCropping, //锁定最高刷新率
)
}
}

View File

@@ -1,24 +1,19 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.securitycenter.LockOneHundred import com.lt2333.simplicitytools.hook.app.securitycenter.*
import com.lt2333.simplicitytools.hook.app.securitycenter.RemoveMacroBlacklist import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import com.lt2333.simplicitytools.hook.app.securitycenter.ShowBatteryTemperature import de.robv.android.xposed.callbacks.XC_LoadPackage
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 { object SecurityCenter: AppRegister() {
override val packageName: String = "com.miui.securitycenter"
override fun handleLoadPackage(lpparam: LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName) autoInitHooks(lpparam,
//跳过 5/10秒等待时间 SkipWaitingTime, //跳过 5/10秒等待时间
SkipWaitingTime().handleLoadPackage(lpparam) LockOneHundred, //锁定 100分
//锁定 100分 RemoveMacroBlacklist, //去除自动连招黑名单
LockOneHundred().handleLoadPackage(lpparam) ShowBatteryTemperature, //显示电池温度
//去除自动连招黑名单 RemoveOpenAppConfirmationPopup, //去除打开应用弹窗
RemoveMacroBlacklist().handleLoadPackage(lpparam) )
//显示电池温度
ShowBatteryTemperature().handleLoadPackage(lpparam)
} }
} }

View File

@@ -1,13 +1,15 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.settings.ShowNotificationImportance import com.lt2333.simplicitytools.hook.app.settings.ShowNotificationImportance
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.callbacks.XC_LoadPackage import de.robv.android.xposed.callbacks.XC_LoadPackage
class Settings: IXposedHookLoadPackage { object Settings: AppRegister() {
override val packageName: String = "com.android.settings"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName) autoInitHooks(lpparam,
ShowNotificationImportance().handleLoadPackage(lpparam) ShowNotificationImportance, //显示通知重要程度
)
} }
} }

View File

@@ -1,75 +1,45 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.systemui.* import com.lt2333.simplicitytools.hook.app.systemui.*
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.XposedBridge import de.robv.android.xposed.callbacks.XC_LoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
class SystemUI : IXposedHookLoadPackage { object SystemUI: AppRegister() {
override val packageName: String = "com.android.systemui"
override fun handleLoadPackage(lpparam: LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName) autoInitHooks(lpparam,
//隐藏飞行模式图标 HideStatusBarIcon, //隐藏状态栏图标
HideAirplaneIcon().handleLoadPackage(lpparam) HideBatteryIcon, //隐藏电池
//隐藏闹钟图标 HideHDIcon, //隐藏HD图标
HideAlarmIcon().handleLoadPackage(lpparam) HideSimIcon, //隐藏SIM卡图标
//隐藏电池 HideMobileActivityIcon, //隐藏移动箭头图标
HideBatteryIcon().handleLoadPackage(lpparam) HideMobileTypeIcon, //隐藏移动类型图标
//隐藏蓝牙电量 HideStatusBarNetworkSpeedSecond, //隐藏状态栏网速/s
HideBluetoothHandsfreeBatteryIcon().handleLoadPackage(lpparam) HideWifiActivityIcon, //隐藏WIFI活动箭头图标
//隐藏蓝牙图标 MaximumNumberOfNotificationIcons, //通知图标上限
HideBluetoothIcon().handleLoadPackage(lpparam) StatusBarNetworkSpeedRefreshSpeed, //状态栏网速秒刷新
//隐藏GPS图标 StatusBarTimeCustomization, //状态栏时钟自定义
HideGPSIcon().handleLoadPackage(lpparam) RemoveTheLeftSideOfTheLockScreen, //移除锁屏负一屏功能
//隐藏HD图标 RemoveLockScreenCamera, //移除锁屏相机功能
HideHDIcon().handleLoadPackage(lpparam) NotificationWeather, //通知面板天气
//隐藏耳机图标 OldNotificationWeather,
HideHeadsetIcon().handleLoadPackage(lpparam) ControlCenterWeather, //控制中心天气
//隐藏热点图标 //StatusBarCurrent, //TODO状态栏电流
HideHotspotIcon().handleLoadPackage(lpparam) StatusBarLayout, //状态栏布局
//隐藏无SIM卡图标 HideNetworkSpeedSplitter, //隐藏时钟与实时网速之间的分隔符
HideNoSimIcon().handleLoadPackage(lpparam) WaveCharge, //Alpha充电动画
//隐藏SIM卡图标 LockScreenCurrent, //锁屏电流
HideSimIcon().handleLoadPackage(lpparam) LockScreenDoubleTapToSleep, //锁屏下双击锁屏
//隐藏移动箭头图标 StatusBarDoubleTapToSleep, //双击状态栏锁屏
HideMobileActivityIcon().handleLoadPackage(lpparam) OldQSCustom, //旧版快速设置自定义
//隐藏移动类型图标 DoubleLineNetworkSpeed, //双排网速
HideMobileTypeIcon().handleLoadPackage(lpparam) StatusBarBigMobileTypeIcon, //大移动类型
//隐藏辅助WIFI图标 BatteryPercentage, //电量百分比
HideSlaveWifiIcon().handleLoadPackage(lpparam) CustomMobileTypeText, //自定义移动类型文本
//隐藏状态栏网速/s CanNotificationSlide, //允许下滑通知打开小窗
HideStatusBarNetworkSpeedSecond().handleLoadPackage(lpparam) LockScreenClockDisplaySeconds, // 锁屏时钟显示秒
//隐藏音量勿扰图 ShowWifiStandard, // 显示 WIFI 角
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)
} }
}
}

View File

@@ -1,14 +1,15 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.hook.app.thememanager.RemoveAds import com.lt2333.simplicitytools.hook.app.thememanager.RemoveAds
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.XposedBridge import de.robv.android.xposed.callbacks.XC_LoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
class ThemeManager : IXposedHookLoadPackage { object ThemeManager: AppRegister() {
override fun handleLoadPackage(lpparam: LoadPackageParam) { override val packageName: String = "com.android.thememanager"
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
//移除主题壁纸的广告 override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
RemoveAds().handleLoadPackage(lpparam) autoInitHooks(lpparam,
RemoveAds, //移除主题壁纸的广告
)
} }
} }

View File

@@ -1,27 +1,23 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
import de.robv.android.xposed.IXposedHookLoadPackage import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull
import de.robv.android.xposed.XposedHelpers import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage import de.robv.android.xposed.callbacks.XC_LoadPackage
class Updater : IXposedHookLoadPackage { object Updater : AppRegister() {
override val packageName: String = "com.android.updater"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
if (XSPUtils.getBoolean("remove_ota_validate", false)) {
var letter = 'a' hasEnable("remove_ota_validate") {
for (i in 0..25) { Array(26) { "com.android.updater.common.utils.${'a' + it}" }
val classIfExists = XposedHelpers.findClassIfExists( .mapNotNull { loadClassOrNull(it) }
"com.android.updater.common.utils.$letter", lpparam.classLoader .firstOrNull() { it.declaredFields.size >= 9 && it.declaredMethods.size > 60 }
) ?: continue ?.findMethod { name == "T" && returnType == Boolean::class.java }
if (classIfExists.declaredFields.size >= 9 && classIfExists.declaredMethods.size > 60) { ?.hookReturnConstant(false)
classIfExists.hookBeforeMethod("T") {
it.result = false
}
return
}
letter++
}
} }
} }
} }

View File

@@ -0,0 +1,16 @@
package com.lt2333.simplicitytools.hook.app.android
import android.content.Context
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object AllowUntrustedTouches : HookRegister() {
override fun init() = hasEnable("allow_untrusted_touches") {
findMethod("android.hardware.input.InputManager") {
name == "getBlockUntrustedTouchesMode" && parameterTypes[0] == Context::class.java
}.hookReturnConstant(0)
}
}

View File

@@ -1,16 +1,19 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class DeleteOnPostNotification : IXposedHookLoadPackage { object DeleteOnPostNotification : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun init() {
"com.android.server.wm.AlertWindowNotification".hookBeforeMethod(lpparam.classLoader, "onPostNotification") { findMethod("com.android.server.wm.AlertWindowNotification") {
name == "onPostNotification"
}.hookBefore {
hasEnable("delete_on_post_notification") { hasEnable("delete_on_post_notification") {
it.result = null it.result = null
} }
} }
} }
} }

View File

@@ -1,16 +1,19 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class DisableFlagSecure : IXposedHookLoadPackage { object DisableFlagSecure : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun init() {
"com.android.server.wm.WindowState".hookBeforeMethod(lpparam.classLoader, "isSecureLocked") { findMethod("com.android.server.wm.WindowState") {
name == "isSecureLocked"
}.hookBefore {
hasEnable("disable_flag_secure") { hasEnable("disable_flag_secure") {
it.result = false it.result = false
} }
} }
} }
} }

View File

@@ -1,24 +1,19 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import android.app.Service import com.github.kyuubiran.ezxhelper.utils.findMethod
import android.icu.text.DisplayContext import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
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 { object MaxWallpaperScale : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun init() {
"com.android.server.wm.WallpaperController".hookAfterMethod(lpparam.classLoader, "WallpaperController", Service::class.java, DisplayContext::class.java findMethod("com.android.server.wm.WallpaperController") {
) { name == "zoomOutToScale" && parameterTypes[0] == Float::class.java
}.hookBefore {
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f) val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
it.thisObject.setFloatField("mMaxWallpaperScale", value) it.thisObject.putObject("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)
} }
} }
} }

View File

@@ -1,39 +1,46 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import android.content.Context import android.content.Context
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
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) {
object RemoveSmallWindowRestrictions : HookRegister() {
override fun init() {
// 强制所有活动设为可以调整大小 // 强制所有活动设为可以调整大小
"com.android.server.wm.Task".hookBeforeMethod(lpparam.classLoader, "isResizeable") { findMethod("com.android.server.wm.Task") {
name == "isResizeable"
}.hookBefore {
hasEnable("remove_small_window_restrictions") { hasEnable("remove_small_window_restrictions") {
it.result = true it.result = true
} }
} }
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(lpparam.classLoader, "getFreeformBlackList") { findMethod("android.util.MiuiMultiWindowAdapter") {
name == "getFreeformBlackList"
}.hookAfter {
hasEnable("remove_small_window_restrictions") { hasEnable("remove_small_window_restrictions") {
it.result = (it.result as MutableList<*>).apply { clear() } it.result = (it.result as MutableList<*>).apply { clear() }
} }
} }
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(lpparam.classLoader, "getFreeformBlackListFromCloud", Context::class.java) { findMethod("android.util.MiuiMultiWindowAdapter") {
name == "getFreeformBlackListFromCloud" && parameterTypes[0] == Context::class.java
}.hookAfter {
hasEnable("remove_small_window_restrictions") { hasEnable("remove_small_window_restrictions") {
it.result = (it.result as MutableList<*>).apply { clear() } it.result = (it.result as MutableList<*>).apply { clear() }
} }
} }
"android.util.MiuiMultiWindowUtils".hookAfterMethod(lpparam.classLoader, "supportFreeform") { findMethod("android.util.MiuiMultiWindowUtils") {
name == "supportFreeform"
}.hookAfter {
hasEnable("remove_small_window_restrictions") { hasEnable("remove_small_window_restrictions") {
it.result = true it.result = true
} }
} }
} }
} }

View File

@@ -0,0 +1,22 @@
package com.lt2333.simplicitytools.hook.app.android
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object SystemPropertiesHook : HookRegister() {
override fun init() {
val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false)
val mediaSteps = XSPUtils.getInt("media_volume_steps", 15)
findMethod("android.os.SystemProperties") {
name == "getInt" && returnType == Int::class.java
}.hookBefore {
when (it.args[0] as String) {
"ro.config.media_vol_steps" -> if (mediaStepsSwitch) it.result = mediaSteps
}
}
}
}

View File

@@ -5,7 +5,10 @@
package com.lt2333.simplicitytools.hook.app.android.corepatch; package com.lt2333.simplicitytools.hook.app.android.corepatch;
import android.app.AndroidAppHelper;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature; import android.content.pm.Signature;
import com.lt2333.simplicitytools.BuildConfig; import com.lt2333.simplicitytools.BuildConfig;
@@ -14,18 +17,22 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.security.cert.Certificate; import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import de.robv.android.xposed.IXposedHookLoadPackage; 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_MethodHook;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XSharedPreferences; import de.robv.android.xposed.XSharedPreferences;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers; import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage; import de.robv.android.xposed.callbacks.XC_LoadPackage;
public class CorePatch extends XposedHelper implements IXposedHookLoadPackage { public class CorePatch extends XposedHelper implements IXposedHookLoadPackage, IXposedHookZygoteInit {
XSharedPreferences prefs = new XSharedPreferences(BuildConfig.APPLICATION_ID, "config"); XSharedPreferences prefs = new XSharedPreferences(BuildConfig.APPLICATION_ID, "config");
String TAG = "ST-CorePatch";
@Override @Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws IllegalAccessException, InvocationTargetException, InstantiationException { public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws IllegalAccessException, InvocationTargetException, InstantiationException {
@@ -35,27 +42,37 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
"checkDowngrade", "checkDowngrade",
"com.android.server.pm.parsing.pkg.AndroidPackage", "com.android.server.pm.parsing.pkg.AndroidPackage",
"android.content.pm.PackageInfoLite", "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校验会失败 // apk内文件修改后 digest校验会失败
hookAllMethods("android.util.jar.StrictJarVerifier", loadPackageParam.classLoader, "verifyMessageDigest", 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", 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", 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" // Targeting R+ (version " + Build.VERSION_CODES.R + " and above) requires"
// + " the resources.arsc of installed APKs to be stored uncompressed" // + " the resources.arsc of installed APKs to be stored uncompressed"
// + " and aligned on a 4-byte boundary // + " and aligned on a 4-byte boundary
// target >=30 的情况下 resources.arsc 必须是未压缩的且4K对齐 // target >=30 的情况下 resources.arsc 必须是未压缩的且4K对齐
hookAllMethods("android.content.res.AssetManager", loadPackageParam.classLoader, "containsAllocatedTable", 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 // No signature found in package of version " + minSignatureSchemeVersion
// + " or newer for package " + apkPath // + " or newer for package " + apkPath
findAndHookMethod("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "getMinimumSignatureSchemeVersionForTargetSdk", int.class, 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!" // Package " + packageName + " signatures do not match previously installed version; ignoring!"
// public boolean checkCapability(String sha256String, @CertCapabilities int flags) { // public boolean checkCapability(String sha256String, @CertCapabilities int flags) {
@@ -66,7 +83,7 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
// Don't handle PERMISSION (grant SIGNATURE permissions to pkgs with this cert) // Don't handle PERMISSION (grant SIGNATURE permissions to pkgs with this cert)
// Or applications will have all privileged permissions // 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 // 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) { if ((Integer) param.args[1] != 4) {
param.setResult(true); param.setResult(true);
} }
@@ -91,20 +108,45 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
error.setAccessible(true); error.setAccessible(true);
Object[] signingDetailsArgs = new Object[2]; Object[] signingDetailsArgs = new Object[2];
signingDetailsArgs[1] = 1; signingDetailsArgs[1] = 1;
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() { hookAllMethods("android.util.apk.ApkSignatureVerifier", loadPackageParam.classLoader, "verifyV1Signature", new XC_MethodHook() {
public void afterHookedMethod(MethodHookParam methodHookParam) throws Throwable { public void afterHookedMethod(MethodHookParam methodHookParam) throws Throwable {
super.afterHookedMethod(methodHookParam); super.afterHookedMethod(methodHookParam);
if (prefs.getBoolean("corepatch", true)) { if (prefs.getBoolean("authcreak", true)) {
Throwable throwable = methodHookParam.getThrowable(); Throwable throwable = methodHookParam.getThrowable();
if (throwable != null) { if (throwable != null) {
Signature[] lastSigs = null; Signature[] lastSigs = null;
if (prefs.getBoolean("corepatch", true)) { 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 = PM.getPackageArchiveInfo((String) methodHookParam.args[0], 0);
PackageInfo InstpI = PM.getPackageInfo(pI.packageName, PackageManager.GET_SIGNATURES);
lastSigs = InstpI.signatures;
}
}else {
if(prefs.getBoolean("digestCreak", true)) {
final Object origJarFile = constructorExact.newInstance(methodHookParam.args[0], true, false); final Object origJarFile = constructorExact.newInstance(methodHookParam.args[0], true, false);
final ZipEntry manifestEntry = (ZipEntry) XposedHelpers.callMethod(origJarFile, "findEntry", "AndroidManifest.xml"); final ZipEntry manifestEntry = (ZipEntry) XposedHelpers.callMethod(origJarFile, "findEntry", "AndroidManifest.xml");
final Certificate[][] lastCerts = (Certificate[][]) XposedHelpers.callStaticMethod(ASV, "loadCertificates", origJarFile, manifestEntry); final Certificate[][] lastCerts = (Certificate[][]) XposedHelpers.callStaticMethod(ASV, "loadCertificates", origJarFile, manifestEntry);
lastSigs = (Signature[]) XposedHelpers.callStaticMethod(ASV, "convertToSignatures", (Object) lastCerts); lastSigs = (Signature[]) XposedHelpers.callStaticMethod(ASV, "convertToSignatures", (Object) lastCerts);
} }
}
if (lastSigs != null) { if (lastSigs != null) {
signingDetailsArgs[0] = lastSigs; signingDetailsArgs[0] = lastSigs;
} else { } else {
@@ -117,7 +159,7 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
if (signingDetailsWithDigests != null) { if (signingDetailsWithDigests != null) {
Constructor<?> signingDetailsWithDigestsConstructorExact = XposedHelpers.findConstructorExact(signingDetailsWithDigests, signingDetails, Map.class); Constructor<?> signingDetailsWithDigestsConstructorExact = XposedHelpers.findConstructorExact(signingDetailsWithDigests, signingDetails, Map.class);
signingDetailsWithDigestsConstructorExact.setAccessible(true); signingDetailsWithDigestsConstructorExact.setAccessible(true);
newInstance = signingDetailsWithDigestsConstructorExact.newInstance(newInstance, null); newInstance = signingDetailsWithDigestsConstructorExact.newInstance(new Object[]{newInstance, null});
} }
Throwable cause = throwable.getCause(); Throwable cause = throwable.getCause();
@@ -145,7 +187,7 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
// Don't handle PERMISSION (grant SIGNATURE permissions to pkgs with this cert) // Don't handle PERMISSION (grant SIGNATURE permissions to pkgs with this cert)
// Or applications will have all privileged permissions // 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 // 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); param.setResult(true);
} }
} }
@@ -155,7 +197,7 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
@Override @Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
super.beforeHookedMethod(param); super.beforeHookedMethod(param);
if (prefs.getBoolean("corepatch", true)) { if (prefs.getBoolean("digestCreak", true)) {
ApplicationInfo info = (ApplicationInfo) param.thisObject; ApplicationInfo info = (ApplicationInfo) param.thisObject;
if ((info.flags & ApplicationInfo.FLAG_SYSTEM) != 0 if ((info.flags & ApplicationInfo.FLAG_SYSTEM) != 0
|| (info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) { || (info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
@@ -164,6 +206,36 @@ public class CorePatch extends XposedHelper implements IXposedHookLoadPackage {
} }
} }
}); });
if (prefs.getBoolean("digestCreak", true) && prefs.getBoolean("UsePreSig", false)) {
Class<?> pmClass = findClass("com.android.server.pm.PackageManagerService", loadPackageParam.classLoader);
Class<?> pPClass = findClass("com.android.server.pm.parsing.pkg.ParsedPackage", loadPackageParam.classLoader);
XposedHelpers.findAndHookMethod(pmClass, "doesSignatureMatchForPermissions", String.class, pPClass, 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);
}
}
}
});
}
} }
} @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;
}
}
});
}
}

View File

@@ -18,7 +18,7 @@ public class ReturnConstant extends XC_MethodHook {
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
super.beforeHookedMethod(param); super.beforeHookedMethod(param);
prefs.reload(); prefs.reload();
if (prefs.getBoolean(prefsKey, true)) { if (prefs.getBoolean(prefsKey, false)) {
param.setResult(value); param.setResult(value);
} }
} }

View File

@@ -0,0 +1,17 @@
package com.lt2333.simplicitytools.hook.app.cast
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object ForceSupportSendApp : HookRegister() {
override fun init() = hasEnable("force_support_send_app") {
findMethod("com.xiaomi.mirror.synergy.MiuiSynergySdk") {
name == "isSupportSendApp"
}.hookAfter {
it.result = true
}
}
}

View File

@@ -1,43 +1,29 @@
package com.lt2333.simplicitytools.hook.app.mediaeditor package com.lt2333.simplicitytools.hook.app.mediaeditor
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.findMethod
import de.robv.android.xposed.IXposedHookLoadPackage import com.github.kyuubiran.ezxhelper.utils.hookBefore
import de.robv.android.xposed.XC_MethodHook import com.lt2333.simplicitytools.util.hasEnable
import de.robv.android.xposed.XposedHelpers import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage
class UnlockUnlimitedCropping :IXposedHookLoadPackage { object UnlockUnlimitedCropping : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
override fun init() {
//解锁图库裁切最小值 //解锁图库裁切最小值
val classIfExists = XposedHelpers.findClassIfExists( findMethod("com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector") {
"com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector", name == "calculateMinSize"
lpparam.classLoader }.hookBefore {
) hasEnable("unlock_unlimited_cropping") {
XposedHelpers.findAndHookMethod( it.result = 0
classIfExists, }
"calculateMinSize", }
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (XSPUtils.getBoolean("unlock_unlimited_cropping",false)) {
param.result = 0
}
}
})
//截图无限裁切 //截图无限裁切
val classIfExists2 = XposedHelpers.findClassIfExists( findMethod("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector") {
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector", name == "calculateMinSize"
lpparam.classLoader }.hookBefore {
) hasEnable("unlock_unlimited_cropping") {
it.result = 0
XposedHelpers.findAndHookMethod( }
classIfExists2, }
"calculateMinSize",
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (XSPUtils.getBoolean("unlock_unlimited_cropping",false)) {
param.result = 0
}
}
})
} }
} }

View File

@@ -1,26 +1,20 @@
package com.lt2333.simplicitytools.hook.app.miuihome package com.lt2333.simplicitytools.hook.app.miuihome
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.findMethod
import de.robv.android.xposed.IXposedHookLoadPackage import com.github.kyuubiran.ezxhelper.utils.hookBefore
import de.robv.android.xposed.XC_MethodHook import com.lt2333.simplicitytools.util.hasEnable
import de.robv.android.xposed.XposedHelpers import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage
class AlwaysDisplayTime : IXposedHookLoadPackage { object AlwaysDisplayTime : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val classIfExists = XposedHelpers.findClassIfExists( override fun init() {
"com.miui.home.launcher.Workspace", findMethod("com.miui.home.launcher.Workspace") {
lpparam.classLoader name == "isScreenHasClockGadget" && parameterCount == 1
) }.hookBefore {
XposedHelpers.findAndHookMethod( hasEnable("home_time") {
classIfExists, it.result = false
"isScreenHasClockGadget", Long::class.javaPrimitiveType, }
object : XC_MethodHook() { }
override fun beforeHookedMethod(param: MethodHookParam) {
if (XSPUtils.getBoolean("home_time", false)) {
param.result = false
}
}
})
} }
} }

View File

@@ -0,0 +1,52 @@
package com.lt2333.simplicitytools.hook.app.miuihome
import android.content.Context
import android.os.SystemClock
import android.view.MotionEvent
import android.view.ViewConfiguration
import kotlin.math.abs
class DoubleTapController internal constructor(mContext: Context) {
private val maxDuration: Long = 500
private var mActionDownRawX: Float = 0f
private var mActionDownRawY: Float = 0f
private var mClickCount: Int = 0
private var mFirstClickRawX: Float = 0f
private var mFirstClickRawY: Float = 0f
private var mLastClickTime: Long = 0
private val mTouchSlop: Int = ViewConfiguration.get(mContext).scaledTouchSlop * 2
fun isDoubleTapEvent(motionEvent: MotionEvent): Boolean {
val action = motionEvent.actionMasked
return when {
action == MotionEvent.ACTION_DOWN -> {
mActionDownRawX = motionEvent.rawX
mActionDownRawY = motionEvent.rawY
false
}
action != MotionEvent.ACTION_UP -> false
else -> {
val rawX = motionEvent.rawX
val rawY = motionEvent.rawY
if (abs(rawX - mActionDownRawX) <= mTouchSlop.toFloat() && abs(rawY - mActionDownRawY) <= mTouchSlop.toFloat()) {
if (SystemClock.elapsedRealtime() - mLastClickTime > maxDuration || rawY - mFirstClickRawY > mTouchSlop.toFloat() || rawX - mFirstClickRawX > mTouchSlop.toFloat()) mClickCount =
0
mClickCount++
if (mClickCount == 1) {
mFirstClickRawX = rawX
mFirstClickRawY = rawY
mLastClickTime = SystemClock.elapsedRealtime()
return false
} else if (abs(rawY - mFirstClickRawY) <= mTouchSlop.toFloat() && abs(rawX - mFirstClickRawX) <= mTouchSlop.toFloat() && SystemClock.elapsedRealtime() - mLastClickTime <= maxDuration
) {
mClickCount = 0
return true
}
}
mClickCount = 0
false
}
}
}
}

View File

@@ -0,0 +1,47 @@
package com.lt2333.simplicitytools.hook.app.miuihome
import android.content.Context
import android.content.Intent
import android.view.MotionEvent
import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers
object DoubleTapToSleep : HookRegister() {
override fun init() = hasEnable("double_tap_to_sleep") {
hookAllConstructorAfter("com.miui.home.launcher.Workspace") {
var mDoubleTapControllerEx =
XposedHelpers.getAdditionalInstanceField(it.thisObject, "mDoubleTapControllerEx")
if (mDoubleTapControllerEx != null) return@hookAllConstructorAfter
mDoubleTapControllerEx = DoubleTapController((it.args[0] as Context))
XposedHelpers.setAdditionalInstanceField(
it.thisObject,
"mDoubleTapControllerEx",
mDoubleTapControllerEx
)
}
findMethod("com.miui.home.launcher.Workspace") {
name == "dispatchTouchEvent" && parameterTypes[0] == MotionEvent::class.java
}.hookBefore {
val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField(
it.thisObject,
"mDoubleTapControllerEx"
) as DoubleTapController
if (!mDoubleTapControllerEx.isDoubleTapEvent(it.args[0] as MotionEvent)) return@hookBefore
val mCurrentScreenIndex = it.thisObject.getObject("mCurrentScreenIndex") as Int
val cellLayout = it.thisObject.invokeMethodAuto("getCellLayout", mCurrentScreenIndex)
if (cellLayout != null) if (cellLayout.invokeMethodAuto("lastDownOnOccupiedCell") as Boolean) return@hookBefore
if (it.thisObject.invokeMethodAuto("isInNormalEditingMode") as Boolean) return@hookBefore
val context = it.thisObject.invokeMethodAuto("getContext") as Context
context.sendBroadcast(
Intent("com.miui.app.ExtraStatusBarManager.action_TRIGGER_TOGGLE").putExtra(
"com.miui.app.ExtraStatusBarManager.extra_TOGGLE_ID",
10
)
)
}
}
}

View File

@@ -1,28 +1,20 @@
package com.lt2333.simplicitytools.hook.app.powerkeeper package com.lt2333.simplicitytools.hook.app.powerkeeper
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.findMethod
import de.robv.android.xposed.IXposedHookLoadPackage import com.github.kyuubiran.ezxhelper.utils.hookBefore
import de.robv.android.xposed.XC_MethodHook import com.lt2333.simplicitytools.util.hasEnable
import de.robv.android.xposed.XposedHelpers import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage
class LockMaxFps : IXposedHookLoadPackage { object LockMaxFps : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val classIfExists = XposedHelpers.findClassIfExists( override fun init() {
"com.miui.powerkeeper.statemachine.DisplayFrameSetting", findMethod("com.miui.powerkeeper.statemachine.DisplayFrameSetting") {
lpparam.classLoader name == "setScreenEffect" && parameterCount == 3
) }.hookBefore {
XposedHelpers.findAndHookMethod( hasEnable("lock_max_fps") {
classIfExists, it.result = null
"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
}
}
})
} }
} }

View File

@@ -1,31 +1,22 @@
package com.lt2333.simplicitytools.hook.app.powerkeeper package com.lt2333.simplicitytools.hook.app.powerkeeper
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.findMethod
import de.robv.android.xposed.IXposedHookLoadPackage import com.github.kyuubiran.ezxhelper.utils.hookBefore
import de.robv.android.xposed.XC_MethodHook import com.lt2333.simplicitytools.util.hasEnable
import de.robv.android.xposed.XposedHelpers import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage
class PreventRecoveryOfBatteryOptimizationWhitelist : IXposedHookLoadPackage { object PreventRecoveryOfBatteryOptimizationWhitelist : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val classIfExists = XposedHelpers.findClassIfExists( override fun init() {
"com.miui.powerkeeper.statemachine.ForceDozeController", findMethod(
lpparam.classLoader "com.miui.powerkeeper.statemachine.ForceDozeController"
) ) {
XposedHelpers.findAndHookMethod( name == "restoreWhiteListAppsIfQuitForceIdle"
classIfExists, }.hookBefore {
"restoreWhiteListAppsIfQuitForceIdle", hasEnable("prevent_recovery_of_battery_optimization_white_list") {
object : XC_MethodHook() { it.result = null
override fun beforeHookedMethod(param: MethodHookParam) { }
super.beforeHookedMethod(param) }
if (XSPUtils.getBoolean(
"prevent_recovery_of_battery_optimization_white_list",
false
)
) {
param.result = null
}
}
})
} }
} }

View File

@@ -0,0 +1,102 @@
package com.lt2333.simplicitytools.hook.app.reardisplay
import android.graphics.Typeface
import android.util.TypedValue
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.widget.RelativeLayout
import android.widget.TextView
import cn.fkj233.ui.activity.dp2px
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.view.WeatherView
object RearDisplayWeather : HookRegister() {
override fun init() = hasEnable("rear_show_weather") {
findMethod("com.xiaomi.misubscreenui.light.aod.view.VerticalClockView") {
name == "onFinishInflate"
}.hookAfter {
val viewGroup = it.thisObject as ViewGroup
val context = viewGroup.context
//获取原组件
val gradientLayoutID =
context.resources.getIdentifier("gradient_layout", "id", context.packageName)
val gradientLayout: ViewGroup = viewGroup.findViewById(gradientLayoutID)
val dateID = context.resources.getIdentifier("date", "id", context.packageName)
val date: TextView = viewGroup.findViewById(dateID)
//创建天气组件
val mWeatherView = WeatherView(context, false).apply {
gravity = Gravity.END
setTextAppearance(
context.resources.getIdentifier(
"Sub_Screen_Aod_date_s",
"style",
context.packageName
)
)
typeface = Typeface.create("mipro-medium", Typeface.NORMAL)
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12f)
}
gradientLayout.addView(mWeatherView, (gradientLayout.indexOfChild(date) + 1))
}
findMethod("com.xiaomi.misubscreenui.light.aod.view.HorizontalClockView") {
name == "onFinishInflate"
}.hookBefore { param ->
val viewGroup = param.thisObject as ViewGroup
val context = viewGroup.context
//获取原组件
val gradientLayoutID =
context.resources.getIdentifier("gradient_layout", "id", context.packageName)
val gradientLayout: RelativeLayout = viewGroup.findViewById(gradientLayoutID)
val dateID = context.resources.getIdentifier("date", "id", context.packageName)
val date: TextView = viewGroup.findViewById(dateID)
val dateParentLayout: ViewGroup = date.parent as ViewGroup
//创建天气组件
val mWeatherView = WeatherView(context, false).apply {
id = View.generateViewId()
gravity = Gravity.CENTER
maxLines = 1
setTextAppearance(
context.resources.getIdentifier(
"Sub_Screen_Aod_date_s_horizontal",
"style",
context.packageName
)
)
typeface = Typeface.create("mipro-medium", Typeface.NORMAL)
layoutParams = RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
dp2px(context, 30f)
).also {
it.addRule(RelativeLayout.END_OF, dateID)
it.marginStart = dp2px(context, 3f)
it.marginEnd = dp2px(context, 3f)
}
}
dateParentLayout.addView(mWeatherView, (dateParentLayout.indexOfChild(date) + 1))
//电池位置
val batteryID =
context.resources.getIdentifier("battery_container", "id", context.packageName)
val battery: ViewGroup = viewGroup.findViewById(batteryID)
battery.layoutParams = RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
dp2px(context, 30f)
).also {
it.addRule(RelativeLayout.END_OF, mWeatherView.id)
}
gradientLayout.setPadding(0, dp2px(context, 5f), 0, 0)
}
}
}

View File

@@ -0,0 +1,21 @@
package com.lt2333.simplicitytools.hook.app.screenshot
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object UnlockUnlimitedCropping : HookRegister() {
override fun init() {
//截图无限裁切
findMethod("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$b") {
name == "a" && parameterCount == 0 && returnType == Int::class.java
}.hookBefore {
hasEnable("unlock_unlimited_cropping") {
it.result = 0
}
}
}
}

View File

@@ -1,29 +1,31 @@
package com.lt2333.simplicitytools.hook.app.securitycenter package com.lt2333.simplicitytools.hook.app.securitycenter
import android.view.View import android.view.View
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.lt2333.simplicitytools.util.findClass import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.hasEnable
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage
class LockOneHundred : IXposedHookLoadPackage { object LockOneHundred : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
override fun init() {
//防止点击重新检测 //防止点击重新检测
val mainContentFrameClass = "com.miui.securityscan.ui.main.MainContentFrame".findClass(lpparam.classLoader) findMethod("com.miui.securityscan.ui.main.MainContentFrame") {
mainContentFrameClass.hookBeforeMethod("onClick", View::class.java) { name == "onClick" && parameterTypes[0] == View::class.java
if (XSPUtils.getBoolean("lock_one_hundred", false)) { }.hookBefore {
hasEnable("lock_one_hundred") {
it.result = null it.result = null
} }
} }
//锁定100分 //锁定100分
var scoreManagerClass = "com.miui.securityscan.scanner.ScoreManager".findClass(lpparam.classLoader) findMethod("com.miui.securityscan.scanner.ScoreManager") {
scoreManagerClass.hookBeforeMethod("B") { name == "B"
if (XSPUtils.getBoolean("lock_one_hundred", false)) { }.hookBefore {
hasEnable("lock_one_hundred") {
it.result = 0 it.result = 0
} }
} }
} }
} }

View File

@@ -1,18 +1,18 @@
package com.lt2333.simplicitytools.hook.app.securitycenter package com.lt2333.simplicitytools.hook.app.securitycenter
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LoadPackage
class RemoveMacroBlacklist : IXposedHookLoadPackage { object RemoveMacroBlacklist : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
override fun init() {
if (XSPUtils.getBoolean("remove_macro_blacklist", false)) { if (XSPUtils.getBoolean("remove_macro_blacklist", false)) {
var letter = 'a' var letter = 'a'
for (i in 0..25) { for (i in 0..25) {
val classIfExists = XposedHelpers.findClassIfExists( val classIfExists = XposedHelpers.findClassIfExists(
"com.miui.gamebooster.v.$letter" + "0", lpparam.classLoader "com.miui.gamebooster.v.$letter" + "0", getDefaultClassLoader()
) ?: continue ) ?: continue
if (classIfExists.declaredMethods.size in 6..12 && classIfExists.fields.isEmpty() && classIfExists.declaredFields.size >= 2) { if (classIfExists.declaredMethods.size in 6..12 && classIfExists.fields.isEmpty() && classIfExists.declaredFields.size >= 2) {
XposedHelpers.findAndHookMethod(classIfExists, "c", String::class.java, XposedHelpers.findAndHookMethod(classIfExists, "c", String::class.java,
@@ -27,4 +27,5 @@ class RemoveMacroBlacklist : IXposedHookLoadPackage {
} }
} }
} }
} }

View File

@@ -0,0 +1,33 @@
package com.lt2333.simplicitytools.hook.app.securitycenter
import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object RemoveOpenAppConfirmationPopup : HookRegister() {
override fun init() {
findMethod("android.widget.TextView") {
name == "setText" && parameterTypes[0] == CharSequence::class.java
}.hookAfter {
hasEnable("remove_open_app_confirmation_popup") {
val textView = it.thisObject as TextView
if (it.args.isNotEmpty() && it.args[0]?.toString().equals(
textView.context.resources.getString(
textView.context.resources.getIdentifier(
"button_text_accept",
"string",
textView.context.packageName
)
)
)
) {
textView.performClick()
}
}
}
}
}

View File

@@ -13,56 +13,92 @@ import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import cn.fkj233.ui.activity.dp2px import cn.fkj233.ui.activity.dp2px
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.lt2333.simplicitytools.util.findClass import com.github.kyuubiran.ezxhelper.utils.getObjectAs
import com.lt2333.simplicitytools.util.hookAfterMethod import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.github.kyuubiran.ezxhelper.utils.hookBefore
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.hasEnable
import de.robv.android.xposed.callbacks.XC_LoadPackage import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import java.lang.reflect.Field
class ShowBatteryTemperature: IXposedHookLoadPackage { object ShowBatteryTemperature : HookRegister() {
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 { private fun getBatteryTemperature(context: Context): Int {
return context.registerReceiver( return context.registerReceiver(
null as BroadcastReceiver?, null as BroadcastReceiver?,
IntentFilter("android.intent.action.BATTERY_CHANGED") IntentFilter("android.intent.action.BATTERY_CHANGED")
)!!.getIntExtra("temperature", 0) / 10 )!!.getIntExtra("temperature", 0) / 10
} }
override fun init() = hasEnable("battery_life_function") {
try {
findMethod("com.miui.powercenter.a") {
name == "b" && parameterTypes[0] == Context::class.java
}
} catch (e : Exception) {
findMethod("com.miui.powercenter.BatteryFragment") {
name == "b" && parameterTypes[0] == Context::class.java
}
}.hookBefore {
it.result = getBatteryTemperature(it.args[0] as Context).toString()
}
try {
findMethod("com.miui.powercenter.a\$a") {
name == "run"
}
} catch (e : Exception) {
findMethod("com.miui.powercenter.BatteryFragment\$a") {
name == "run"
}
}.hookAfter {
val context = AndroidAppHelper.currentApplication().applicationContext
val isDarkMode =
context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES
val currentTemperatureValue = context.resources.getIdentifier(
"current_temperature_value",
"id",
"com.miui.securitycenter"
)
val view = it.thisObject.getObjectAs<View>("a")
val textView = view.findViewById<TextView>(currentTemperatureValue)
textView.apply {
(layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 25f)
(layoutParams as LinearLayout.LayoutParams).topMargin = 0
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 36.399998f)
setPadding(0, 0, 0, 0)
gravity = Gravity.NO_GRAVITY
typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
height = dp2px(context, 49.099983f)
textAlignment = View.TEXT_ALIGNMENT_VIEW_START
}
val tempView = TextView(context)
tempView.apply {
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
dp2px(context, 49.099983f)
)
(layoutParams as LinearLayout.LayoutParams).marginStart =
dp2px(context, 3.599976f)
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f)
setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333"))
setPadding(0, dp2px(context, 25f), 0, 0)
text = ""
typeface = Typeface.create(null, 500, false)
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)
}
}
} }

View File

@@ -1,24 +1,17 @@
package com.lt2333.simplicitytools.hook.app.securitycenter package com.lt2333.simplicitytools.hook.app.securitycenter
import android.widget.TextView import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.findClass import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class SkipWaitingTime : IXposedHookLoadPackage { object SkipWaitingTime : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val textViewClass = "android.widget.TextView".findClass(lpparam.classLoader) override fun init() {
textViewClass.hookBeforeMethod( findMethod("android.widget.TextView") {
"setText", name == "setText" && parameterCount == 4
CharSequence::class.java, }.hookBefore {
TextView.BufferType::class.java, hasEnable("skip_waiting_time") {
Boolean::class.java,
Int::class.java
) {
if (XSPUtils.getBoolean("skip_waiting_time", false)) {
if (it.args.isNotEmpty() && it.args[0]?.toString()?.startsWith("确定(") == true if (it.args.isNotEmpty() && it.args[0]?.toString()?.startsWith("确定(") == true
) { ) {
it.args[0] = "确定" it.args[0] = "确定"
@@ -26,13 +19,13 @@ class SkipWaitingTime : IXposedHookLoadPackage {
} }
} }
textViewClass.hookBeforeMethod( findMethod("android.widget.TextView") {
"setEnabled", name == "setEnabled" && parameterTypes[0] == Boolean::class.java
Boolean::class.java }.hookBefore {
) { hasEnable("skip_waiting_time") {
if (XSPUtils.getBoolean("skip_waiting_time", false)) {
it.args[0] = true it.args[0] = true
} }
} }
} }
} }

View File

@@ -1,34 +1,50 @@
package com.lt2333.simplicitytools.hook.app.settings package com.lt2333.simplicitytools.hook.app.settings
import android.app.NotificationChannel import android.app.NotificationChannel
import com.lt2333.simplicitytools.util.* import com.github.kyuubiran.ezxhelper.utils.*
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LoadPackage
class ShowNotificationImportance : IXposedHookLoadPackage { object ShowNotificationImportance : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val channelNotificationSettingsClass = "com.android.settings.notification.ChannelNotificationSettings".findClass(lpparam.classLoader) override fun init() {
channelNotificationSettingsClass.hookBeforeMethod("removeDefaultPrefs") { findMethod("com.android.settings.notification.ChannelNotificationSettings"){
if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBeforeMethod name == "removeDefaultPrefs"
val importance = it.thisObject.callMethod("findPreference", "importance") ?: return@hookBeforeMethod }.hookBefore {
val mChannel = it.thisObject.getObjectField("mChannel") as NotificationChannel if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBefore
val index = importance.callMethod("findSpinnerIndexOfValue", mChannel.importance.toString()) as Int val importance =
if (index < 0) return@hookBeforeMethod it.thisObject.invokeMethodAuto("findPreference", "importance") ?: return@hookBefore
importance.callMethod("setValueIndex", index) val mChannel = it.thisObject.getObject("mChannel") as NotificationChannel
XposedHelpers.setAdditionalInstanceField(importance, "channelNotificationSettings", it.thisObject) val index = importance.invokeMethodAutoAs<Int>(
"findSpinnerIndexOfValue",
mChannel.importance.toString()
) as Int
if (index < 0) return@hookBefore
importance.invokeMethodAuto("setValueIndex", index)
XposedHelpers.setAdditionalInstanceField(
importance,
"channelNotificationSettings",
it.thisObject
)
it.result = null it.result = null
} }
val dropDownPreferenceClass = XposedHelpers.findClass("androidx.preference.Preference", lpparam.classLoader) findMethod("androidx.preference.Preference"){
dropDownPreferenceClass.hookAfterMethod("callChangeListener", Any::class.java) { name == "callChangeListener" && parameterTypes[0] == Any::class.java
val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfterMethod }.hookAfter {
val mChannel = channelNotificationSettings.getObjectField("mChannel") as NotificationChannel val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(
mChannel.callMethod("setImportance", (it.args[0] as String).toInt()) it.thisObject,
val mBackend = channelNotificationSettings.getObjectField("mBackend") ?: return@hookAfterMethod "channelNotificationSettings"
val mPkg = channelNotificationSettings.getObjectField("mPkg") as String ) ?: return@hookAfter
val mUid = channelNotificationSettings.getIntField("mUid") val mChannel = channelNotificationSettings.getObject("mChannel") as NotificationChannel
mBackend.callMethod("updateChannel", mPkg, mUid, mChannel) mChannel.invokeMethodAuto("setImportance", (it.args[0] as String).toInt())
val mBackend =
channelNotificationSettings.getObjectOrNull("mBackend") ?: return@hookAfter
val mPkg = channelNotificationSettings.getObjectAs<String>("mPkg")
val mUid = channelNotificationSettings.getObjectAs<Int>("mUid")
mBackend.invokeMethodAuto("updateChannel", mPkg, mUid, mChannel)
} }
} }
} }

View File

@@ -0,0 +1,25 @@
package com.lt2333.simplicitytools.hook.app.systemui
import android.util.TypedValue
import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object BatteryPercentage : HookRegister() {
override fun init() {
val size = XSPUtils.getFloat("battery_percentage_font_size", 0f)
if (size == 0f) return
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") {
name == "updateResources"
}.hookAfter {
(it.thisObject.getObjectAs<TextView>("mBatteryPercentView")).setTextSize(
TypedValue.COMPLEX_UNIT_DIP, size
)
}
}
}

View File

@@ -0,0 +1,20 @@
package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object CanNotificationSlide: HookRegister() {
override fun init() {
findMethod("com.android.systemui.statusbar.notification.NotificationSettingsManager") {
name == "canSlide"
}.hookAfter {
hasEnable("can_notification_slide") {
it.result = true
}
}
}
}

View File

@@ -4,40 +4,136 @@ import android.content.ComponentName
import android.content.Intent import android.content.Intent
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import com.github.kyuubiran.ezxhelper.utils.loadClass import androidx.constraintlayout.widget.ConstraintLayout
import com.lt2333.simplicitytools.util.* import cn.fkj233.ui.activity.dp2px
import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.SystemProperties
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.view.WeatherView import com.lt2333.simplicitytools.view.WeatherView
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class ControlCenterWeather : IXposedHookLoadPackage { object ControlCenterWeather : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
hasEnable("control_center_weather") { override fun init() = hasEnable("control_center_weather") {
var mWeatherView: TextView? = null var mWeatherView: TextView? = null
val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false) var mConstraintLayout: ConstraintLayout? = null
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod( val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false)
lpparam.classLoader, findMethod("com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView") {
"onFinishInflate" name == "onFinishInflate"
}.hookAfter { param ->
val viewGroup = param.thisObject as ViewGroup
val context = viewGroup.context
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 &&
!SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM")
) { ) {
val viewGroup = it.thisObject as ViewGroup //获取原组件
val context = viewGroup.context val big_time_ID =
context.resources.getIdentifier("big_time", "id", context.packageName)
val big_time: TextView = viewGroup.findViewById(big_time_ID)
val date_time_ID =
context.resources.getIdentifier("date_time", "id", context.packageName)
val date_time: TextView = viewGroup.findViewById(date_time_ID)
//创建新布局
val mConstraintLayoutLp = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
).also {
it.topMargin = context.resources.getDimensionPixelSize(
context.resources.getIdentifier(
"qs_control_header_tiles_margin_top",
"dimen",
context.packageName
)
)
}
mConstraintLayout =
ConstraintLayout(context).also { it.layoutParams = mConstraintLayoutLp }
(big_time.parent as ViewGroup).addView(mConstraintLayout, 0)
//从原布局中删除组件
(big_time.parent as ViewGroup).removeView(big_time)
(date_time.parent as ViewGroup).removeView(date_time)
//添加组件至新布局
mConstraintLayout!!.addView(big_time)
mConstraintLayout!!.addView(date_time)
//组件属性
val date_time_LP = ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.WRAP_CONTENT,
ConstraintLayout.LayoutParams.WRAP_CONTENT
).also {
it.startToEnd = big_time_ID
it.bottomToBottom = 0
it.marginStart = context.resources.getDimensionPixelSize(
context.resources.getIdentifier(
"notification_panel_time_date_space",
"dimen",
context.packageName
)
)
it.bottomMargin = dp2px(context, 5f)
}
date_time.layoutParams = date_time_LP
//创建天气组件
mWeatherView = WeatherView(context, isDisplayCity).apply {
setTextAppearance(
context.resources.getIdentifier(
"TextAppearance.QSControl.Date",
"style",
context.packageName
)
)
}
mConstraintLayout!!.addView(mWeatherView)
val mWeatherView_LP = ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.WRAP_CONTENT,
ConstraintLayout.LayoutParams.WRAP_CONTENT
).also {
it.startToEnd = big_time_ID
it.bottomToTop = date_time_ID
it.marginStart = context.resources.getDimensionPixelSize(
context.resources.getIdentifier(
"notification_panel_time_date_space",
"dimen",
context.packageName
)
)
}
(mWeatherView as WeatherView).layoutParams = mWeatherView_LP
} else {
val layoutParam = val layoutParam =
loadClass("androidx.constraintlayout.widget.ConstraintLayout\$LayoutParams") loadClass("androidx.constraintlayout.widget.ConstraintLayout\$LayoutParams").getConstructor(
.getConstructor(Int::class.java, Int::class.java).newInstance( Int::class.java,
ViewGroup.LayoutParams.WRAP_CONTENT, Int::class.java
ViewGroup.LayoutParams.WRAP_CONTENT ).newInstance(
) as ViewGroup.MarginLayoutParams ViewGroup.LayoutParams.WRAP_CONTENT,
layoutParam.setObjectField( ViewGroup.LayoutParams.WRAP_CONTENT
) as ViewGroup.MarginLayoutParams
layoutParam.putObject(
"bottomToTop", "bottomToTop",
context.resources.getIdentifier("date_time", "id", context.packageName) context.resources.getIdentifier("date_time", "id", context.packageName)
) )
layoutParam.setObjectField( layoutParam.putObject(
"startToEnd", "startToEnd",
context.resources.getIdentifier("big_time", "id", context.packageName) context.resources.getIdentifier("big_time", "id", context.packageName)
) )
layoutParam.marginStart = context.resources.getDimensionPixelSize( layoutParam.marginStart = context.resources.getDimensionPixelSize(
context.resources.getIdentifier( context.resources.getIdentifier(
"notification_panel_time_date_space", "notification_panel_time_date_space",
@@ -45,7 +141,6 @@ class ControlCenterWeather : IXposedHookLoadPackage {
context.packageName context.packageName
) )
) )
mWeatherView = WeatherView(context, isDisplayCity).apply { mWeatherView = WeatherView(context, isDisplayCity).apply {
setTextAppearance( setTextAppearance(
context.resources.getIdentifier( context.resources.getIdentifier(
@@ -57,28 +152,42 @@ class ControlCenterWeather : IXposedHookLoadPackage {
layoutParams = layoutParam layoutParams = layoutParam
} }
viewGroup.addView(mWeatherView) viewGroup.addView(mWeatherView)
}
(mWeatherView as WeatherView).setOnClickListener { (mWeatherView as WeatherView).setOnClickListener {
try { try {
val intent = Intent().apply { val intent = Intent().apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK flags = Intent.FLAG_ACTIVITY_NEW_TASK
component = ComponentName( component = ComponentName(
"com.miui.weather2", "com.miui.weather2",
"com.miui.weather2.ActivityWeatherMain" "com.miui.weather2.ActivityWeatherMain"
) )
}
context.startActivity(intent)
} catch (e: Exception) {
Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show()
} }
context.startActivity(intent)
} catch (e: Exception) {
Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show()
} }
} }
//解决横屏重叠 }
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
lpparam.classLoader, //解决横屏重叠
"updateLayout" findMethod("com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView") {
name == "updateLayout"
}.hookAfter {
val viewGroup = it.thisObject as ViewGroup
val context = viewGroup.context
val mOrientation = viewGroup.getObject("mOrientation") as Int
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith(
"DEV"
) && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM")
) { ) {
val mOrientation = it.thisObject.getObjectField("mOrientation") as Int if (mOrientation == 1) {
mConstraintLayout!!.visibility = View.VISIBLE
} else {
mConstraintLayout!!.visibility = View.GONE
}
} else {
if (mOrientation == 1) { if (mOrientation == 1) {
mWeatherView!!.visibility = View.VISIBLE mWeatherView!!.visibility = View.VISIBLE
} else { } else {
@@ -87,4 +196,5 @@ class ControlCenterWeather : IXposedHookLoadPackage {
} }
} }
} }
} }

View File

@@ -0,0 +1,19 @@
package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object CustomMobileTypeText : HookRegister() {
override fun init() = hasEnable("custom_mobile_type_text_switch") {
findMethod("com.android.systemui.statusbar.policy.MobileSignalController") {
name == "getMobileTypeName" && parameterTypes[0] == Int::class.java
}.hookAfter {
it.result = XSPUtils.getString("custom_mobile_type_text", "5G")
}
}
}

View File

@@ -0,0 +1,170 @@
package com.lt2333.simplicitytools.hook.app.systemui
import android.content.Context
import android.net.TrafficStats
import android.util.TypedValue
import android.view.Gravity
import android.widget.TextView
import com.github.kyuubiran.ezxhelper.init.InitFields
import com.github.kyuubiran.ezxhelper.utils.findConstructor
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.R
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import java.text.DecimalFormat
object DoubleLineNetworkSpeed : HookRegister() {
private var mLastTotalUp: Long = 0
private var mLastTotalDown: Long = 0
private var lastTimeStampTotalUp: Long = 0
private var lastTimeStampTotalDown: Long = 0
private var upIcon = ""
private var downIcon = ""
private val getDualSize = XSPUtils.getInt("status_bar_network_speed_dual_row_size", 0)
private val getDualAlign = XSPUtils.getInt("status_bar_network_speed_dual_row_gravity", 0)
override fun init() = hasEnable("status_bar_dual_row_network_speed") {
val none = InitFields.moduleRes.getString(R.string.none)
if (XSPUtils.getString("status_bar_network_speed_dual_row_icon", none) != none) {
upIcon = XSPUtils.getString("status_bar_network_speed_dual_row_icon", none)
?.firstOrNull().toString()
downIcon = XSPUtils.getString("status_bar_network_speed_dual_row_icon", none)
?.lastOrNull().toString()
}
findConstructor("com.android.systemui.statusbar.views.NetworkSpeedView") {
parameterCount == 2
}.hookAfter {
val mView = it.thisObject as TextView
mView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 7f)
if (getDualSize != 0) {
mView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, getDualSize.toFloat())
}
mView.isSingleLine = false
mView.setLineSpacing(0F, 0.8F)
if (getDualAlign == 0) {
mView.gravity = Gravity.START or Gravity.CENTER_VERTICAL
} else {
mView.gravity = Gravity.END or Gravity.CENTER_VERTICAL
}
}
findMethod("com.android.systemui.statusbar.policy.NetworkSpeedController") {
name == "formatSpeed" && parameterCount == 2
}.hookBefore {
if (getDualAlign == 0) {
it.result =
"$upIcon ${getTotalUpSpeed(it.args[0] as Context)}\n${downIcon} ${
getTotalDownloadSpeed(it.args[0] as Context)
}"
} else {
it.result =
"${getTotalUpSpeed(it.args[0] as Context)} ${upIcon}\n${
getTotalDownloadSpeed(
it.args[0] as Context
)
} $downIcon"
}
}
}
//获取总的上行速度
private fun getTotalUpSpeed(context: Context): String {
val totalUpSpeed: Float
val currentTotalTxBytes = TrafficStats.getTotalTxBytes()
val nowTimeStampTotalUp = System.currentTimeMillis()
//计算上传速度
val bytes =
(currentTotalTxBytes - mLastTotalUp) * 1000 / (nowTimeStampTotalUp - lastTimeStampTotalUp).toFloat()
val unit: String
if (bytes >= 1048576) {
totalUpSpeed =
DecimalFormat("0.0").format(bytes / 1048576).toFloat()
unit = context.resources.getString(
context.resources.getIdentifier(
"megabyte_per_second",
"string",
context.packageName
)
)
} else {
totalUpSpeed =
DecimalFormat("0.0").format(bytes / 1024).toFloat()
unit = context.resources.getString(
context.resources.getIdentifier(
"kilobyte_per_second",
"string",
context.packageName
)
)
}
//保存当前的流量总和和上次的时间戳
mLastTotalUp = currentTotalTxBytes
lastTimeStampTotalUp = nowTimeStampTotalUp
return if (totalUpSpeed >= 100) {
"" + totalUpSpeed.toInt() + unit
} else {
"" + totalUpSpeed + unit
}
}
//获取总的下行速度
private fun getTotalDownloadSpeed(context: Context): String {
val totalDownSpeed: Float
val currentTotalRxBytes = TrafficStats.getTotalRxBytes()
val nowTimeStampTotalDown = System.currentTimeMillis()
//计算下行速度
val bytes =
(currentTotalRxBytes - mLastTotalDown) * 1000 / (nowTimeStampTotalDown - lastTimeStampTotalDown).toFloat()
val unit: String
if (bytes >= 1048576) {
totalDownSpeed =
DecimalFormat("0.0").format(bytes / 1048576).toFloat()
unit = context.resources.getString(
context.resources.getIdentifier(
"megabyte_per_second",
"string",
context.packageName
)
)
} else {
totalDownSpeed =
DecimalFormat("0.0").format(bytes / 1024).toFloat()
unit = context.resources.getString(
context.resources.getIdentifier(
"kilobyte_per_second",
"string",
context.packageName
)
)
}
//保存当前的流量总和和上次的时间戳
mLastTotalDown = currentTotalRxBytes
lastTimeStampTotalDown = nowTimeStampTotalDown
return if (totalDownSpeed >= 100) {
"" + totalDownSpeed.toInt() + unit
} else {
"" + totalDownSpeed + unit
}
}
}

View File

@@ -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
}
}
}
}

View File

@@ -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
}
}
}
}

View File

@@ -4,41 +4,48 @@ import android.view.View
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.lt2333.simplicitytools.util.getObjectField import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class HideBatteryIcon : IXposedHookLoadPackage { object HideBatteryIcon : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(lpparam.classLoader, "updateResources") {
override fun init() {
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") {
name == "updateResources"
}.hookAfter {
//隐藏电池图标 //隐藏电池图标
hasEnable("hide_battery_icon") { hasEnable("hide_battery_icon") {
(it.thisObject.getObjectField("mBatteryIconView") as ImageView).visibility = View.GONE (it.thisObject.getObjectAs<ImageView>("mBatteryIconView")).visibility = View.GONE
if (it.thisObject.getObjectField("mBatteryStyle") == 1) { if (it.thisObject.getObject("mBatteryStyle") == 1) {
(it.thisObject.getObjectField("mBatteryDigitalView") as FrameLayout).visibility = View.GONE (it.thisObject.getObjectAs<FrameLayout>("mBatteryDigitalView")).visibility =
View.GONE
} }
} }
//隐藏电池内的百分比 //隐藏电池内的百分比
hasEnable("hide_battery_percentage_icon") { hasEnable("hide_battery_percentage_icon") {
(it.thisObject.getObjectField("mBatteryPercentMarkView") as TextView).textSize = 0F (it.thisObject.getObjectAs<TextView>("mBatteryPercentMarkView")).textSize = 0F
} }
//隐藏电池百分号 //隐藏电池百分号
hasEnable("hide_battery_percentage_icon") { hasEnable("hide_battery_percentage_icon") {
(it.thisObject.getObjectField("mBatteryPercentMarkView") as TextView).textSize = 0F (it.thisObject.getObjectAs<TextView>("mBatteryPercentMarkView")).textSize = 0F
} }
}
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(lpparam.classLoader, "updateChargeAndText") { findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") {
//隐藏电池充电图标 name == "updateChargeAndText"
hasEnable("hide_battery_charging_icon") { }.hookAfter {
(it.thisObject.getObjectField("mBatteryChargingInView") as ImageView).visibility = View.GONE //隐藏电池充电图标
(it.thisObject.getObjectField("mBatteryChargingView") as ImageView).visibility = View.GONE hasEnable("hide_battery_charging_icon") {
} (it.thisObject.getObjectAs<ImageView>("mBatteryChargingInView")).visibility =
View.GONE
(it.thisObject.getObjectAs<ImageView>("mBatteryChargingView")).visibility =
View.GONE
} }
} }
} }
} }

View File

@@ -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
}
}
}
}

View File

@@ -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
}
}
}
}

View File

@@ -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
}
}
}
}

View File

@@ -2,37 +2,39 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import com.lt2333.simplicitytools.util.getObjectField import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.callbacks.XC_LoadPackage
class HideHDIcon :IXposedHookLoadPackage { object HideHDIcon : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState" override fun init() {
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) { findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
hasEnable("hide_big_hd_icon") { name == "initViewState" && parameterCount == 1
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE }.hookAfter {
} hide(it)
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) { findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
hasEnable("hide_big_hd_icon") { name == "updateState" && parameterCount == 1
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE }.hookAfter {
} hide(it)
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
}
} }
} }
private fun hide(it: XC_MethodHook.MethodHookParam) {
hasEnable("hide_big_hd_icon") {
(it.thisObject.getObjectAs<ImageView>("mVolte")).visibility = View.GONE
}
hasEnable("hide_small_hd_icon") {
(it.thisObject.getObjectAs<ImageView>("mSmallHd")).visibility = View.GONE
}
hasEnable("hide_hd_no_service_icon") {
(it.thisObject.getObjectAs<ImageView>("mVolteNoService")).visibility = View.GONE
}
}
} }

View File

@@ -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
}
}
}
}

View File

@@ -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
}
}
}
}

View File

@@ -2,27 +2,34 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import com.lt2333.simplicitytools.util.getObjectField import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.callbacks.XC_LoadPackage
class HideMobileActivityIcon : IXposedHookLoadPackage { object HideMobileActivityIcon : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState" override fun init() {
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) { findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
hasEnable("hide_mobile_activity_icon") { name == "initViewState" && parameterCount == 1
(it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE }.hookAfter {
(it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE hide(it)
}
} }
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) { findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
hasEnable("hide_mobile_activity_icon") { name == "updateState" && parameterCount == 1
(it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE }.hookAfter {
(it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE hide(it)
}
} }
} }
private fun hide(it: XC_MethodHook.MethodHookParam) {
hasEnable("hide_mobile_activity_icon") {
(it.thisObject.getObjectAs<ImageView>("mLeftInOut")).visibility = View.GONE
(it.thisObject.getObjectAs<ImageView>("mRightInOut")).visibility = View.GONE
}
}
} }

View File

@@ -3,29 +3,50 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.lt2333.simplicitytools.util.getObjectField import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.callbacks.XC_LoadPackage
class HideMobileTypeIcon : IXposedHookLoadPackage { object HideMobileTypeIcon : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState" private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false)
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
hasEnable("hide_mobile_type_icon") { override fun init() {
(it.thisObject.getObjectField("mMobileType") as TextView).visibility = View.INVISIBLE findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
(it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility = View.INVISIBLE name == "initViewState" && parameterCount == 1
(it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility = View.INVISIBLE }.hookAfter {
} hideMobileTypeIcon(it)
} }
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) { findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
hasEnable("hide_mobile_type_icon") { name == "updateState" && parameterCount == 1
(it.thisObject.getObjectField("mMobileType") as TextView).visibility = View.INVISIBLE }.hookAfter {
(it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility = View.INVISIBLE hideMobileTypeIcon(it)
(it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility = View.INVISIBLE }
}
private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
hasEnable("hide_mobile_type_icon") {
if (isBigType) {
(it.thisObject.getObjectAs<TextView>("mMobileType")).visibility =
View.GONE
(it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility =
View.GONE
(it.thisObject.getObjectAs<TextView>("mMobileTypeSingle")).visibility =
View.GONE
} else {
(it.thisObject.getObjectAs<TextView>("mMobileType")).visibility =
View.INVISIBLE
(it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility =
View.INVISIBLE
(it.thisObject.getObjectAs<TextView>("mMobileTypeSingle")).visibility =
View.INVISIBLE
} }
} }
} }
} }

View File

@@ -1,20 +1,22 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import android.widget.TextView import android.widget.TextView
import com.lt2333.simplicitytools.util.XSPUtils import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.lt2333.simplicitytools.util.findClass import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.hasEnable
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.callbacks.XC_LoadPackage
class HideNetworkSpeedSplitter : IXposedHookLoadPackage { object HideNetworkSpeedSplitter : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val networkSpeedSplitterClass = "com.android.systemui.statusbar.views.NetworkSpeedSplitter".findClass(lpparam.classLoader) override fun init() {
networkSpeedSplitterClass.hookAfterMethod("init") { findMethod("com.android.systemui.statusbar.views.NetworkSpeedSplitter") {
if (XSPUtils.getBoolean("hide_network_speed_splitter", false)) { name == "init"
}.hookAfter {
hasEnable("hide_network_speed_splitter") {
val textView = it.thisObject as TextView val textView = it.thisObject as TextView
textView.text = " " textView.text = " "
} }
} }
} }
} }

View File

@@ -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
}
}
}
}

View File

@@ -1,13 +1,16 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class HideSimIcon :IXposedHookLoadPackage { object HideSimIcon : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(lpparam.classLoader, "hasCorrectSubs", MutableList::class.java) { override fun init() {
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy") {
name == "hasCorrectSubs" && parameterTypes[0] == MutableList::class.java
}.hookBefore {
val list = it.args[0] as MutableList<*> val list = it.args[0] as MutableList<*>
val size = list.size val size = list.size
hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) { hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) {
@@ -18,4 +21,5 @@ class HideSimIcon :IXposedHookLoadPackage {
} }
} }
} }
} }

View File

@@ -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
}
}
}
}

View File

@@ -0,0 +1,87 @@
package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook
object HideStatusBarIcon : HookRegister() {
override fun init() {
findMethod("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl") {
name == "setIconVisibility" && parameterCount == 2
}.hookBefore {
hideIcon(it)
}
findMethod("com.android.systemui.statusbar.phone.MiuiDripLeftStatusBarIconControllerImpl") {
name == "setIconVisibility" && parameterCount == 2
}.hookBefore {
hideIcon(it)
}
}
private fun hideIcon(it: XC_MethodHook.MethodHookParam) {
//Log.d("图标名字", "handleLoadPackage: " + it.args[0])
when (it.args[0] as String) {
//隐藏蓝牙
"bluetooth" -> hasEnable("hide_bluetooth_icon") {
it.args[1] = false
}
//隐藏蓝牙电量
"bluetooth_handsfree_battery" -> hasEnable("hide_bluetooth_battery_icon") {
it.args[1] = false
}
//隐藏勿扰
"zen" -> hasEnable("hide_zen_icon") {
it.args[1] = false
}
//隐藏声音
"volume" -> hasEnable("hide_volume_icon") {
it.args[1] = false
}
//隐藏WIFI
"wifi" -> hasEnable("hide_wifi_icon") {
it.args[1] = false
}
//隐藏WIFI辅助
"slave_wifi" -> hasEnable("hide_slave_wifi_icon") {
it.args[1] = false
}
//隐藏飞行模式
"airplane" -> hasEnable("hide_airplane_icon") {
it.args[1] = false
}
//隐藏闹钟
"alarm_clock" -> hasEnable("hide_alarm_icon") {
it.args[1] = false
}
//隐藏定位
"location" -> hasEnable("hide_gps_icon") {
it.args[1] = false
}
//隐藏热点
"hotspot" -> hasEnable("hide_hotspot_icon") {
it.args[1] = false
}
//隐藏耳机
"headset" -> hasEnable("hide_headset_icon") {
it.args[1] = false
}
//隐藏VPN
"vpn" -> hasEnable("hide_vpn_icon") {
it.args[1] = false
}
//隐藏无SIM卡
"no_sim" -> hasEnable("hide_no_sim_icon") {
it.args[1] = false
}
//隐藏NFC图标
"nfc" -> hasEnable("hide_nfc_icon") {
it.args[1] = false
}
}
}
}

View File

@@ -1,20 +1,24 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.util.isNonNull
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class HideStatusBarNetworkSpeedSecond :IXposedHookLoadPackage { object HideStatusBarNetworkSpeedSecond : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
"com.android.systemui.statusbar.views.NetworkSpeedView".hookBeforeMethod(lpparam.classLoader, "setNetworkSpeed", String::class.java) { override fun init() {
findMethod("com.android.systemui.statusbar.views.NetworkSpeedView") {
name == "setNetworkSpeed" && parameterCount == 1
}.hookBefore {
hasEnable("hide_status_bar_network_speed_second") { hasEnable("hide_status_bar_network_speed_second") {
it.args[0].isNonNull { s -> if (it.args[0] != null) {
it.args[0] = (s as String) val mText = (it.args[0] as String)
.replace("/", "") .replace("/", "")
.replace("s", "") .replace("s", "")
.replace("'", "") .replace("\'", "")
.replace("วิ", "")
it.args[0] = mText
} }
} }
} }

View File

@@ -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
}
}
}
}

View File

@@ -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
}
}
}
}

View File

@@ -3,35 +3,40 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.lt2333.simplicitytools.util.getObjectField import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.callbacks.XC_LoadPackage
class HideWifiActivityIcon : IXposedHookLoadPackage { object HideWifiActivityIcon : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState" override fun init() {
"com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) { findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
//隐藏WIFI箭头 name == "initViewState" && parameterCount == 1
hasEnable("hide_wifi_activity_icon") { }.hookAfter {
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE hide(it)
}
//隐藏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) { findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
//隐藏WIFI箭头 name == "updateState" && parameterCount == 1
hasEnable("hide_wifi_activity_icon") { }.hookAfter {
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE hide(it)
}
//隐藏WIFI标准图标
hasEnable("hide_wifi_standard_icon") {
(it.thisObject.getObjectField("mWifiStandardView") as TextView).visibility = View.INVISIBLE
}
} }
} }
private fun hide(it: XC_MethodHook.MethodHookParam) {
//隐藏WIFI箭头
hasEnable("hide_wifi_activity_icon") {
(it.thisObject.getObjectAs<ImageView>("mWifiActivityView")).visibility =
View.INVISIBLE
}
//隐藏WIFI标准图标
hasEnable("hide_wifi_standard_icon") {
(it.thisObject.getObjectAs<TextView>("mWifiStandardView")).visibility =
View.INVISIBLE
}
}
} }

View File

@@ -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
}
}
}
}

View File

@@ -0,0 +1,93 @@
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.Log
import android.widget.LinearLayout
import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook
import java.lang.reflect.Method
import java.text.SimpleDateFormat
import java.util.*
object LockScreenClockDisplaySeconds : HookRegister() {
private var nowTime: Date = Calendar.getInstance().time
override fun init() = hasEnable("lock_screen_clock_display_seconds") {
findConstructor("com.miui.clock.MiuiBaseClock") {
paramCount == 2
}.hookAfter {
try {
val viewGroup = it.thisObject as LinearLayout
val d: Method = viewGroup.javaClass.getDeclaredMethod("updateTime")
val r = Runnable {
d.isAccessible = true
d.invoke(viewGroup)
}
class T : TimerTask() {
override fun run() {
Handler(viewGroup.context.mainLooper).post(r)
}
}
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000)
} catch (_: Exception) {
}
}
findMethod("com.miui.clock.MiuiLeftTopClock") {
name == "updateTime"
}.hookAfter { updateTime(it, false) }
findMethod("com.miui.clock.MiuiCenterHorizontalClock") {
name == "updateTime"
}.hookAfter { updateTime(it, false) }
findMethod("com.miui.clock.MiuiLeftTopLargeClock") {
name == "updateTime"
}.hookAfter { updateTime(it, false) }
findMethod("com.miui.clock.MiuiVerticalClock") {
name == "updateTime"
}.hookAfter { updateTime(it, true) }
}
private fun updateTime(it: XC_MethodHook.MethodHookParam, isVertical: Boolean) {
val textV = it.thisObject.getObjectAs<TextView>("mTimeText")
val c: Context = textV.context
Log.d(
"lock_screen_clock_display_seconds",
"updateTime: " + it.thisObject.javaClass.simpleName
)
val is24 = Settings.System.getString(
c.contentResolver,
Settings.System.TIME_12_24
) == "24"
nowTime = Calendar.getInstance().time
textV.text = getTime(is24, isVertical)
}
@SuppressLint("SimpleDateFormat")
private fun getTime(is24: Boolean, isVertical: Boolean): String {
var timePattern = ""
timePattern += if (isVertical) { //垂直
if (is24) "HH\nmm\nss" else "hh\nmm\nss"
} else { //水平
if (is24) "HH:mm:ss" else "h:mm:ss"
}
timePattern = SimpleDateFormat(timePattern).format(nowTime)
return timePattern
}
}

View File

@@ -0,0 +1,101 @@
package com.lt2333.simplicitytools.hook.app.systemui
import android.annotation.SuppressLint
import android.widget.TextView
import com.github.kyuubiran.ezxhelper.init.InitFields
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.R
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import java.io.BufferedReader
import java.io.FileReader
import java.lang.reflect.Method
import kotlin.math.roundToInt
object LockScreenCurrent : HookRegister() {
override fun init() = hasEnable("lock_screen_charging_current") {
findMethod("com.android.keyguard.charge.ChargeUtils") {
name == "getChargingHintText" && parameterCount == 3
}.hookAfter {
it.result = getCurrent() + "\n" + it.result
}
findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") {
name == "onFinishInflate"
}.hookAfter {
(it.thisObject.getObject(
"mIndicationText"
) as TextView).isSingleLine = false
}
}
/**
* 原始代码来自 CSDN
* https://blog.csdn.net/zhangyongfeiyong/article/details/53641809
*/
@SuppressLint("PrivateApi")
private fun getCurrent(): String {
var result = ""
try {
val systemProperties = Class.forName("android.os.SystemProperties")
val get = systemProperties.getDeclaredMethod("get", String::class.java) as Method
val platName = get.invoke(null, "ro.hardware") as String
if (platName.startsWith("mt") || platName.startsWith("MT")) {
val filePath =
"/sys/class/power_supply/battery/device/FG_Battery_CurrentConsumption"
val current = (-getMeanCurrentVal(filePath, 5, 0) / 1000.0f).roundToInt()
result = "${InitFields.moduleRes.getString(R.string.current_current)} ${current}mA"
} else if (platName.startsWith("qcom")) {
val filePath = "/sys/class/power_supply/battery/current_now"
val current = (-getMeanCurrentVal(filePath, 5, 0) / 1000.0f).roundToInt()
result = "${InitFields.moduleRes.getString(R.string.current_current)} ${current}mA"
}
} catch (e: Exception) {
e.printStackTrace()
}
return result
}
/**
* 获取平均电流值
* 获取 filePath 文件 totalCount 次数的平均值,每次采样间隔 intervalMs 时间
*/
private fun getMeanCurrentVal(filePath: String, totalCount: Int, intervalMs: Int): Float {
var meanVal = 0.0f
if (totalCount <= 0) {
return 0.0f
}
for (i in 0 until totalCount) {
try {
val f: Float = readFile(filePath, 0).toFloat()
meanVal += f / totalCount
} catch (e: Exception) {
e.printStackTrace()
}
if (intervalMs <= 0) {
continue
}
try {
Thread.sleep(intervalMs.toLong())
} catch (e: Exception) {
e.printStackTrace()
}
}
return meanVal
}
private fun readFile(path: String, defaultValue: Int): Int {
try {
val bufferedReader = BufferedReader(FileReader(path))
val i: Int = bufferedReader.readLine().toInt(10)
bufferedReader.close()
return i
} catch (_: java.lang.Exception) {
}
return defaultValue
}
}

View File

@@ -0,0 +1,70 @@
package com.lt2333.simplicitytools.hook.app.systemui
import android.app.KeyguardManager
import android.content.Context
import android.os.SystemClock
import android.view.MotionEvent
import android.view.View
import android.view.View.OnTouchListener
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers
import kotlin.math.abs
object LockScreenDoubleTapToSleep : HookRegister() {
override fun init() = hasEnable("lock_screen_double_tap_to_sleep") {
findMethod("com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer") {
name == "onFinishInflate"
}.hookBefore {
val view = it.thisObject as View
XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", 0f)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", 0f)
view.setOnTouchListener(OnTouchListener { v, event ->
if (event.action != MotionEvent.ACTION_DOWN) return@OnTouchListener false
var currentTouchTime =
XposedHelpers.getAdditionalInstanceField(view, "currentTouchTime") as Long
var currentTouchX =
XposedHelpers.getAdditionalInstanceField(view, "currentTouchX") as Float
var currentTouchY =
XposedHelpers.getAdditionalInstanceField(view, "currentTouchY") as Float
val lastTouchTime = currentTouchTime
val lastTouchX = currentTouchX
val lastTouchY = currentTouchY
currentTouchTime = System.currentTimeMillis()
currentTouchX = event.x
currentTouchY = event.y
if (currentTouchTime - lastTouchTime < 250L && abs(currentTouchX - lastTouchX) < 100f && abs(
currentTouchY - lastTouchY
) < 100f
) {
val keyguardMgr =
v.context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
if (keyguardMgr.isKeyguardLocked) {
XposedHelpers.callMethod(
v.context.getSystemService(Context.POWER_SERVICE),
"goToSleep",
SystemClock.uptimeMillis()
)
}
currentTouchTime = 0L
currentTouchX = 0f
currentTouchY = 0f
}
XposedHelpers.setAdditionalInstanceField(
view,
"currentTouchTime",
currentTouchTime
)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", currentTouchX)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", currentTouchY)
v.performClick()
false
})
}
}
}

View File

@@ -0,0 +1,31 @@
package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookReplace
import com.github.kyuubiran.ezxhelper.utils.invokeMethod
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object MaximumNumberOfNotificationIcons : HookRegister() {
override fun init() {
val icons = XSPUtils.getInt("maximum_number_of_notification_icons", 3)
val dots = XSPUtils.getInt("maximum_number_of_notification_dots", 3)
findMethod("com.android.systemui.statusbar.phone.NotificationIconContainer") {
name == "miuiShowNotificationIcons" && parameterCount == 1
}.hookReplace {
if (it.args[0] as Boolean) {
it.thisObject.putObject("MAX_DOTS", dots)
it.thisObject.putObject("MAX_STATIC_ICONS", icons)
it.thisObject.putObject("MAX_VISIBLE_ICONS_ON_LOCK", icons)
} else {
it.thisObject.putObject("MAX_DOTS", 0)
it.thisObject.putObject("MAX_STATIC_ICONS", 0)
it.thisObject.putObject("MAX_VISIBLE_ICONS_ON_LOCK", 0)
}
it.thisObject.invokeMethod("updateState")
}
}
}

View File

@@ -4,46 +4,192 @@ import android.content.ComponentName
import android.content.Intent import android.content.Intent
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import com.github.kyuubiran.ezxhelper.utils.loadClass import androidx.constraintlayout.widget.ConstraintLayout
import com.lt2333.simplicitytools.util.* import cn.fkj233.ui.activity.dp2px
import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.SystemProperties
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.view.WeatherView import com.lt2333.simplicitytools.view.WeatherView
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class NotificationWeather : IXposedHookLoadPackage { object NotificationWeather : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
hasEnable("notification_weather") { override fun init() = hasEnable("notification_weather") {
var mWeatherView: TextView? = null var mWeatherView: TextView? = null
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false) var mConstraintLayout: ConstraintLayout? = null
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(lpparam.classLoader, "onFinishInflate") { val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
val viewGroup = it.thisObject as ViewGroup findMethod("com.android.systemui.qs.MiuiNotificationHeaderView") {
val context = viewGroup.context name == "onFinishInflate"
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 }.hookAfter { param ->
layoutParam.setObjectField("bottomToTop", context.resources.getIdentifier("date_time", "id", context.packageName)) val viewGroup = param.thisObject as ViewGroup
layoutParam.setObjectField("startToEnd", context.resources.getIdentifier("big_time", "id", context.packageName)) val context = viewGroup.context
layoutParam.marginStart = context.resources.getDimensionPixelSize(context.resources.getIdentifier("notification_panel_time_date_space", "dimen", context.packageName))
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 &&
!SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM")
) {
//获取原组件
val big_time_ID =
context.resources.getIdentifier("big_time", "id", context.packageName)
val big_time: TextView = viewGroup.findViewById(big_time_ID)
val date_time_ID =
context.resources.getIdentifier("date_time", "id", context.packageName)
val date_time: TextView = viewGroup.findViewById(date_time_ID)
//创建新布局
val mConstraintLayoutLp = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
).also {
it.topMargin = context.resources.getDimensionPixelSize(
context.resources.getIdentifier(
"qs_control_header_tiles_margin_top",
"dimen",
context.packageName
)
)
}
mConstraintLayout =
ConstraintLayout(context).also { it.layoutParams = mConstraintLayoutLp }
(big_time.parent as ViewGroup).addView(mConstraintLayout, 0)
//从原布局中删除组件
(big_time.parent as ViewGroup).removeView(big_time)
(date_time.parent as ViewGroup).removeView(date_time)
//添加组件至新布局
mConstraintLayout!!.addView(big_time)
mConstraintLayout!!.addView(date_time)
//组件属性
val date_time_LP = ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.WRAP_CONTENT,
ConstraintLayout.LayoutParams.WRAP_CONTENT
).also {
it.startToEnd = big_time_ID
it.bottomToBottom = 0
it.marginStart = context.resources.getDimensionPixelSize(
context.resources.getIdentifier(
"notification_panel_time_date_space",
"dimen",
context.packageName
)
)
it.bottomMargin = dp2px(context, 5f)
}
date_time.layoutParams = date_time_LP
//创建天气组件
mWeatherView = WeatherView(context, isDisplayCity).apply { mWeatherView = WeatherView(context, isDisplayCity).apply {
setTextAppearance(context.resources.getIdentifier("TextAppearance.QSControl.Date", "style", context.packageName)) setTextAppearance(
context.resources.getIdentifier(
"TextAppearance.QSControl.Date",
"style",
context.packageName
)
)
}
mConstraintLayout!!.addView(mWeatherView)
val mWeatherView_LP = ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.WRAP_CONTENT,
ConstraintLayout.LayoutParams.WRAP_CONTENT
).also {
it.startToEnd = big_time_ID
it.bottomToTop = date_time_ID
it.marginStart = context.resources.getDimensionPixelSize(
context.resources.getIdentifier(
"notification_panel_time_date_space",
"dimen",
context.packageName
)
)
}
(mWeatherView as WeatherView).layoutParams = mWeatherView_LP
} else {
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.putObject(
"bottomToTop",
context.resources.getIdentifier("date_time", "id", context.packageName)
)
layoutParam.putObject(
"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 layoutParams = layoutParam
} }
viewGroup.addView(mWeatherView) viewGroup.addView(mWeatherView)
(mWeatherView as WeatherView).setOnClickListener { }
try {
val intent = Intent().apply { (mWeatherView as WeatherView).setOnClickListener {
flags = Intent.FLAG_ACTIVITY_NEW_TASK try {
component = ComponentName("com.miui.weather2", "com.miui.weather2.ActivityWeatherMain") val intent = Intent().apply {
} flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent) component = ComponentName(
} catch (e: Exception) { "com.miui.weather2",
Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show() "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 findMethod("com.android.systemui.qs.MiuiNotificationHeaderView") {
name == "updateLayout"
}.hookAfter {
val viewGroup = it.thisObject as ViewGroup
val context = viewGroup.context
val mOrientation = viewGroup.getObject("mOrientation") as Int
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
if (SystemProperties[context, "ro.build.date.utc"]!!.toInt() >= 1647014400 && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith(
"DEV"
) && !SystemProperties[context, "ro.build.version.incremental"]!!.endsWith("XM")
) {
if (mOrientation == 1) {
mConstraintLayout!!.visibility = View.VISIBLE
} else {
mConstraintLayout!!.visibility = View.GONE
}
} else {
if (mOrientation == 1) { if (mOrientation == 1) {
mWeatherView!!.visibility = View.VISIBLE mWeatherView!!.visibility = View.VISIBLE
} else { } else {

View File

@@ -6,55 +6,93 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import com.github.kyuubiran.ezxhelper.utils.loadClass import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.* import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.view.WeatherView import com.lt2333.simplicitytools.view.WeatherView
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class OldNotificationWeather : IXposedHookLoadPackage { object OldNotificationWeather : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
hasEnable("notification_weather") { override fun init() = hasEnable("notification_weather") {
var mWeatherView: TextView? = null var mWeatherView: TextView? = null
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false) val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(lpparam.classLoader, "onFinishInflate") { findMethod("com.android.systemui.qs.MiuiQSHeaderView") {
val viewGroup = it.thisObject as ViewGroup name == "onFinishInflate"
val context = viewGroup.context }.hookAfter {
val layoutParam = loadClass("androidx.constraintlayout.widget.ConstraintLayout\$LayoutParams") 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) .getConstructor(Int::class.java, Int::class.java)
.newInstance(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) as ViewGroup.MarginLayoutParams .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.putObject(
layoutParam.setObjectField("topToTop", context.resources.getIdentifier("notification_shade_shortcut", "id", context.packageName)) "endToStart",
layoutParam.setObjectField("bottomToBottom", context.resources.getIdentifier("notification_shade_shortcut", "id", context.packageName)) context.resources.getIdentifier(
"notification_shade_shortcut",
"id",
context.packageName
)
)
layoutParam.putObject(
"topToTop",
context.resources.getIdentifier(
"notification_shade_shortcut",
"id",
context.packageName
)
)
layoutParam.putObject(
"bottomToBottom",
context.resources.getIdentifier(
"notification_shade_shortcut",
"id",
context.packageName
)
)
mWeatherView = WeatherView(context, isDisplayCity).apply { mWeatherView = WeatherView(context, isDisplayCity).apply {
setTextAppearance(context.resources.getIdentifier("TextAppearance.StatusBar.Expanded.Clock.QuickSettingDate", "style", context.packageName)) setTextAppearance(
layoutParams = layoutParam context.resources.getIdentifier(
} "TextAppearance.StatusBar.Expanded.Clock.QuickSettingDate",
viewGroup.addView(mWeatherView) "style",
(mWeatherView as WeatherView).setOnClickListener { context.packageName
try { )
val intent = Intent().apply { )
flags = Intent.FLAG_ACTIVITY_NEW_TASK layoutParams = layoutParam
component = ComponentName("com.miui.weather2", "com.miui.weather2.ActivityWeatherMain")
}
context.startActivity(intent)
} catch (e: Exception) {
Toast.makeText(context, "启动失败,可能是不支持", Toast.LENGTH_LONG).show()
}
}
} }
//解决横屏重叠 viewGroup.addView(mWeatherView)
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(lpparam.classLoader, "updateLayout") { (mWeatherView as WeatherView).setOnClickListener {
val mOritation = it.thisObject.getObjectField("mOrientation") as Int try {
if (mOritation == 1) { val intent = Intent().apply {
mWeatherView!!.visibility = View.VISIBLE flags = Intent.FLAG_ACTIVITY_NEW_TASK
} else { component = ComponentName(
mWeatherView!!.visibility = View.GONE "com.miui.weather2",
"com.miui.weather2.ActivityWeatherMain"
)
}
context.startActivity(intent)
} catch (e: Exception) {
Toast.makeText(context, "启动失败,可能是不支持", Toast.LENGTH_LONG).show()
} }
} }
} }
}
}
//解决横屏重叠
findMethod("com.android.systemui.qs.MiuiQSHeaderView") {
name == "updateLayout"
}.hookAfter {
val mOritation = it.thisObject.getObject("mOrientation") as Int
if (mOritation == 1) {
mWeatherView!!.visibility = View.VISIBLE
} else {
mWeatherView!!.visibility = View.GONE
}
}
}
}

View File

@@ -0,0 +1,50 @@
package com.lt2333.simplicitytools.hook.app.systemui
import android.content.res.Configuration
import android.view.ViewGroup
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object OldQSCustom : HookRegister() {
override fun init() = hasEnable("old_qs_custom_switch") {
val mRows = XSPUtils.getInt("qs_custom_rows", 3)
val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2)
val mColumns = XSPUtils.getInt("qs_custom_columns", 4)
val mColumnsUnexpanded = XSPUtils.getInt("qs_custom_columns_unexpanded", 5)
findMethod("com.android.systemui.qs.MiuiQuickQSPanel") {
name == "setMaxTiles" && parameterCount == 1
}.hookBefore {
//未展开时的列数
it.args[0] = mColumnsUnexpanded
}
findMethod("com.android.systemui.qs.MiuiTileLayout") {
name == "updateColumns"
}.hookAfter {
//展开时的列数
it.thisObject.putObject("mColumns", mColumns)
}
findMethod("com.android.systemui.qs.MiuiTileLayout") {
name == "updateResources"
}.hookAfter {
//展开时的行数
val viewGroup = it.thisObject as ViewGroup
val mConfiguration: Configuration = viewGroup.context.resources.configuration
if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
viewGroup.putObject("mMaxAllowedRows", mRows)
} else {
viewGroup.putObject("mMaxAllowedRows", mRowsHorizontal)
}
viewGroup.requestLayout()
}
}
}

View File

@@ -2,34 +2,42 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import com.lt2333.simplicitytools.util.getObjectField import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.util.hookBeforeMethod
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class RemoveLockScreenCamera : IXposedHookLoadPackage { object RemoveLockScreenCamera : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
override fun init() {
//屏蔽右下角组件显示 //屏蔽右下角组件显示
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".hookAfterMethod(lpparam.classLoader, "onFinishInflate") { findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") {
name == "onFinishInflate"
}.hookAfter {
hasEnable("remove_lock_screen_camera") { hasEnable("remove_lock_screen_camera") {
(it.thisObject.getObjectField("mRightAffordanceViewLayout") as LinearLayout).visibility = View.GONE (it.thisObject.getObject("mRightAffordanceViewLayout") as LinearLayout).visibility =
View.GONE
} }
} }
//屏蔽滑动撞墙动画 //屏蔽滑动撞墙动画
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(lpparam.classLoader, "onTouchMove", Float::class.java, Float::class.java) { findMethod("com.android.keyguard.KeyguardMoveRightController") {
name == "onTouchMove" && parameterCount == 2
}.hookBefore {
hasEnable("remove_lock_screen_camera") { hasEnable("remove_lock_screen_camera") {
it.result = false it.result = false
} }
} }
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(lpparam.classLoader, "reset") { findMethod("com.android.keyguard.KeyguardMoveRightController") {
name == "reset"
}.hookBefore {
hasEnable("remove_lock_screen_camera") { hasEnable("remove_lock_screen_camera") {
it.result = null it.result = null
} }
} }
} }
} }

View File

@@ -1,16 +1,20 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class RemoveTheLeftSideOfTheLockScreen : IXposedHookLoadPackage { object RemoveTheLeftSideOfTheLockScreen : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
"com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer".hookBeforeMethod(lpparam.classLoader, "inflateLeftView") { override fun init() {
findMethod("com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer") {
name == "inflateLeftView"
}.hookBefore {
hasEnable("remove_the_left_side_of_the_lock_screen") { hasEnable("remove_the_left_side_of_the_lock_screen") {
it.result = null it.result = null
} }
} }
} }
} }

View File

@@ -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")
}
}
}
}

View File

@@ -0,0 +1,40 @@
package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object ShowWifiStandard : HookRegister() {
override fun init() {
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
name == "initViewState" && parameterCount == 1
}.hookBefore {
hasEnable("show_wifi_standard") {
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") {
name == "copyTo" && parameterCount == 1
}.hookBefore {
val wifiStandard = it.thisObject.getObjectAs<Int>("wifiStandard")
it.thisObject.putObject("showWifiStandard", wifiStandard != 0)
}
}
}
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
name == "updateState" && parameterCount == 1
}.hookBefore {
hasEnable("show_wifi_standard") {
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") {
name == "copyTo" && parameterCount == 1
}.hookBefore {
val wifiStandard = it.thisObject.getObjectAs<Int>("wifiStandard")
it.thisObject.putObject("showWifiStandard", wifiStandard != 0)
}
}
}
}
}

View File

@@ -0,0 +1,123 @@
package com.lt2333.simplicitytools.hook.app.systemui
import android.content.Context
import android.content.res.Resources
import android.graphics.Typeface
import android.util.TypedValue
import android.view.Gravity
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object StatusBarBigMobileTypeIcon : HookRegister() {
private val upAndDownPosition = XSPUtils.getInt("big_mobile_type_icon_up_and_down_position", 0)
private val leftAndRightMargin =
XSPUtils.getInt("big_mobile_type_icon_left_and_right_margins", 0)
private val isBold = XSPUtils.getBoolean("big_mobile_type_icon_bold", true)
private val size = XSPUtils.getFloat("big_mobile_type_icon_size", 12.5f)
override fun init() = hasEnable("big_mobile_type_icon") {
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
name == "init"
}.hookAfter { param ->
val statusBarMobileView = param.thisObject as ViewGroup
val context: Context = statusBarMobileView.context
val res: Resources = context.resources
//获取组件
val mobileContainerLeftId: Int =
res.getIdentifier("mobile_container_left", "id", "com.android.systemui")
val mobileContainerLeft =
statusBarMobileView.findViewById<ViewGroup>(mobileContainerLeftId)
val mobileTypeId: Int =
res.getIdentifier("mobile_type", "id", "com.android.systemui")
val mobileType = statusBarMobileView.findViewById<TextView>(mobileTypeId)
val mobileLeftMobileInoutId: Int = res.getIdentifier(
"mobile_left_mobile_inout",
"id",
"com.android.systemui"
)
val mobileLeftMobileInout =
statusBarMobileView.findViewById<ImageView>(mobileLeftMobileInoutId)
//获取插入位置
val mobileContainerRightId: Int = res.getIdentifier(
"mobile_container_right",
"id",
"com.android.systemui"
)
val mobileContainerRight =
statusBarMobileView.findViewById<ViewGroup>(mobileContainerRightId)
val rightParentLayout = mobileContainerRight.parent as ViewGroup
val mobileContainerRightIndex =
rightParentLayout.indexOfChild(mobileContainerRight)
//创建新布局
val newLinearLayoutLP = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.MATCH_PARENT
)
val newLinearlayout = LinearLayout(context).also {
it.layoutParams = newLinearLayoutLP
it.id = mobileContainerLeftId
it.setPadding(leftAndRightMargin, 0, leftAndRightMargin, 0)
}
param.thisObject.putObject("mMobileLeftContainer", newLinearlayout)
rightParentLayout.addView(
newLinearlayout,
mobileContainerRightIndex
)
//将组件插入新的布局
(mobileType.parent as ViewGroup).removeView(mobileType)
(mobileLeftMobileInout.parent as ViewGroup).removeView(mobileLeftMobileInout)
(mobileContainerLeft.parent as ViewGroup).removeView(mobileContainerLeft)
newLinearlayout.addView(mobileType) //类型
val mobileTypeLp = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
).also {
it.gravity = Gravity.CENTER_VERTICAL
it.topMargin = upAndDownPosition
}
mobileType.also {
it.setTextSize(TypedValue.COMPLEX_UNIT_DIP, size)
if (isBold) {
it.typeface = Typeface.DEFAULT_BOLD
}
it.layoutParams = mobileTypeLp
}
newLinearlayout.addView(mobileLeftMobileInout) //箭头
val mobileLeftMobileInoutLp = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.MATCH_PARENT
)
mobileLeftMobileInout.also {
it.layoutParams = mobileLeftMobileInoutLp
}
//屏蔽更新布局
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
name == "updateMobileTypeLayout" && parameterTypes[0] == String::class.java
}.hookReturnConstant(null)
}
}
}

View File

@@ -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)
}
}
}

View File

@@ -0,0 +1,65 @@
package com.lt2333.simplicitytools.hook.app.systemui
import android.content.Context
import android.os.SystemClock
import android.view.MotionEvent
import android.view.View.OnTouchListener
import android.view.ViewGroup
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers
import kotlin.math.abs
object StatusBarDoubleTapToSleep : HookRegister() {
override fun init() = hasEnable("status_bar_double_tap_to_sleep") {
findMethod("com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView") {
name == "onFinishInflate"
}.hookBefore {
val view = it.thisObject as ViewGroup
XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", 0f)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", 0f)
view.setOnTouchListener(OnTouchListener { v, event ->
if (event.action != MotionEvent.ACTION_DOWN) return@OnTouchListener false
var currentTouchTime =
XposedHelpers.getAdditionalInstanceField(view, "currentTouchTime") as Long
var currentTouchX =
XposedHelpers.getAdditionalInstanceField(view, "currentTouchX") as Float
var currentTouchY =
XposedHelpers.getAdditionalInstanceField(view, "currentTouchY") as Float
val lastTouchTime = currentTouchTime
val lastTouchX = currentTouchX
val lastTouchY = currentTouchY
currentTouchTime = System.currentTimeMillis()
currentTouchX = event.x
currentTouchY = event.y
if (currentTouchTime - lastTouchTime < 250L && abs(currentTouchX - lastTouchX) < 100f && abs(
currentTouchY - lastTouchY
) < 100f
) {
XposedHelpers.callMethod(
v.context.getSystemService(Context.POWER_SERVICE),
"goToSleep",
SystemClock.uptimeMillis()
)
currentTouchTime = 0L
currentTouchX = 0f
currentTouchY = 0f
}
XposedHelpers.setAdditionalInstanceField(
view,
"currentTouchTime",
currentTouchTime
)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", currentTouchX)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", currentTouchY)
v.performClick()
false
})
}
}
}

View File

@@ -1,172 +1,422 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import android.app.KeyguardManager
import android.content.Context import android.content.Context
import android.content.res.Configuration import android.content.res.Configuration
import android.content.res.Resources import android.content.res.Resources
import android.os.Bundle
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import cn.fkj233.ui.activity.dp2px
import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.findClass import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.getObjectField import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.util.hookAfterMethod
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class StatusBarLayout : IXposedHookLoadPackage { object StatusBarLayout : HookRegister() {
private var mLeftLayout: LinearLayout? = null private val getMode = XSPUtils.getInt("status_bar_layout_mode", 0)
private var mRightLayout: LinearLayout? = null private val getHoleLocation = XSPUtils.getInt("screen_hole_location", 0)
private var mCenterLayout: LinearLayout? = null
private var status_bar: ViewGroup? = null
private var status_bar_left = 0 private var statusBarLeft = 0
private var status_bar_top = 0 private var statusBarTop = 0
private var status_bar_right = 0 private var statusBarRight = 0
private var status_bar_bottom = 0 private var statusBarBottom = 0
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun init() {
if (!XSPUtils.getBoolean("status_bar_time_center", false)) return var mLeftLayout: LinearLayout? = null
var mRightLayout: LinearLayout? = null
var mCenterLayout: LinearLayout?
var statusBar: ViewGroup? = null
val collapsedStatusBarFragmentClass = fun updateLayout(context: Context) {
"com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(lpparam.classLoader) //判断屏幕方向
val mConfiguration: Configuration = context.resources.configuration
collapsedStatusBarFragmentClass.hookAfterMethod( if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
"onViewCreated", mLeftLayout!!.setPadding(statusBarLeft, 0, 0, 0)
View::class.java, mRightLayout!!.setPadding(0, 0, statusBarRight, 0)
Bundle::class.java statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
) { param -> } else {
val MiuiPhoneStatusBarView: ViewGroup = //横屏状态
param.thisObject.getObjectField("mStatusBar") as ViewGroup mLeftLayout!!.setPadding(175, 0, 0, 0)
val context: Context = MiuiPhoneStatusBarView.context mRightLayout!!.setPadding(0, 0, 175, 0)
val res: Resources = MiuiPhoneStatusBarView.resources statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
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) if (getHoleLocation == 1) {
findMethod("com.android.systemui.ScreenDecorations\$DisplayCutoutView") {
name == "boundsFromDirection" && parameterCount == 3 && isStatic
}.hookBefore {
it.args[1] = 0
}
}
phoneStatusBarViewClass.hookAfterMethod("updateLayoutForCutout") { when (getMode) {
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) { //默认
val context = (it.thisObject as ViewGroup).context 0 -> return
updateLayout(context) //时钟居中
1 -> {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
name == "onViewCreated" && parameterCount == 2
}.hookAfter { param ->
val miuiPhoneStatusBarView =
param.thisObject.getObjectAs<ViewGroup>("mStatusBar")
val context: Context = miuiPhoneStatusBarView.context
val res: Resources = miuiPhoneStatusBarView.resources
val statusBarId: Int =
res.getIdentifier("status_bar", "id", "com.android.systemui")
val statusBarContentsId: Int =
res.getIdentifier("status_bar_contents", "id", "com.android.systemui")
val systemIconAreaId: Int =
res.getIdentifier("system_icon_area", "id", "com.android.systemui")
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
val phoneStatusBarLeftContainerId: Int =
res.getIdentifier(
"phone_status_bar_left_container",
"id",
"com.android.systemui"
)
val notificationIconAreaInnerId: Int =
res.getIdentifier(
"notification_icon_area_inner",
"id",
"com.android.systemui"
)
statusBar = miuiPhoneStatusBarView.findViewById(statusBarId)
val statusBarContents: ViewGroup =
miuiPhoneStatusBarView.findViewById(statusBarContentsId)
if (statusBar == null) return@hookAfter
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
val phoneStatusBarLeftContainer: ViewGroup =
miuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId)
val notificationIconAreaInner: ViewGroup =
miuiPhoneStatusBarView.findViewById(notificationIconAreaInnerId)
val systemIconArea: ViewGroup =
miuiPhoneStatusBarView.findViewById(systemIconAreaId)
(clock.parent as ViewGroup).removeView(clock)
(phoneStatusBarLeftContainer.parent as ViewGroup).removeView(
phoneStatusBarLeftContainer
)
(notificationIconAreaInner.parent as ViewGroup).removeView(
notificationIconAreaInner
)
(systemIconArea.parent as ViewGroup).removeView(systemIconArea)
val mConstraintLayout =
ConstraintLayout(context).also {
it.layoutParams = ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.MATCH_PARENT,
ConstraintLayout.LayoutParams.MATCH_PARENT
)
}
mConstraintLayout.addView(notificationIconAreaInner)
val fullscreen_notification_icon_area_lp = LinearLayout.LayoutParams(
ConstraintLayout.LayoutParams.MATCH_PARENT,
ConstraintLayout.LayoutParams.MATCH_PARENT
)
notificationIconAreaInner.layoutParams = fullscreen_notification_icon_area_lp
//增加一个左对齐布局
mLeftLayout = LinearLayout(context)
val leftLp: LinearLayout.LayoutParams =
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
mLeftLayout!!.layoutParams = leftLp
mLeftLayout!!.gravity = Gravity.START or Gravity.CENTER_VERTICAL
//增加一个居中布局
mCenterLayout = LinearLayout(context)
val centerLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.MATCH_PARENT
)
mCenterLayout!!.layoutParams = centerLp
mCenterLayout!!.gravity = Gravity.CENTER or Gravity.CENTER_VERTICAL
mRightLayout = LinearLayout(context)
val rightLp: LinearLayout.LayoutParams =
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
mRightLayout!!.layoutParams = rightLp
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
mLeftLayout!!.addView(phoneStatusBarLeftContainer)
mLeftLayout!!.addView(mConstraintLayout)
mCenterLayout!!.addView(clock)
mRightLayout!!.addView(systemIconArea)
statusBarContents.addView(mLeftLayout, 0)
statusBarContents.addView(mCenterLayout)
statusBarContents.addView(mRightLayout)
statusBarLeft = statusBar!!.paddingLeft
statusBarTop = statusBar!!.paddingTop
statusBarRight = statusBar!!.paddingRight
statusBarBottom = statusBar!!.paddingBottom
if (getHoleLocation == 2) {
val customLeftMargin = XSPUtils.getInt("status_bar_left_margin", 0)
if (customLeftMargin != 0) {
statusBarLeft = customLeftMargin
}
val customRightMargin = XSPUtils.getInt("status_bar_right_margin", 0)
if (customRightMargin != 0) {
statusBarRight = customRightMargin
}
updateLayout(context)
}
}
findMethod("com.android.systemui.statusbar.phone.PhoneStatusBarView") {
name == "updateLayoutForCutout"
}.hookAfter {
hasEnable("layout_compatibility_mode") {
val context = (it.thisObject as ViewGroup).context
updateLayout(context)
}
}
}
//时钟居右
2 -> {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
name == "onViewCreated" && parameterCount == 2
}.hookAfter { param ->
val miuiPhoneStatusBarView =
param.thisObject.getObjectAs<ViewGroup>("mStatusBar")
val context: Context = miuiPhoneStatusBarView.context
val res: Resources = miuiPhoneStatusBarView.resources
//组件ID
val statusBarId: Int =
res.getIdentifier("status_bar", "id", "com.android.systemui")
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
val batteryId: Int = res.getIdentifier("battery", "id", "com.android.systemui")
//查找组件
statusBar = miuiPhoneStatusBarView.findViewById(statusBarId)
if (statusBar == null) return@hookAfter
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
val battery: ViewGroup = miuiPhoneStatusBarView.findViewById(batteryId)
//新建布局
val rightLp = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.MATCH_PARENT
).also {
it.marginStart = dp2px(context, 5f)
}
mRightLayout = LinearLayout(context).also {
it.layoutParams = rightLp
}
//添加布局与组件
battery.addView(mRightLayout)
(clock.parent as ViewGroup).removeView(clock)
mRightLayout!!.addView(clock)
}
}
//时钟居中+图标居左
3 -> {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
name == "onViewCreated" && parameterCount == 2
}.hookAfter { param ->
val miuiPhoneStatusBarView =
param.thisObject.getObjectAs<ViewGroup>("mStatusBar")
val context: Context = miuiPhoneStatusBarView.context
val res: Resources = miuiPhoneStatusBarView.resources
val statusBarId: Int =
res.getIdentifier("status_bar", "id", "com.android.systemui")
val statusBarContentsId: Int =
res.getIdentifier("status_bar_contents", "id", "com.android.systemui")
val systemIconAreaId: Int =
res.getIdentifier("system_icon_area", "id", "com.android.systemui")
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
val phoneStatusBarLeftContainerId: Int =
res.getIdentifier(
"phone_status_bar_left_container",
"id",
"com.android.systemui"
)
val fullscreenNotificationIconAreaId: Int =
res.getIdentifier(
"fullscreen_notification_icon_area",
"id",
"com.android.systemui"
)
val statusIconsId: Int =
res.getIdentifier(
"statusIcons",
"id",
"com.android.systemui"
)
val systemIconsId: Int =
res.getIdentifier(
"system_icons",
"id",
"com.android.systemui"
)
val batteryId: Int =
res.getIdentifier(
"battery",
"id",
"com.android.systemui"
)
statusBar = miuiPhoneStatusBarView.findViewById(statusBarId)
val statusBarContents: ViewGroup =
miuiPhoneStatusBarView.findViewById(statusBarContentsId)
if (statusBar == null) return@hookAfter
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
val phoneStatusBarLeftContainer: ViewGroup =
miuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId)
val fullscreenNotificationIconArea: ViewGroup =
miuiPhoneStatusBarView.findViewById(fullscreenNotificationIconAreaId)
val systemIconArea: ViewGroup =
miuiPhoneStatusBarView.findViewById(systemIconAreaId)
val statusIcons: ViewGroup =
miuiPhoneStatusBarView.findViewById(statusIconsId)
val systemIcons: ViewGroup =
miuiPhoneStatusBarView.findViewById(systemIconsId)
val battery: ViewGroup =
miuiPhoneStatusBarView.findViewById(batteryId)
(clock.parent as ViewGroup).removeView(clock)
(phoneStatusBarLeftContainer.parent as ViewGroup).removeView(
phoneStatusBarLeftContainer
)
(systemIconArea.parent as ViewGroup).removeView(systemIconArea)
(statusIcons.parent as ViewGroup).removeView(statusIcons)
(systemIcons.parent as ViewGroup).removeView(systemIcons)
(battery.parent as ViewGroup).removeView(battery)
(fullscreenNotificationIconArea.parent as ViewGroup).removeView(
fullscreenNotificationIconArea
)
val mConstraintLayout =
ConstraintLayout(context).also {
it.layoutParams = ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.MATCH_PARENT,
ConstraintLayout.LayoutParams.MATCH_PARENT
)
}
mConstraintLayout.addView(fullscreenNotificationIconArea)
mConstraintLayout.addView(battery)
battery.layoutParams = ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.WRAP_CONTENT,
ConstraintLayout.LayoutParams.MATCH_PARENT
).also {
it.endToEnd = 0
}
fullscreenNotificationIconArea.layoutParams = ConstraintLayout.LayoutParams(
0,
ConstraintLayout.LayoutParams.MATCH_PARENT
).also {
it.startToEnd = batteryId
it.endToEnd = 0
}
fullscreenNotificationIconArea.layoutDirection = View.LAYOUT_DIRECTION_RTL
//增加一个左对齐布局
mLeftLayout = LinearLayout(context)
val leftLp: LinearLayout.LayoutParams =
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
mLeftLayout!!.layoutParams = leftLp
mLeftLayout!!.gravity = Gravity.START or Gravity.CENTER_VERTICAL
//增加一个居中布局
mCenterLayout = LinearLayout(context)
val centerLp: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.MATCH_PARENT
)
mCenterLayout!!.layoutParams = centerLp
mCenterLayout!!.gravity = Gravity.CENTER or Gravity.CENTER_VERTICAL
//增加一个右布局
mRightLayout = LinearLayout(context)
val rightLp: LinearLayout.LayoutParams =
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
mRightLayout!!.layoutParams = rightLp
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
mLeftLayout!!.addView(phoneStatusBarLeftContainer)
mLeftLayout!!.addView(statusIcons)
statusIcons.layoutDirection = View.LAYOUT_DIRECTION_RTL
mCenterLayout!!.addView(clock)
mRightLayout!!.addView(mConstraintLayout)
fullscreenNotificationIconArea.layoutDirection = View.LAYOUT_DIRECTION_RTL
statusBarContents.addView(mLeftLayout, 0)
statusBarContents.addView(mCenterLayout)
statusBarContents.addView(mRightLayout)
statusBarLeft = statusBar!!.paddingLeft
statusBarTop = statusBar!!.paddingTop
statusBarRight = statusBar!!.paddingRight
statusBarBottom = statusBar!!.paddingBottom
if (getHoleLocation == 2) {
val customLeftMargin = XSPUtils.getInt("status_bar_left_margin", 0)
if (customLeftMargin != 0) {
statusBarLeft = customLeftMargin
}
val customRightMargin = XSPUtils.getInt("status_bar_right_margin", 0)
if (customRightMargin != 0) {
statusBarRight = customRightMargin
}
updateLayout(context)
}
}
//兼容模式
findMethod("com.android.systemui.statusbar.phone.PhoneStatusBarView") {
name == "updateLayoutForCutout"
}.hookAfter {
if (getHoleLocation == 2) {
val context = (it.thisObject as ViewGroup).context
updateLayout(context)
}
}
//解决重叠
findMethod("com.android.systemui.statusbar.phone.MiuiCollapsedStatusBarFragment") {
name == "showClock" && parameterTypes[0] == Boolean::class.java
}.hookAfter {
val miuiPhoneStatusBarView = it.thisObject.getObjectAs<ViewGroup>("mStatusBar")
val res = miuiPhoneStatusBarView.resources
val status_bar_ID =
res.getIdentifier("status_bar", "id", "com.android.systemui")
val status_bar = miuiPhoneStatusBarView.findViewById<ViewGroup>(status_bar_ID)
//非锁屏下整个状态栏布局
val keyguardMgr =
status_bar.context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
if (keyguardMgr.isKeyguardLocked) {
status_bar!!.visibility = View.GONE
} else {
status_bar!!.visibility = View.VISIBLE
}
}
} }
} }
} }
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)
}
}
} }

View File

@@ -1,16 +1,20 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class StatusBarNetworkSpeedRefreshSpeed :IXposedHookLoadPackage { object StatusBarNetworkSpeedRefreshSpeed : HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(lpparam.classLoader, "postUpdateNetworkSpeedDelay", Long::class.java) { override fun init() {
findMethod("com.android.systemui.statusbar.policy.NetworkSpeedController") {
name == "postUpdateNetworkSpeedDelay" && parameterTypes[0] == Long::class.java
}.hookBefore {
hasEnable("status_bar_network_speed_refresh_speed") { hasEnable("status_bar_network_speed_refresh_speed") {
it.args[0] = 1000L it.args[0] = 1000L
} }
} }
} }
} }

View File

@@ -2,23 +2,25 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.res.Resources
import android.os.Handler import android.os.Handler
import android.provider.Settings import android.provider.Settings
import android.util.AttributeSet
import android.util.TypedValue import android.util.TypedValue
import android.view.Gravity
import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.findClass import com.lt2333.simplicitytools.util.xposed.base.HookRegister
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.lang.reflect.Method
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
class StatusBarTimeCustomization : IXposedHookLoadPackage { object StatusBarTimeCustomization : HookRegister() {
private val getMode = XSPUtils.getInt("custom_clock_mode", 0)
private val getClockSize = XSPUtils.getInt("status_bar_clock_size", 0)
private val getClockDoubleSize = XSPUtils.getInt("status_bar_clock_double_line_size", 0)
private val isYear = XSPUtils.getBoolean("status_bar_time_year", false) private val isYear = XSPUtils.getBoolean("status_bar_time_year", false)
private val isMonth = XSPUtils.getBoolean("status_bar_time_month", false) private val isMonth = XSPUtils.getBoolean("status_bar_time_month", false)
private val isDay = XSPUtils.getBoolean("status_bar_time_day", false) private val isDay = XSPUtils.getBoolean("status_bar_time_day", false)
@@ -28,67 +30,167 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
private val isSecond = XSPUtils.getBoolean("status_bar_time_seconds", false) private val isSecond = XSPUtils.getBoolean("status_bar_time_seconds", false)
private val isDoubleHour = XSPUtils.getBoolean("status_bar_time_double_hour", false) private val isDoubleHour = XSPUtils.getBoolean("status_bar_time_double_hour", false)
private val isPeriod = XSPUtils.getBoolean("status_bar_time_period", true) private val isPeriod = XSPUtils.getBoolean("status_bar_time_period", true)
private val getClockSize = XSPUtils.getInt("status_bar_clock_size", 0) private val isCenterAlign =
private val isOpen = XSPUtils.getBoolean("custom_clock_switch", false) XSPUtils.getBoolean("status_bar_time_double_line_center_align", false)
private val getClockDoubleSize = XSPUtils.getInt("status_bar_clock_double_line_size", 0)
private var now_time: Date? = null //极客模式
private val getGeekClockSize = XSPUtils.getInt("status_bar_clock_size_geek", 0)
private val getGeekFormat = XSPUtils.getString("custom_clock_format_geek", "HH:mm:ss")
private val isGeekCenterAlign =
XSPUtils.getBoolean("status_bar_time_center_align_geek", false)
private lateinit var nowTime: Date
private var str = "" private var str = ""
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun init() {
if (isOpen) { when (getMode) {
var c: Context? = null //预设模式
val miuiClockClass = "com.android.systemui.statusbar.views.MiuiClock".findClass(lpparam.classLoader) 1 -> {
miuiClockClass.hookAfterConstructor(Context::class.java, AttributeSet::class.java, Integer.TYPE) { var c: Context? = null
try {
c = it.args[0] as Context findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
val textV = it.thisObject as TextView paramCount == 3
textV.isSingleLine = false }.hookAfter {
if (isDoubleLine) { try {
str = "\n" c = it.args[0] as Context
var clock_double_line_size = 7F val textV = it.thisObject as TextView
if (getClockDoubleSize != 0) { if (textV.resources.getResourceEntryName(textV.id) != "clock") return@hookAfter
clock_double_line_size = getClockDoubleSize.toFloat() textV.isSingleLine = false
if (isDoubleLine) {
str = "\n"
var clockDoubleLineSize = 7F
if (getClockDoubleSize != 0) {
clockDoubleLineSize = getClockDoubleSize.toFloat()
}
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockDoubleLineSize)
textV.setLineSpacing(0F, 0.8F)
} else {
if (getClockSize != 0) {
val clockSize = getClockSize.toFloat()
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSize)
}
} }
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clock_double_line_size) val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
} else { val r = Runnable {
if (getClockSize != 0) { d.isAccessible = true
val clock_size = getClockSize.toFloat() d.invoke(textV)
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clock_size)
} }
}
val d: Method = textV.javaClass.getDeclaredMethod("updateTime") class T : TimerTask() {
val r = Runnable { override fun run() {
d.isAccessible = true Handler(textV.context.mainLooper).post(r)
d.invoke(textV) }
}
class T : TimerTask() {
override fun run() {
Handler(textV.context.mainLooper).post(r)
} }
Timer().scheduleAtFixedRate(
T(),
1000 - System.currentTimeMillis() % 1000,
1000
)
} catch (_: Exception) {
}
}
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
name == "updateTime"
}.hookAfter {
try {
val textV = it.thisObject as TextView
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
val t = Settings.System.getString(
c!!.contentResolver,
Settings.System.TIME_12_24
)
val is24 = t == "24"
nowTime = Calendar.getInstance().time
textV.text = getDate(c!!) + str + getTime(c!!, is24)
}
} catch (_: Exception) {
}
}
if (isCenterAlign) {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
name == "onViewCreated" && parameterCount == 2
}.hookAfter {
val miuiPhoneStatusBarView =
it.thisObject.getObject("mStatusBar") as ViewGroup
val res: Resources = miuiPhoneStatusBarView.resources
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
clock.gravity = Gravity.CENTER
} }
if (textV.resources.getResourceEntryName(textV.id) == "clock")
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000)
} catch (e: java.lang.Exception) {
} }
} }
miuiClockClass.hookAfterMethod("updateTime") { //极客模式
try { 2 -> {
val textV = it.thisObject as TextView var c: Context? = null
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
val t = Settings.System.getString(c!!.contentResolver, Settings.System.TIME_12_24) findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
now_time = Calendar.getInstance().time paramCount == 3
textV.text = getDate(c!!, t) + str + getTime(c!!, t) }.hookAfter {
try {
c = it.args[0] as Context
val textV = it.thisObject as TextView
if (textV.resources.getResourceEntryName(textV.id) != "clock") return@hookAfter
textV.isSingleLine = false
textV.setLineSpacing(0F, 0.8F)
if (getGeekClockSize != 0) {
val clockSize = getGeekClockSize.toFloat()
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSize)
}
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
val r = Runnable {
d.isAccessible = true
d.invoke(textV)
}
class T : TimerTask() {
override fun run() {
Handler(textV.context.mainLooper).post(r)
}
}
Timer().scheduleAtFixedRate(
T(),
1000 - System.currentTimeMillis() % 1000,
1000
)
} catch (_: Exception) {
}
}
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
name == "updateTime"
}.hookAfter {
try {
val textV = it.thisObject as TextView
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
nowTime = Calendar.getInstance().time
textV.text = SimpleDateFormat(getGeekFormat).format(nowTime)
}
} catch (_: Exception) {
}
}
if (isGeekCenterAlign) {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
name == "onViewCreated" && parameterCount == 2
}.hookAfter {
val miuiPhoneStatusBarView =
it.thisObject.getObject("mStatusBar") as ViewGroup
val res: Resources = miuiPhoneStatusBarView.resources
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
clock.gravity = Gravity.CENTER
} }
} catch (e: Exception) {
} }
} }
} }
} }
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
private fun getDate(context: Context, t: String): String { private fun getDate(context: Context): String {
var datePattern = "" var datePattern = ""
val isZh = isZh(context) val isZh = isZh(context)
@@ -124,17 +226,17 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
if (!isHideSpace) datePattern = "$datePattern " if (!isHideSpace) datePattern = "$datePattern "
} }
} }
datePattern = SimpleDateFormat(datePattern).format(now_time) datePattern = SimpleDateFormat(datePattern).format(nowTime)
return datePattern return datePattern
} }
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
private fun getTime(context: Context, t: String): String { private fun getTime(context: Context, t: Boolean): String {
var timePattern = "" var timePattern = ""
val isZh = isZh(context) val isZh = isZh(context)
timePattern += if (t == "24") "HH:mm" else "h:mm" timePattern += if (t) "HH:mm" else "h:mm"
if (isSecond) timePattern += ":ss" if (isSecond) timePattern += ":ss"
timePattern = SimpleDateFormat(timePattern).format(now_time) timePattern = SimpleDateFormat(timePattern).format(nowTime)
if (isZh) timePattern = getPeriod(isZh) + timePattern else timePattern += getPeriod(isZh) if (isZh) timePattern = getPeriod(isZh) + timePattern else timePattern += getPeriod(isZh)
timePattern = getDoubleHour() + timePattern timePattern = getDoubleHour() + timePattern
return timePattern return timePattern
@@ -145,7 +247,7 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
var period = "" var period = ""
if (isPeriod) { if (isPeriod) {
if (isZh) { if (isZh) {
when (SimpleDateFormat("HH").format(now_time)) { when (SimpleDateFormat("HH").format(nowTime)) {
"00", "01", "02", "03", "04", "05" -> { "00", "01", "02", "03", "04", "05" -> {
period = "凌晨" period = "凌晨"
} }
@@ -166,7 +268,7 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
} }
} }
} else { } else {
period = SimpleDateFormat("a").format(now_time) period = SimpleDateFormat("a").format(nowTime)
if (!isHideSpace) { if (!isHideSpace) {
period = " $period" period = " $period"
} }
@@ -180,7 +282,7 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
private fun getDoubleHour(): String { private fun getDoubleHour(): String {
var doubleHour = "" var doubleHour = ""
if (isDoubleHour) { if (isDoubleHour) {
when (SimpleDateFormat("HH").format(now_time)) { when (SimpleDateFormat("HH").format(nowTime)) {
"23", "00" -> { "23", "00" -> {
doubleHour = "子时" doubleHour = "子时"
} }

View File

@@ -1,44 +1,41 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookMethod import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import de.robv.android.xposed.IXposedHookLoadPackage import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LoadPackage
class WaveCharge : IXposedHookLoadPackage { object WaveCharge: HookRegister() {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
override fun init() {
hasEnable("enable_wave_charge_animation") { hasEnable("enable_wave_charge_animation") {
findMethod("com.android.keyguard.charge.ChargeUtils") { findMethod("com.android.keyguard.charge.ChargeUtils") {
name == "supportWaveChargeAnimation" name == "supportWaveChargeAnimation"
}.hookMethod { }.hookAfter {
after { param -> val ex = Throwable()
val ex = Throwable() val stackElement = ex.stackTrace
val stackElement = ex.stackTrace var mResult = false
var mResult = false val classTrue = setOf(
val classTrue = setOf( "com.android.keyguard.charge.ChargeUtils",
"com.android.keyguard.charge.ChargeUtils", "com.android.keyguard.charge.container.MiuiChargeContainerView"
"com.android.keyguard.charge.container.MiuiChargeContainerView" )
) for (i in stackElement.indices) {
for (i in stackElement.indices) { when (stackElement[i].className) {
when (stackElement[i].className) { in classTrue -> {
in classTrue -> { mResult = true
mResult = true break
break
}
} }
} }
param.result = mResult
} }
it.result = mResult
} }
findMethod("com.android.keyguard.charge.wave.WaveView") { findMethod("com.android.keyguard.charge.wave.WaveView") {
name == "updateWaveHeight" name == "updateWaveHeight"
}.hookMethod { }.hookAfter {
after { param -> it.thisObject.putObject("mWaveXOffset", 0)
XposedHelpers.setIntField(param.thisObject, "mWaveXOffset", 0)
}
} }
} }
} }
} }

View File

@@ -1,17 +1,20 @@
package com.lt2333.simplicitytools.hook.app.thememanager package com.lt2333.simplicitytools.hook.app.thememanager
import com.lt2333.simplicitytools.util.findClass import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class RemoveAds : IXposedHookLoadPackage { object RemoveAds : HookRegister() {
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)) { override fun init() {
findMethod("com.android.thememanager.basemodule.ad.model.AdInfoResponse") {
name == "isAdValid" && parameterCount == 1
}.hookBefore {
hasEnable("remove_thememanager_ads") { hasEnable("remove_thememanager_ads") {
it.result = false it.result = false
} }
} }
} }
} }

View File

@@ -3,32 +3,38 @@ package com.lt2333.simplicitytools.tile
import android.service.quicksettings.Tile import android.service.quicksettings.Tile
import android.service.quicksettings.TileService import android.service.quicksettings.TileService
class AllowScreenshots : TileService(){ class AllowScreenshots : TileService() {
val key = "disable_flag_secure" val key = "disable_flag_secure"
override fun onClick() { override fun onClick() {
super.onClick() super.onClick()
val pref = getSharedPreferences("config", MODE_WORLD_READABLE) try {
val prefEditor = pref.edit() val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
if (pref.getBoolean(key, false)) { val prefEditor = pref.edit()
prefEditor.putBoolean(key, false) if (pref.getBoolean(key, false)) {
qsTile.state = Tile.STATE_INACTIVE prefEditor.putBoolean(key, false)
} else { qsTile.state = Tile.STATE_INACTIVE
prefEditor.putBoolean(key, true) } else {
qsTile.state = Tile.STATE_ACTIVE prefEditor.putBoolean(key, true)
qsTile.state = Tile.STATE_ACTIVE
}
prefEditor.commit()
qsTile.updateTile()
} catch (e: SecurityException) {
} }
prefEditor.commit()
qsTile.updateTile()
} }
override fun onStartListening() { override fun onStartListening() {
super.onStartListening() super.onStartListening()
val pref = getSharedPreferences("config", MODE_WORLD_READABLE) try {
if (pref.getBoolean(key, false)) { val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
qsTile.state = Tile.STATE_ACTIVE if (pref.getBoolean(key, false)) {
} else { qsTile.state = Tile.STATE_ACTIVE
qsTile.state = Tile.STATE_INACTIVE } else {
qsTile.state = Tile.STATE_INACTIVE
}
qsTile.updateTile()
} catch (e: SecurityException) {
} }
qsTile.updateTile()
} }
} }

View File

@@ -9,28 +9,33 @@ class LockMaxFpsTile : TileService() {
override fun onClick() { override fun onClick() {
super.onClick() super.onClick()
val pref = getSharedPreferences("config", MODE_WORLD_READABLE) try {
val prefEditor = pref.edit() val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
if (pref.getBoolean(key, false)) { val prefEditor = pref.edit()
prefEditor.putBoolean(key, false) if (pref.getBoolean(key, false)) {
qsTile.state = Tile.STATE_INACTIVE prefEditor.putBoolean(key, false)
} else { qsTile.state = Tile.STATE_INACTIVE
prefEditor.putBoolean(key, true) } else {
qsTile.state = Tile.STATE_ACTIVE prefEditor.putBoolean(key, true)
qsTile.state = Tile.STATE_ACTIVE
}
prefEditor.commit()
qsTile.updateTile()
} catch (e: SecurityException) {
} }
prefEditor.commit()
qsTile.updateTile()
} }
override fun onStartListening() { override fun onStartListening() {
super.onStartListening() super.onStartListening()
val pref = getSharedPreferences("config", MODE_WORLD_READABLE) try {
if (pref.getBoolean(key, false)) { val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
qsTile.state = Tile.STATE_ACTIVE if (pref.getBoolean(key, false)) {
} else { qsTile.state = Tile.STATE_ACTIVE
qsTile.state = Tile.STATE_INACTIVE } else {
qsTile.state = Tile.STATE_INACTIVE
}
qsTile.updateTile()
} catch (e: SecurityException) {
} }
qsTile.updateTile()
} }
} }

View File

@@ -1,502 +0,0 @@
package com.lt2333.simplicitytools.util
import android.content.res.XResources
import android.util.Log
import dalvik.system.BaseDexClassLoader
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XC_MethodReplacement
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LayoutInflated
import java.lang.reflect.Field
import java.lang.reflect.Member
import java.util.*
const val TAG = "SimplicityTools"
fun log(any: Any?, online: Boolean = false) {
val msg: String = if (any is Throwable) Log.getStackTraceString(any) else any.toString()
// Log.d(TAG, msg)
XposedBridge.log("$TAG: $msg")
}
typealias MethodHookParam = XC_MethodHook.MethodHookParam
typealias Replacer = (XC_MethodHook.MethodHookParam) -> Any?
typealias Hooker = (XC_MethodHook.MethodHookParam) -> Unit
fun Class<*>.hookMethod(method: String?, vararg args: Any?) = try {
XposedHelpers.findAndHookMethod(this, method, *args)
} catch (e: NoSuchMethodError) {
log(e)
null
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
fun Member.hookMethod(callback: XC_MethodHook) = try {
XposedBridge.hookMethod(this, callback)
} catch (e: Throwable) {
log(e)
null
}
inline fun XC_MethodHook.MethodHookParam.callHooker(crossinline hooker: Hooker) = try {
hooker(this)
} catch (e: Throwable) {
log("Error occurred calling hooker on ${this.method}")
log(e)
}
inline fun XC_MethodHook.MethodHookParam.callReplacer(crossinline replacer: Replacer) = try {
replacer(this)
} catch (e: Throwable) {
log("Error occurred calling replacer on ${this.method}")
log(e)
null
}
inline fun Member.replaceMethod(crossinline replacer: Replacer) =
hookMethod(object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callReplacer(replacer)
})
inline fun Member.hookAfterMethod(crossinline hooker: Hooker) =
hookMethod(object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Member.hookBeforeMethod(crossinline hooker: (XC_MethodHook.MethodHookParam) -> Unit) =
hookMethod(object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookBeforeMethod(
method: String?,
vararg args: Any?,
crossinline hooker: Hooker
) = hookMethod(method, *args, object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookAfterMethod(
method: String?,
vararg args: Any?,
crossinline hooker: Hooker
) = hookMethod(method, *args, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.replaceMethod(
method: String?,
vararg args: Any?,
crossinline replacer: Replacer
) = hookMethod(method, *args, object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callReplacer(replacer)
})
fun Class<*>.hookAllMethods(methodName: String?, hooker: XC_MethodHook): Set<XC_MethodHook.Unhook> =
try {
XposedBridge.hookAllMethods(this, methodName, hooker)
} catch (e: NoSuchMethodError) {
log(e)
emptySet()
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
emptySet()
} catch (e: ClassNotFoundException) {
log(e)
emptySet()
}
inline fun Class<*>.hookBeforeAllMethods(methodName: String?, crossinline hooker: Hooker) =
hookAllMethods(methodName, object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookAfterAllMethods(methodName: String?, crossinline hooker: Hooker) =
hookAllMethods(methodName, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.replaceAfterAllMethods(methodName: String?, crossinline replacer: Replacer) =
hookAllMethods(methodName, object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callReplacer(replacer)
})
fun Class<*>.hookConstructor(vararg args: Any?) = try {
XposedHelpers.findAndHookConstructor(this, *args)
} catch (e: NoSuchMethodError) {
log(e)
null
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
inline fun Class<*>.hookBeforeConstructor(vararg args: Any?, crossinline hooker: Hooker) =
hookConstructor(*args, object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookAfterConstructor(vararg args: Any?, crossinline hooker: Hooker) =
hookConstructor(*args, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.replaceConstructor(vararg args: Any?, crossinline hooker: Hooker) =
hookConstructor(*args, object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
fun Class<*>.hookAllConstructors(hooker: XC_MethodHook): Set<XC_MethodHook.Unhook> = try {
XposedBridge.hookAllConstructors(this, hooker)
} catch (e: NoSuchMethodError) {
log(e)
emptySet()
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
emptySet()
} catch (e: ClassNotFoundException) {
log(e)
emptySet()
}
inline fun Class<*>.hookAfterAllConstructors(crossinline hooker: Hooker) =
hookAllConstructors(object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookBeforeAllConstructors(crossinline hooker: Hooker) =
hookAllConstructors(object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.replaceAfterAllConstructors(crossinline hooker: Hooker) =
hookAllConstructors(object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
fun String.hookMethod(classLoader: ClassLoader, method: String?, vararg args: Any?) = try {
findClass(classLoader).hookMethod(method, *args)
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
inline fun String.hookBeforeMethod(
classLoader: ClassLoader,
method: String?,
vararg args: Any?,
crossinline hooker: Hooker
) = try {
findClass(classLoader).hookBeforeMethod(method, *args, hooker = hooker)
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
inline fun String.hookAfterMethod(
classLoader: ClassLoader,
method: String?,
vararg args: Any?,
crossinline hooker: Hooker
) = try {
findClass(classLoader).hookAfterMethod(method, *args, hooker = hooker)
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
inline fun String.replaceMethod(
classLoader: ClassLoader,
method: String?,
vararg args: Any?,
crossinline replacer: Replacer
) = try {
findClass(classLoader).replaceMethod(method, *args, replacer = replacer)
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
fun XC_MethodHook.MethodHookParam.invokeOriginalMethod(): Any? =
XposedBridge.invokeOriginalMethod(method, thisObject, args)
inline fun <T, R> T.runCatchingOrNull(func: T.() -> R?) = try {
func()
} catch (e: Throwable) {
null
}
fun Any.getObjectField(field: String?): Any? = XposedHelpers.getObjectField(this, field)
fun Any.getObjectFieldOrNull(field: String?): Any? = runCatchingOrNull {
XposedHelpers.getObjectField(this, field)
}
@Suppress("UNCHECKED_CAST")
fun <T> Any.getObjectFieldAs(field: String?) = XposedHelpers.getObjectField(this, field) as T
@Suppress("UNCHECKED_CAST")
fun <T> Any.getObjectFieldOrNullAs(field: String?) = runCatchingOrNull {
XposedHelpers.getObjectField(this, field) as T
}
fun Any.getIntField(field: String?) = XposedHelpers.getIntField(this, field)
fun Any.getIntFieldOrNull(field: String?) = runCatchingOrNull {
XposedHelpers.getIntField(this, field)
}
fun Any.getLongField(field: String?) = XposedHelpers.getLongField(this, field)
fun Any.getLongFieldOrNull(field: String?) = runCatchingOrNull {
XposedHelpers.getLongField(this, field)
}
fun Any.getBooleanFieldOrNull(field: String?) = runCatchingOrNull {
XposedHelpers.getBooleanField(this, field)
}
fun Any.callMethod(methodName: String?, vararg args: Any?): Any? =
XposedHelpers.callMethod(this, methodName, *args)
fun Any.callMethodOrNull(methodName: String?, vararg args: Any?): Any? = runCatchingOrNull {
XposedHelpers.callMethod(this, methodName, *args)
}
fun Class<*>.callStaticMethod(methodName: String?, vararg args: Any?): Any? =
XposedHelpers.callStaticMethod(this, methodName, *args)
fun Class<*>.callStaticMethodOrNull(methodName: String?, vararg args: Any?): Any? =
runCatchingOrNull {
XposedHelpers.callStaticMethod(this, methodName, *args)
}
@Suppress("UNCHECKED_CAST")
fun <T> Class<*>.callStaticMethodAs(methodName: String?, vararg args: Any?) =
XposedHelpers.callStaticMethod(this, methodName, *args) as T
@Suppress("UNCHECKED_CAST")
fun <T> Class<*>.callStaticMethodOrNullAs(methodName: String?, vararg args: Any?) =
runCatchingOrNull {
XposedHelpers.callStaticMethod(this, methodName, *args) as T
}
@Suppress("UNCHECKED_CAST")
fun <T> Class<*>.getStaticObjectFieldAs(field: String?) = XposedHelpers.getStaticObjectField(
this,
field
) as T
@Suppress("UNCHECKED_CAST")
fun <T> Class<*>.getStaticObjectFieldOrNullAs(field: String?) = runCatchingOrNull {
XposedHelpers.getStaticObjectField(this, field) as T
}
fun Class<*>.getStaticObjectField(field: String?): Any? =
XposedHelpers.getStaticObjectField(this, field)
fun Class<*>.getStaticObjectFieldOrNull(field: String?): Any? = runCatchingOrNull {
XposedHelpers.getStaticObjectField(this, field)
}
fun Class<*>.setStaticObjectField(field: String?, obj: Any?) = apply {
XposedHelpers.setStaticObjectField(this, field, obj)
}
fun Class<*>.setStaticObjectFieldIfExist(field: String?, obj: Any?) = apply {
try {
XposedHelpers.setStaticObjectField(this, field, obj)
} catch (ignored: Throwable) {
}
}
inline fun <reified T> Class<*>.findFieldByExactType(): Field? =
XposedHelpers.findFirstFieldByExactType(this, T::class.java)
fun Class<*>.findFieldByExactType(type: Class<*>): Field? =
XposedHelpers.findFirstFieldByExactType(this, type)
@Suppress("UNCHECKED_CAST")
fun <T> Any.callMethodAs(methodName: String?, vararg args: Any?) =
XposedHelpers.callMethod(this, methodName, *args) as T
@Suppress("UNCHECKED_CAST")
fun <T> Any.callMethodOrNullAs(methodName: String?, vararg args: Any?) = runCatchingOrNull {
XposedHelpers.callMethod(this, methodName, *args) as T
}
fun Any.callMethod(methodName: String?, parameterTypes: Array<Class<*>>, vararg args: Any?): Any? =
XposedHelpers.callMethod(this, methodName, parameterTypes, *args)
fun Any.callMethodOrNull(
methodName: String?,
parameterTypes: Array<Class<*>>,
vararg args: Any?
): Any? = runCatchingOrNull {
XposedHelpers.callMethod(this, methodName, parameterTypes, *args)
}
fun Class<*>.callStaticMethod(
methodName: String?,
parameterTypes: Array<Class<*>>,
vararg args: Any?
): Any? = XposedHelpers.callStaticMethod(this, methodName, parameterTypes, *args)
fun Class<*>.callStaticMethodOrNull(
methodName: String?,
parameterTypes: Array<Class<*>>,
vararg args: Any?
): Any? = runCatchingOrNull {
XposedHelpers.callStaticMethod(this, methodName, parameterTypes, *args)
}
fun String.findClass(classLoader: ClassLoader?): Class<*> =
XposedHelpers.findClass(this, classLoader)
fun String.findClassOrNull(classLoader: ClassLoader?): Class<*>? =
XposedHelpers.findClassIfExists(this, classLoader)
fun Class<*>.new(vararg args: Any?): Any = XposedHelpers.newInstance(this, *args)
fun Class<*>.new(parameterTypes: Array<Class<*>>, vararg args: Any?): Any =
XposedHelpers.newInstance(this, parameterTypes, *args)
fun Class<*>.findField(field: String?): Field = XposedHelpers.findField(this, field)
fun Class<*>.findFieldOrNull(field: String?): Field? = XposedHelpers.findFieldIfExists(this, field)
fun <T> T.setIntField(field: String?, value: Int) = apply {
XposedHelpers.setIntField(this, field, value)
}
fun <T> T.setLongField(field: String?, value: Long) = apply {
XposedHelpers.setLongField(this, field, value)
}
fun <T> T.setFloatField(field: String?, value: Float) = apply {
XposedHelpers.setFloatField(this, field, value)
}
fun <T> T.setObjectField(field: String?, value: Any?) = apply {
XposedHelpers.setObjectField(this, field, value)
}
fun <T> T.setBooleanField(field: String?, value: Boolean) = apply {
XposedHelpers.setBooleanField(this, field, value)
}
inline fun XResources.hookLayout(
id: Int,
crossinline hooker: (XC_LayoutInflated.LayoutInflatedParam) -> Unit
) {
try {
hookLayout(id, object : XC_LayoutInflated() {
override fun handleLayoutInflated(liparam: LayoutInflatedParam) {
try {
hooker(liparam)
} catch (e: Throwable) {
log(e)
}
}
})
} catch (e: Throwable) {
log(e)
}
}
inline fun XResources.hookLayout(
pkg: String,
type: String,
name: String,
crossinline hooker: (XC_LayoutInflated.LayoutInflatedParam) -> Unit
) {
try {
val id = getIdentifier(name, type, pkg)
hookLayout(id, hooker)
} catch (e: Throwable) {
log(e)
}
}
fun Class<*>.findFirstFieldByExactType(type: Class<*>): Field =
XposedHelpers.findFirstFieldByExactType(this, type)
fun Class<*>.findFirstFieldByExactTypeOrNull(type: Class<*>?): Field? = runCatchingOrNull {
XposedHelpers.findFirstFieldByExactType(this, type)
}
fun Any.getFirstFieldByExactType(type: Class<*>): Any? =
javaClass.findFirstFieldByExactType(type).get(this)
@Suppress("UNCHECKED_CAST")
fun <T> Any.getFirstFieldByExactTypeAs(type: Class<*>) =
javaClass.findFirstFieldByExactType(type).get(this) as? T
inline fun <reified T : Any> Any.getFirstFieldByExactType() =
javaClass.findFirstFieldByExactType(T::class.java).get(this) as? T
fun Any.getFirstFieldByExactTypeOrNull(type: Class<*>?): Any? = runCatchingOrNull {
javaClass.findFirstFieldByExactTypeOrNull(type)?.get(this)
}
@Suppress("UNCHECKED_CAST")
fun <T> Any.getFirstFieldByExactTypeOrNullAs(type: Class<*>?) =
getFirstFieldByExactTypeOrNull(type) as? T
inline fun <reified T> Any.getFirstFieldByExactTypeOrNull() =
getFirstFieldByExactTypeOrNull(T::class.java) as? T
fun ClassLoader.allClassesList(): List<String> {
var classLoader = this
while (classLoader !is BaseDexClassLoader) {
if (classLoader.parent != null) classLoader = classLoader.parent
else return emptyList()
}
return classLoader.getObjectField("pathList")
?.getObjectFieldAs<Array<Any>>("dexElements")
?.flatMap {
it.getObjectField("dexFile")?.callMethodAs<Enumeration<String>>("entries")?.toList()
.orEmpty()
}.orEmpty()
}
inline fun ClassLoader.findDexClassLoader(): BaseDexClassLoader? {
var classLoader = this
while (classLoader !is BaseDexClassLoader) {
if (classLoader.parent != null) classLoader = classLoader.parent
else return null
}
return classLoader
}
inline fun <T> T?.isNull(crossinline isNull: () -> Unit):T? {
if (this == null) isNull()
return this
}
inline fun <T> T?.isNonNull(crossinline nonNull: (T) -> Unit): T? {
if (this != null) nonNull(this)
return this
}

View File

@@ -8,9 +8,9 @@ import java.util.List;
public class ShellUtils { public class ShellUtils {
public static final String COMMAND_SU = "su"; public static final String COMMAND_SU = "su";
public static final String COMMAND_SH = "sh"; public static final String COMMAND_SH = "sh";
public static final String COMMAND_EXIT = "exit\n"; public static final String COMMAND_EXIT = "exit\n";
public static final String COMMAND_LINE_END = "\n"; public static final String COMMAND_LINE_END = "\n";
private ShellUtils() { private ShellUtils() {
@@ -30,31 +30,31 @@ public class ShellUtils {
* execute shell command, default return result msg * execute shell command, default return result msg
* *
* @param command command * @param command command
* @param isRoot whether need to run with root * @param isRoot whether need to run with root
* @return * @return
* @see ShellUtils#execCommand(String[], boolean, boolean) * @see ShellUtils#execCommand(String[], boolean, boolean)
*/ */
public static CommandResult execCommand(String command, boolean isRoot) { public static CommandResult execCommand(String command, boolean isRoot) {
return execCommand(new String[] {command}, isRoot, true); return execCommand(new String[]{command}, isRoot, true);
} }
/** /**
* execute shell commands, default return result msg * execute shell commands, default return result msg
* *
* @param commands command activity_wifi * @param commands command activity_wifi
* @param isRoot whether need to run with root * @param isRoot whether need to run with root
* @return * @return
* @see ShellUtils#execCommand(String[], boolean, boolean) * @see ShellUtils#execCommand(String[], boolean, boolean)
*/ */
public static CommandResult execCommand(List<String> commands, boolean isRoot) { public static CommandResult execCommand(List<String> commands, boolean isRoot) {
return execCommand(commands == null ? null : commands.toArray(new String[] {}), isRoot, true); return execCommand(commands == null ? null : commands.toArray(new String[]{}), isRoot, true);
} }
/** /**
* execute shell commands, default return result msg * execute shell commands, default return result msg
* *
* @param commands command array * @param commands command array
* @param isRoot whether need to run with root * @param isRoot whether need to run with root
* @return * @return
* @see ShellUtils#execCommand(String[], boolean, boolean) * @see ShellUtils#execCommand(String[], boolean, boolean)
*/ */
@@ -65,40 +65,40 @@ public class ShellUtils {
/** /**
* execute shell command * execute shell command
* *
* @param command command * @param command command
* @param isRoot whether need to run with root * @param isRoot whether need to run with root
* @param isNeedResultMsg whether need result msg * @param isNeedResultMsg whether need result msg
* @return * @return
* @see ShellUtils#execCommand(String[], boolean, boolean) * @see ShellUtils#execCommand(String[], boolean, boolean)
*/ */
public static CommandResult execCommand(String command, boolean isRoot, boolean isNeedResultMsg) { public static CommandResult execCommand(String command, boolean isRoot, boolean isNeedResultMsg) {
return execCommand(new String[] {command}, isRoot, isNeedResultMsg); return execCommand(new String[]{command}, isRoot, isNeedResultMsg);
} }
/** /**
* execute shell commands * execute shell commands
* *
* @param commands command activity_wifi * @param commands command activity_wifi
* @param isRoot whether need to run with root * @param isRoot whether need to run with root
* @param isNeedResultMsg whether need result msg * @param isNeedResultMsg whether need result msg
* @return * @return
* @see ShellUtils#execCommand(String[], boolean, boolean) * @see ShellUtils#execCommand(String[], boolean, boolean)
*/ */
public static CommandResult execCommand(List<String> commands, boolean isRoot, boolean isNeedResultMsg) { public static CommandResult execCommand(List<String> commands, boolean isRoot, boolean isNeedResultMsg) {
return execCommand(commands == null ? null : commands.toArray(new String[] {}), isRoot, isNeedResultMsg); return execCommand(commands == null ? null : commands.toArray(new String[]{}), isRoot, isNeedResultMsg);
} }
/** /**
* execute shell commands * execute shell commands
* *
* @param commands command array * @param commands command array
* @param isRoot whether need to run with root * @param isRoot whether need to run with root
* @param isNeedResultMsg whether need result msg * @param isNeedResultMsg whether need result msg
* @return <ul> * @return <ul>
* <li>if isNeedResultMsg is false, {@link CommandResult#successMsg} is null and * <li>if isNeedResultMsg is false, {@link CommandResult#successMsg} is null and
* {@link CommandResult#errorMsg} is null.</li> * {@link CommandResult#errorMsg} is null.</li>
* <li>if {@link CommandResult#result} is -1, there maybe some excepiton.</li> * <li>if {@link CommandResult#result} is -1, there maybe some excepiton.</li>
* </ul> * </ul>
*/ */
public static CommandResult execCommand(String[] commands, boolean isRoot, boolean isNeedResultMsg) { public static CommandResult execCommand(String[] commands, boolean isRoot, boolean isNeedResultMsg) {
int result = -1; int result = -1;
@@ -184,11 +184,17 @@ public class ShellUtils {
*/ */
public static class CommandResult { public static class CommandResult {
/** result of command **/ /**
public int result; * result of command
/** success message of command result **/ **/
public int result;
/**
* success message of command result
**/
public String successMsg; public String successMsg;
/** error message of command result **/ /**
* error message of command result
**/
public String errorMsg; public String errorMsg;
public CommandResult(int result) { public CommandResult(int result) {

View File

@@ -0,0 +1,29 @@
package com.lt2333.simplicitytools.util
import android.annotation.SuppressLint
import android.content.Context
object SystemProperties {
@SuppressLint("PrivateApi")
operator fun get(context: Context, key: String?): String? {
var ret = ""
try {
val cl = context.classLoader
val systemProperties = cl.loadClass("android.os.SystemProperties")
//参数类型
val paramTypes: Array<Class<*>?> = arrayOfNulls(1)
paramTypes[0] = String::class.java
val get = systemProperties.getMethod("get", *paramTypes)
//参数
val params = arrayOfNulls<Any>(1)
params[0] = key
ret = get.invoke(systemProperties, *params) as String
} catch (iAE: IllegalArgumentException) {
throw iAE
} catch (e: Exception) {
ret = ""
}
return ret
}
}

View File

@@ -12,6 +12,7 @@ object XSPUtils {
} }
return prefs.getBoolean(key, defValue) return prefs.getBoolean(key, defValue)
} }
fun getInt(key: String, defValue: Int): Int { fun getInt(key: String, defValue: Int): Int {
if (prefs.hasFileChanged()) { if (prefs.hasFileChanged()) {
prefs.reload() prefs.reload()
@@ -25,9 +26,21 @@ object XSPUtils {
} }
return prefs.getFloat(key, defValue) return prefs.getFloat(key, defValue)
} }
fun getString(key: String, defValue: String): String? {
if (prefs.hasFileChanged()) {
prefs.reload()
}
return prefs.getString(key, defValue)
}
} }
inline fun hasEnable(key: String, default: Boolean = false, noinline extraCondition: (() -> Boolean)? = null, crossinline block: () -> Unit) { inline fun hasEnable(
key: String,
default: Boolean = false,
noinline extraCondition: (() -> Boolean)? = null,
crossinline block: () -> Unit
) {
val conditionResult = if (extraCondition != null) extraCondition() else true val conditionResult = if (extraCondition != null) extraCondition() else true
if (XSPUtils.getBoolean(key, default) && conditionResult) { if (XSPUtils.getBoolean(key, default) && conditionResult) {
block() block()

View File

@@ -0,0 +1,37 @@
package com.lt2333.simplicitytools.util.xposed
import com.github.kyuubiran.ezxhelper.init.EzXHelperInit
import com.github.kyuubiran.ezxhelper.utils.Log.logexIfThrow
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.IXposedHookZygoteInit
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.callbacks.XC_LoadPackage
abstract class EasyXposedInit : IXposedHookLoadPackage, IXposedHookZygoteInit {
private lateinit var packageParam: XC_LoadPackage.LoadPackageParam
abstract val registeredApp: List<AppRegister>
private val TAG = "WooBox"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
packageParam = lpparam!!
registeredApp.forEach { app ->
if (app.packageName == lpparam.packageName) {
EzXHelperInit.apply {
setLogXp(true)
setLogTag(TAG)
setToastTag(TAG)
initHandleLoadPackage(lpparam)
}
runCatching { app.handleLoadPackage(lpparam) }.logexIfThrow("Failed call handleLoadPackage, package: ${app.packageName}")
}
}
}
override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
EzXHelperInit.initZygote(startupParam!!)
}
}

View File

@@ -0,0 +1,27 @@
package com.lt2333.simplicitytools.util.xposed.base
import com.github.kyuubiran.ezxhelper.utils.Log.logexIfThrow
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.callbacks.XC_LoadPackage
abstract class AppRegister: IXposedHookLoadPackage {
abstract val packageName: String
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {}
protected fun autoInitHooks(lpparam: XC_LoadPackage.LoadPackageParam, vararg hook: HookRegister) {
hook.also {
XposedBridge.log("WooBox: Try to Hook [$packageName]")
}.forEach {
runCatching {
if (it.isInit) return@forEach
it.setLoadPackageParam(lpparam)
it.init()
it.isInit = true
}.logexIfThrow("Failed to Hook [$packageName]")
}
}
}

View File

@@ -0,0 +1,25 @@
package com.lt2333.simplicitytools.util.xposed.base
import de.robv.android.xposed.callbacks.XC_LoadPackage
abstract class HookRegister {
private lateinit var lpparam: XC_LoadPackage.LoadPackageParam
var isInit: Boolean = false
abstract fun init()
fun setLoadPackageParam(loadPackageParam: XC_LoadPackage.LoadPackageParam) {
lpparam = loadPackageParam
}
protected fun getLoadPackageParam(): XC_LoadPackage.LoadPackageParam {
if (!this::lpparam.isInitialized) {
throw RuntimeException("lpparam should be initialized")
}
return lpparam
}
protected fun getDefaultClassLoader(): ClassLoader {
return getLoadPackageParam().classLoader
}
}

Some files were not shown because too many files have changed in this diff Show More