chiehmin / MinMinGuard

The best advertisement blocker on Android!
http://fatminmin.com/pages/minminguard.html
GNU General Public License v3.0
521 stars 111 forks source link

version 2.0.1 don't work #166

Closed gontazaka closed 6 years ago

gontazaka commented 6 years ago

I installed and tested version 2.0.1. It don't work correctly. I think about the cause of the problem(and workaround) as follows.

The callback function called by xposed is inaccessible because of insufficient permissions on "Modsettings.xml". The difference from the previous version is: /data/data/tw.fatminmin.xposed.minminguard/shared_prefs/ModSettings.xml

Therefore, version 2.0.1 can also be used to function by manually changing the "Modsettings.xml" permissions.

I paid attention to the following changes. But I didn't know how to solve the problem.

relevant information:

chiehmin commented 6 years ago

You are correct. Because I was testing in the VirtualXposed which hooked apps are running in the same permission context with MinMinGuard, I did not encounter this issue.

The reason I changed MODE_WORLD_READABLE to MODE_PRIVATE is the new sdk requires it.

I thought XSharedPreferences.makeWorldReadable should solve this issue but it didn't.

I will try to find another solution or do you have any suggestion?

gontazaka commented 6 years ago

Thank you for your reply. :smile: I have two ideas. a. Granting permissions from the MinminGuard process b. Use ContentProvider

a. Granting permissions from the MinminGuard process

This is the same way as XSharedPreferences.makeWorldReadable().

for example

modPref.edit()
    .putBoolean(info.packageName, false)
    .putBoolean(Common.getWhiteListKey(info.packageName), true)
    .apply();
File modPrefFile = new File(Environment.getDataDirectory(), "data/" + getPackageName() + "/shared_prefs/" + Common.MOD_PREFS + ".xml");
modPrefFile.setReadable(true, false);

se this post: https://github.com/bigsinger/AndroidIdChanger/issues/26

b. Use ContentProvider

There is a library created for use in xposed. https://github.com/apsun/RemotePreferences

se this post: https://github.com/rovo89/XposedBridge/issues/74

gontazaka commented 6 years ago

Thanks for the update. v2.0.2 works fine. Excellent!

gontazaka commented 6 years ago

fixed 4481aee00269c4e46b4baf73e01430b690bb2dc4

Android1500 commented 3 years ago

Thank you for your reply. :smile:

I have two ideas.

a. Granting permissions from the MinminGuard process

b. Use ContentProvider

a. Granting permissions from the MinminGuard process

This is the same way as XSharedPreferences.makeWorldReadable().

for example


modPref.edit()

    .putBoolean(info.packageName, false)

    .putBoolean(Common.getWhiteListKey(info.packageName), true)

    .apply();

File modPrefFile = new File(Environment.getDataDirectory(), "data/" + getPackageName() + "/shared_prefs/" + Common.MOD_PREFS + ".xml");

modPrefFile.setReadable(true, false);

se this post: https://github.com/bigsinger/AndroidIdChanger/issues/26

b. Use ContentProvider

There is a library created for use in xposed.

https://github.com/apsun/RemotePreferences

se this post: https://github.com/rovo89/XposedBridge/issues/74

I need some help I appreciate if you could help