MuntashirAkon / SetEdit

Open source version of the original Settings Database Editor
GNU General Public License v3.0
301 stars 38 forks source link

In my application is not possible to put value into Settings.System #16

Closed henrichg closed 1 year ago

henrichg commented 1 year ago

Please help me.

  1. WRITE_SETTINGS granted
  2. WRITE_SECURE_SETTINGS granted

but is not possible to put value into, for example, System.VIB_RECVCALL_MAGNITUDE. It is Samsung Galaxy S10 specific parameter.

In your apllication (from Google Play) is possible to edit this value and new value is reflected in S10 Settings.

But in my application is generated expetion: java.lang.IllegalArgumentException: You cannot keep your settings in the secure settings.

even when used is put the value, using ContentResolver from your source code.

Thank you very much for help me.

Taxit0m commented 1 year ago

Its not my code, it's giving you what's wrong in the output. It says invalid argument you cannot keep your settings in secure settings. So this means it doesn't want you to add rules into the secure settings table. Try adding a rule to the system or global settings tables and if its a bit of java I think there is even a settigs table for java, I'd like to see an option for editing the build.prop but I'm not sure that it weighs a whole lot with the newer versions of android.

Sent from Proton Mail mobile

-------- Original Message -------- On Nov 3, 2022, 8:36 AM, Henrich Gron wrote:

Please help me.

  • WRITE_SETTINGS granted
  • WRITE_SECURE_SETTINGS granted

but is not possible to put value into, for example, System.VIB_RECVCALL_MAGNITUDE. It is Samsung Galaxy S10 specific parameter.

In your apllication (from Google Play) is possible to edit this value and new value is reflected in S10 Settings.

But in my application is generated expetion: java.lang.IllegalArgumentException: You cannot keep your settings in the secure settings.

even when used is put the value, using ContentResolver from your source code.

Thank you very much for help me.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

henrichg commented 1 year ago

Parameter is in Settings.System not Secure. Settings.System.putInt(appContext.getContentResolver(), "VIB_RECVCALL_MAGNITUDE", value);, exception,

from SetEdit code, exception:

ContentResolver contentResolver = context.getContentResolver();
try {
    ContentValues contentValues = new ContentValues(2);
    contentValues.put("name", "VIB_RECVCALL_MAGNITUDE");
    contentValues.put("value", value);
    contentResolver.insert(Uri.parse("content://settings/" + "system"), contentValues);
} catch (Exception e) {
    Log.e("ActivateProfileHelper.setVibrationIntensity", Log.getStackTraceString(e));
}
henrichg commented 1 year ago

Hm, hm, maybe problem is targetSDK. For SetEdit it is 22, for my application it is 28.

EDIT: Yes problem is targetSDK: https://stackoverflow.com/questions/32971846/settings-system-api-behaviour-in-android-api-level-23

Taxit0m commented 1 year ago

There are other forks, I usually try the most currently updated one on GitHub and there is an official release on f-droid that is really good

Sent from Proton Mail mobile

-------- Original Message -------- On Nov 3, 2022, 11:31 AM, Henrich Gron wrote:

Hm, hm, maybe problem is targetSDK. For SetEdit it is 22, for my application it is 28.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

MuntashirAkon commented 1 year ago

Hm, hm, maybe problem is targetSDK. For SetEdit it is 22, for my application it is 28.

Yes. Target SDK must be less than 23 because these permissions have the pre23 flag.

henrichg commented 1 year ago

Thank you very much.