Skip to content

Commit

Permalink
fix permission problem by update xposed api to 93
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-TSNG committed Mar 27, 2021
1 parent dd09be9 commit 06326c8
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 8 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ In this case, detected apps that use root (such as Fake Location and Storage Iso
At the same time, some "smart" apps use various loopholes to acquire your applist, so that it can draw a persona for you.
This module provides some methods to test whether you have already hided your applist nicely.
Also, it can work as an Xposed module to hide some apps or reject applist requests to protect your privacy.
Attension: Xposed API version lower than 93 is NOT supported due to a permission problem

## 关于该模块
虽然“检测安装的应用是不正确的做法”,而且很蠢,但是并不是所有的插件类应用都提供了随机包名支持。在这种情况下,检测到安装了root类应用(如Fake Location、存储重定向)与检测到了root本身区别不大。(会使用检测手段的app可不会认为你是在“我就蹭蹭不进去”)
与此同时,部分“不安分”的app会使用各种漏洞绕过系统权限来获取你的应用列表,从而对你建立用户画像。(如陈叔叔将安装了V2Ray的用户分为一类)
该模块提供了一些检测方式用于测试您是否成功的隐藏了带有root印记的包名,如Magisk/Edxposed Manager。
同时可作为Xposed模块用于隐藏应用列表或特定应用,保护你的隐私。
同时可作为Xposed模块用于隐藏应用列表或特定应用,保护你的隐私。
注意:由于一个权限问题,XPosed API至少为93才能正常使用该模块

## TODO
+ Add native detection
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
android:value="Reject applist detection." />
<meta-data
android:name="xposedminversion"
android:value="53" />
android:value="93" />
</application>

</manifest>
2 changes: 1 addition & 1 deletion app/src/main/java/com/tsng/hidemyapplist/HookApplist.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class HookApplist implements IXposedHookLoadPackage {
public static final String LOG = "hma_log";
public static final String APPNAME = "com.tsng.hidemyapplist";
public static final String APPNAME = BuildConfig.APPLICATION_ID;

@Override
public void handleLoadPackage(final LoadPackageParam lpp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ class ScopeManageActivity : AppCompatActivity() {

override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
preferenceManager.sharedPreferencesName = "Scope"
preferenceManager.sharedPreferencesMode = MODE_WORLD_READABLE
setPreferencesFromResource(R.xml.scope_preferences, rootKey)
map = preferenceManager.sharedPreferences.all as MutableMap<String, String>
templates = setOf("<close>") +
requireActivity().getSharedPreferences("Templates", MODE_PRIVATE).getStringSet("List", setOf())!!
requireActivity().getSharedPreferences("Templates", MODE_WORLD_READABLE).getStringSet("List", setOf())!!
refresh()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public boolean onSupportNavigateUp() {
}

private void InitTemplateList() {
list_pref = getSharedPreferences("Templates", Context.MODE_PRIVATE);
list_pref = getSharedPreferences("Templates", Context.MODE_WORLD_READABLE);
templates = new HashSet<>(list_pref.getStringSet("List", new HashSet<>()));
ListView lv = findViewById(R.id.xposed_lv_template);
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, new ArrayList<>(templates));
Expand All @@ -76,7 +76,7 @@ private void InitTemplateList() {
.setPositiveButton(getString(R.string.accept), ((dialog, which) -> {
templates.remove(s);
adapter.remove(s);
new File(getFilesDir().getParent() + "/shared_prefs/tpl_" + s + ".xml").delete();
getSharedPreferences("tpl_" + s, MODE_WORLD_READABLE).edit().clear().apply();
list_pref.edit().putStringSet("List", new HashSet<>(templates)).apply();
})).show();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.O
class SettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
preferenceManager.sharedPreferencesName = "tpl_" + arguments?.getString("template")
preferenceManager.sharedPreferencesMode = MODE_WORLD_READABLE
setPreferencesFromResource(R.xml.template_preferences, rootKey)
}
}
Expand All @@ -63,6 +64,7 @@ class TemplateSettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.O

override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
preferenceManager.sharedPreferencesName = "tpl_" + arguments?.getString("template")
preferenceManager.sharedPreferencesMode = MODE_WORLD_READABLE
setPreferencesFromResource(R.xml.template_hideapps_preference, rootKey)
list = preferenceManager.sharedPreferences.getStringSet("HideApps", setOf())!!.toMutableSet()
refresh()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.tsng.hidemyapplist.BuildConfig
import com.tsng.hidemyapplist.R
import mehdi.sakout.aboutpage.AboutPage
import mehdi.sakout.aboutpage.Element
Expand All @@ -15,7 +16,7 @@ class AboutFragment : Fragment() {
return AboutPage(activity)
.setDescription(getString(R.string.about_my_description))
.addItem(Element().apply {
title = "Version " + requireContext().packageManager.getPackageInfo(requireContext().packageName, 0).versionName
title = "Version " + BuildConfig.VERSION_NAME
iconDrawable = R.drawable.ic_baseline_language_24
})
.addItem(Element().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public View onCreateView(@NonNull LayoutInflater inflater,

@Override
public void onClick(View v) {
switch (v.getId()) {
if(!getXposedStatus())
Toast.makeText(getContext(), getString(R.string.xposed_actvate_first), Toast.LENGTH_SHORT).show();
else switch (v.getId()) {
case R.id.hook_self:
isHookSelf = !isHookSelf;
PreferenceManager.getDefaultSharedPreferences(getContext()).edit().putBoolean("HookSelf", isHookSelf).apply();
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings_xposed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<string name="xposed_hook_self">Hook模块自身</string>
<string name="xposed_restart_self_to_apply">重启模块以应用更改</string>
<string name="xposed_restart_to_apply">重启目标APP以应用更改</string>
<string name="xposed_actvate_first">请先激活模块</string>
<string name="xposed_disable_hook_self_first">请先禁用Hook模块自身并重启模块</string>
<string name="xposed_template_manage">模板管理</string>
<string name="xposed_scope_manage">选择生效应用</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings_xposed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<string name="xposed_hook_self">Hook Self</string>
<string name="xposed_restart_self_to_apply">Restart the module to apply changes</string>
<string name="xposed_restart_to_apply">Restart target apps to apply changes</string>
<string name="xposed_actvate_first">Please activate module first</string>
<string name="xposed_disable_hook_self_first">Please disable hook self and restart the module</string>
<string name="xposed_template_manage">Manage Templates</string>
<string name="xposed_scope_manage">Select Effective Apps</string>
Expand Down

0 comments on commit 06326c8

Please sign in to comment.