XposedBridge icon indicating copy to clipboard operation
XposedBridge copied to clipboard

Cant read preferences Samsung S7 Edge

Open aldyjrz opened this issue 7 years ago • 9 comments

I have apps that put preferences like

  SharedPreferences.Editor bar = preferences.edit();
   bar.putInt("distance_end", 1);
   bar.putInt("distance_start", 25);

i was tried :

XSharedPreferences  prefs = new XSharedPreferences(PACKAGENAME, PREF_NAME);
prefs.makeWorldReadable();
prefs.reload();

or

             `    new File("/data/data/packagename/shared_prefs/pref.xml").setReadable(true, false);`

or

  File pkg = new File("/data/data/packagename/shared_prefs/pref.xml");
                       prefs = new XSharedPreferences(pkg);

but, still read default value from preference when I try to read

  int start = prefs.getInt("distance_start", 0);
  int end = prefs.getInt("distance_end", 25);

it's return start = 0 end = 25

on another nougat devices my apps works.

any ideas?

sorry for bad english

aldyjrz avatar Feb 15 '18 18:02 aldyjrz

Hello, anyone?

aldyjrz avatar Feb 16 '18 23:02 aldyjrz

Verify manually that the file is world-readable. Also the folder of your app must at least have "x" for others/world. It's also likely that the data partition is encrypted, then it's not readable when Zygote starts. Then you have to use the user_de folder, which is for device encrypted files. You'll need to create a different Context object for that.

rovo89 avatar Feb 17 '18 06:02 rovo89

hello @rovo89 can you show me an example? im newbie about this

aldyjrz avatar Feb 28 '18 19:02 aldyjrz

@aldyjrz I also had this pro. I'm crazy. do you solved?

magicbaby810 avatar May 17 '18 09:05 magicbaby810

@magicbaby819 solved with just give access your app to superuser and make chmod 777 data/data/urapp/shared_prefs

aldyjrz avatar May 19 '18 07:05 aldyjrz

solved ? chmod 777 not solve this problem.

imsourcandy avatar Nov 03 '18 18:11 imsourcandy

Any good idea?

chengxuncc avatar Apr 24 '19 15:04 chengxuncc

anyone knows?

musenlllm avatar Jul 27 '19 19:07 musenlllm

try to use contentprovider

magicbaby810 avatar Jul 29 '19 02:07 magicbaby810