Skip to content

Commit

Permalink
Performance optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-TSNG committed Apr 15, 2021
1 parent 1d65421 commit ba6a0de
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ Attension: Xposed API version lower than 93 is NOT supported due to a permission
## Compilation
This project uses Hidden API, so you should replace android.jar in Android Studio. [Reference](https://github.com/anggrayudi/android-hidden-api)
## Update Log
V1.3.1
+ Performance optimization

V1.3
+ Downgrade minSdkVersion
+ Add new detection methods and interception methods
+ Modifying templates takes effect in real time without restarting target apps (except for file detections)
+ UI redesign with more help information in about page
+ Due to the big changes to V1.1, if there are problems please uninstall and reinstall the module
+ Remove old hook mode and abandon trying to support virtual frameworks

V1.1
+ Add exclude self support
Expand All @@ -27,17 +29,20 @@ V1.1
同时可作为Xposed模块用于隐藏应用列表或特定应用,保护你的隐私。
注意:由于一个权限问题,Xposed API至少为93才能正常使用该模块
## 更新日志
V1.3.1
+ 性能优化

V1.3
+ 支持更低Android版本
+ 增加新的检测方式和拦截方式
+ 修改模板实时生效,无需重启目标应用(除File detections)
+ UI重修,关于页面添加更多使用帮助
+ 由于较V1.1改动大,遇到问题请卸载重装模块
+ 移除旧的工作模式,放弃支持虚拟框架

V1.1
+ 增加了排除自身功能

## TODO
+ Solve MODE_WORLDREADABLE problem
+ Downgrade Xposed API version
+ Fix webview problems
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.tsng.hidemyapplist"
minSdkVersion 24
targetSdkVersion 30
versionCode 9
versionName "1.3"
versionCode 10
versionName "1.3.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.tsng.hidemyapplist.xposed.hooks

import android.content.pm.ParceledListSlice
import android.os.Binder
import android.os.Process
import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.APPNAME
import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.getRecursiveField
import com.tsng.hidemyapplist.xposed.XposedUtils.Companion.getTemplatePref
Expand Down Expand Up @@ -39,7 +40,9 @@ class PackageManagerService : IXposedHookLoadPackage {
"getPackageUid" -> setResult(method, "ID detections", -1)
"getPackagesForUid" -> XposedBridge.hookMethod(method, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) {
val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", Binder.getCallingUid()) as String
val callerUid = Binder.getCallingUid()
if (callerUid <= Process.SYSTEM_UID) return
val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", callerUid) as String
val pref = getTemplatePref(callerName)
if (!isUseHook(pref, callerName, "ID detections")) return
ld("PKMS caller: $callerName")
Expand All @@ -61,7 +64,9 @@ class PackageManagerService : IXposedHookLoadPackage {
private fun removeList(method: Method, hookName: String, pkgNameObjList: List<String>) {
XposedBridge.hookMethod(method, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) {
val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", Binder.getCallingUid()) as String
val callerUid = Binder.getCallingUid()
if (callerUid <= Process.SYSTEM_UID) return
val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", callerUid) as String
val pref = getTemplatePref(callerName)
if (!isUseHook(pref, callerName, hookName)) return
ld("PKMS caller: $callerName")
Expand All @@ -77,7 +82,9 @@ class PackageManagerService : IXposedHookLoadPackage {
private fun setResult(method: Method, hookName: String, result: Any?) {
XposedBridge.hookMethod(method, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) {
val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", Binder.getCallingUid()) as String
val callerUid = Binder.getCallingUid()
if (callerUid <= Process.SYSTEM_UID) return
val callerName = XposedHelpers.callMethod(param.thisObject, "getNameForUid", callerUid) as String
if (callerName == APPNAME && param.args[0] == "checkHMAServiceStatus") {
param.result = 1
return
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
<string name="updates">新版本特性</string>
<string name="updates_log">
<b>请仔细阅读关于页面的使用帮助!</b>\n
<b>V1.3.1</b>\n
[+] 性能优化\n
<b>V1.3</b>\n
[+] 支持更低Android版本\n
[+] 增加新的检测方式和拦截方式\n
[+] 修改模板实时生效,无需重启目标应用(除File detections)\n
[+] UI重修,关于页面添加更多使用帮助\n
[+] 由于较V1.1改动大,遇到问题请卸载重装模块\n
[-] 移除旧的工作模式,放弃支持虚拟框架\n
[%] nativeFile拦截尚未完成\n
<b>目前已知的bug</b>\nEdXposed YAHFA后端无法进行file detection隐藏(测试版本:4683),请更换Sandhook后端或LSPosed。\n
</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</string>
<string name="about_how_to_use_title">如何使用该模块</string>
<string name="about_how_to_use_description_1">
#激活和更新#\n&#12288;&#12288;安装/更新模块后需要重启。另外,本模块不支持虚拟框架。(如果有人能够解决MODE_WORLD_READABLE问题欢迎联系我)
#激活和更新#\n&#12288;&#12288;安装/更新模块后需要重启。另外,本模块暂时不支持虚拟框架。
</string>
<string name="about_how_to_use_description_2">
#如何启用隐藏#\n&#12288;&#12288;首先在模板管理里创建一个模板,然后在选择生效应用里对目标应用启用模板。Xposed模块作用域需要勾选“Android 系统”,如需拦截文件检测还需要勾选目标APP。(不要勾多了,会卡!)
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
<string name="updates">New features</string>
<string name="updates_log">
<b>Please read the about page carefully!</b>\n
<b>V1.3.1</b>\n
[+] Performance optimization\n
<b>V1.3</b>\n
[+] Downgrade minSdkVersion\n
[+] Add new detection methods and interception methods\n
[+] Modifying templates takes effect in real time without restarting target apps (except for file detections)\n
[+] UI redesign with more help information in about page\n
[+] Due to the big changes to V1.1, if there are problems please uninstall and reinstall the module\n
[-] Remove old hook mode and abandon trying to support virtual frameworks\n
[@] nativeFile interception has not been completed, wait for next updates\n
<b>Known bugs</b>\nUnder Edxposed YAHFA file detection hide does not work. (test version: 4683), please switch to Sandhook or LSPosed instead.\n
</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</string>
<string name="about_how_to_use_title">How to use this module</string>
<string name="about_how_to_use_description_1">
#Activation and updates#\nNeed to reboot after installation and updates. In addition, virtual Xposed frameworks are not supported. (If anyone knows how to deal with MODE_WORLD_READABLE welcome to put a GitHub issue)
#Activation and updates#\nNeed to reboot after installation and updates. In addition, virtual Xposed frameworks are not supported currently.
</string>
<string name="about_how_to_use_description_2">
#How to enable hide#\nFirst create a template in Manage Templates, then apply the template in Select Effective Apps. You should check Android System in Xposed module scope/whitelist. For file detections interception, you should check target apps extra. (Do not check many: it makes you device slower)
Expand Down

0 comments on commit ba6a0de

Please sign in to comment.