[Q] modify "developer options" through adb to deactivate "slide to unlock"
Hello,
I am trying to modify "developer options" through adb, in order to remove "slide to unlock", so the phone wakes directly into "main desktop".
What database should I aim for? what should I modify/add to the database in order to achieve this?
--
I am trying to do this because my phone digitizer is broken. I am using AndroidScreencast to control it BUT I cannot get past the "slide to unlock"; AndroidScreencast does not seem to allow "swipe".
So I want to deactivate "slide to unlock".
--
Another solution would be being able to emulate a swipe through adb, and unlock this way. I've seen some people using "adb shell input swipe" but I do NOT have that possibility :silly:
I am trying this on a Wildfire S with MIUIv4 by Henry_01
--
THANK YOU very much for your help.
EXTRA, a list of all databases I can find in the system:
/system/etc/yellowpage.db
/system/etc/weather_city.db
/system/etc/telocation.db
/data/data/com.android.providers.userdictionary/databases/user_dict.db-journal
/data/data/com.android.providers.userdictionary/databases/user_dict.db
/data/data/com.android.deskclock/databases/alarms.db-journal
/data/data/com.android.deskclock/databases/alarms.db
/data/data/com.lbe.security.miui/databases/lbe_security.db-journal
/data/data/com.lbe.security.miui/databases/lbe_security.db
/data/data/com.google.android.gsf/databases/subscribedfeeds.db-journal
/data/data/com.google.android.gsf/databases/gservices.db-journal
/data/data/com.google.android.gsf/databases/talk.db-journal
/data/data/com.google.android.gsf/databases/talk.db
/data/data/com.google.android.gsf/databases/gservices.db
/data/data/com.google.android.gsf/databases/subscribedfeeds.db
/data/data/com.google.android.gsf/databases/googlesettings.db-journal
/data/data/com.google.android.gsf/databases/googlesettings.db
/data/data/com.android.inputmethod.latin/databases/userbigram_dict.db-journal
/data/data/com.android.inputmethod.latin/databases/userbigram_dict.db
/data/data/com.android.vending/databases/suggestions.db
/data/data/com.android.vending/databases/library.db-journal
/data/data/com.android.vending/databases/localappstate.db-journal
/data/data/com.android.vending/databases/suggestions.db-journal
/data/data/com.android.vending/databases/localappstate.db
/data/data/com.android.vending/databases/library.db
/data/data/com.android.providers.media/databases/external.db-shm
/data/data/com.android.providers.media/databases/external.db-wal
/data/data/com.android.providers.media/databases/internal.db-shm
/data/data/com.android.providers.media/databases/internal.db-wal
/data/data/com.android.providers.media/databases/internal.db
/data/data/com.android.providers.media/databases/external.db
/data/data/com.google.android.partnersetup/databases/rlz_data.db-journal
/data/data/com.google.android.partnersetup/databases/rlz_data.db
/data/data/com.android.mms/files/festival_sms.db
/data/data/com.android.browser/app_databases/Databases.db
/data/data/com.android.browser/app_databases/https_mail.google.com_0/0000000000000001.db
/data/data/com.android.browser/app_geolocation/CachedGeoposition.db
/data/data/com.android.browser/app_geolocation/GeolocationPermissions.db
/data/data/com.android.browser/app_icons/WebpageIcons.db
/data/data/com.android.browser/app_appcache/ApplicationCache.db
/data/data/com.android.browser/databases/webviewCookiesChromiumPrivate.db
/data/data/com.android.browser/databases/webview.db-shm
/data/data/com.android.browser/databases/webview.db
/data/data/com.android.browser/databases/browser2.db-journal
/data/data/com.android.browser/databases/browser2.db
/data/data/com.android.browser/databases/autofill.db-journal
/data/data/com.android.browser/databases/autofill.db
/data/data/com.android.browser/databases/webview.db-wal
/data/data/com.android.browser/databases/webviewCookiesChromium.db
/data/data/com.miui.providers.telocation/databases/customtelocation.db
/data/data/com.miui.providers.telocation/databases/customtelocation.db-journal
/data/data/com.android.providers.downloads/databases/downloads.db-journal
/data/data/com.android.providers.downloads/databases/downloads.db
/data/data/com.android.fileexplorer/databases/kuaipan.db-journal
/data/data/com.android.fileexplorer/databases/kuaipan.db
/data/data/com.miui.home/databases/launcher.db-journal
/data/data/com.miui.home/databases/launcher.db
/data/data/com.airbnb.android/databases/webview.db-shm
/data/data/com.airbnb.android/databases/suggestions.db-journal
/data/data/com.airbnb.android/databases/suggestions.db
/data/data/com.airbnb.android/databases/webview.db-wal
/data/data/com.airbnb.android/databases/webview.db
/data/data/com.airbnb.android/databases/google_analytics_v2.db
/data/data/com.airbnb.android/databases/google_analytics_v2.db-journal
/data/data/com.airbnb.android/databases/webviewCookiesChromium.db
/data/data/com.airbnb.android/databases/webviewCookiesChromiumPrivate.db
/data/data/com.android.providers.settings/databases/settings.db-shm
/data/data/com.android.providers.settings/databases/settings.db-wal
/data/data/com.android.providers.settings/databases/settings.db
/data/data/com.android.providers.telephony/databases/mmssms.db-journal
/data/data/com.android.providers.telephony/databases/firewall.db-journal
/data/data/com.android.providers.telephony/databases/telephony.db
/data/data/com.android.providers.telephony/databases/telephony.db-journal
/data/data/com.android.providers.telephony/databases/mmssms.db
/data/data/com.android.providers.telephony/databases/firewall.db
/data/data/com.whatsapp/databases/wa.db-shm
/data/data/com.whatsapp/databases/wa.db-wal
/data/data/com.whatsapp/databases/msgstore.db-journal
/data/data/com.whatsapp/databases/msgstore.db
/data/data/com.whatsapp/databases/wa.db
/data/data/com.google.android.googlequicksearchbox/databases/qsb-log.db-journal
/data/data/com.google.android.googlequicksearchbox/databases/qsb-log.db
/data/data/com.google.android.googlequicksearchbox/databases/qsb-history.db-journal
/data/data/com.google.android.googlequicksearchbox/databases/qsb-history.db
/data/data/com.miui.notes/databases/note.db-journal
/data/data/com.miui.notes/databases/note.db
/data/data/com.android.keychain/databases/grants.db
/data/data/com.android.keychain/databases/grants.db-journal
/data/data/com.android.settings/databases/webviewCookiesChromium.db
/data/data/com.android.settings/databases/webviewCookiesChromiumPrivate.db
/data/data/com.android.settings/databases/miui_settings.db-journal
/data/data/com.android.settings/databases/webview.db-wal
/data/data/com.android.settings/databases/webview.db
/data/data/com.android.settings/databases/webview.db-shm
/data/data/com.android.settings/databases/miui_settings.db
/data/data/com.android.providers.calendar/databases/calendar.db-journal
/data/data/com.android.providers.calendar/databases/calendar.db
/data/data/com.android.providers.contacts/databases/contacts2.db-journal
/data/data/com.android.providers.contacts/databases/profile.db-journal
/data/data/com.android.providers.contacts/databases/profile.db
/data/data/com.android.providers.contacts/databases/contacts2.db
/data/data/com.ijinshan.mguard.provider/files/firewall_sys_rules.db
/data/data/com.ijinshan.mguard.provider/files/antivirus.db
/data/data/com.android.email/databases/EmailProviderBody.db-journal
/data/data/com.android.email/databases/EmailProvider.db-journal
/data/data/com.android.email/databases/EmailProviderBackup.db-journal
/data/data/com.android.email/databases/EmailProviderBody.db
/data/data/com.android.email/databases/EmailProviderBackup.db
/data/data/com.android.email/databases/EmailProvider.db
/data/data/com.google.android.gsf.login/databases/webviewCookiesChromiumPrivate.db
/data/data/com.google.android.gsf.login/databases/webview.db-wal
/data/data/com.google.android.gsf.login/databases/webview.db
/data/data/com.google.android.gsf.login/databases/webview.db-shm
/data/data/com.google.android.gsf.login/databases/webviewCookiesChromium.db
/data/data/com.google.android.gms/databases/app_state.db-journal
/data/data/com.google.android.gms/databases/app_state.db
/data/data/com.google.android.gms/databases/rmq.db-journal
/data/data/com.google.android.gms/databases/games_51caa370.db
/data/data/com.google.android.gms/databases/plus.db-journal
/data/data/com.google.android.gms/databases/gcore_ulr_ActivityDetection.db-journal
/data/data/com.google.android.gms/databases/gcore_ulr_UlrLocation.db-journal
/data/data/com.google.android.gms/databases/pluscontacts.db-journal
/data/data/com.google.android.gms/databases/peoplelog.db
/data/data/com.google.android.gms/databases/pluscontacts.db
/data/data/com.google.android.gms/databases/plus.db
/data/data/com.google.android.gms/databases/rmq.db
/data/data/com.google.android.gms/databases/gcore_ulr_UlrLocation.db
/data/data/com.google.android.gms/databases/gcore_ulr_ActivityDetection.db
/data/data/com.google.android.gms/databases/games_51caa370.db-journal
/data/system/accounts.db-journal
/data/system/accounts.db
Click to expand...
Click to collapse
What does this actually do to tell the bootloader that it is ok to unlock.
Write a 1 byte file to the system partition?
Write one byte of the bootloader?
Searching google just gave "How to Enable OEM Unlock to unlock your bootloader" articles nothing on how it actually works.
Finally found out how it works.
While trying to find my screen resolution while offline I checked getprop with terminal and sys.oem_unlock_allowed [1] came up.
I then checked /dev/__properties__ and it was there so it is enable by writing sys.oem_unlock_allowed = 1 to /dev/__properties__
Guicrith said:
Finally found out how it works.
While trying to find my screen resolution while offline I checked getprop with terminal and sys.oem_unlock_allowed [1] came up.
I then checked /dev/__properties__ and it was there so it is enable by writing sys.oem_unlock_allowed = 1 to /dev/__properties__
Click to expand...
Click to collapse
Is there any way to prevent a user from accidentally disabling this option in Developer options?
I am asking because if you disable "OEM unlock" after installing a custom ROM in eg. a Samsung phone, the device refuses to boot with a FRP "Custom binary blocked by FRP lock" message.
timba123 said:
I'm on samsung a102u . The galaxy a10e. I added sys.oem_unlock_allowed 1 but now both sys.oem_unlock_allowed 0 and sys.oem_unlock_allowed 1 both are showing up. Is there a command to remove the sys.oem_unlock_allowed 0
Click to expand...
Click to collapse
Well actually the first one is indeed sys.oem_unlock_allowed but the second one is sys.oem_unlocl_allowed so those are not the same: probably you made a typo when adding it and thus it didn't just change the original prop's value but added a new, mistyped prop with the desired value? The K and L buttons on a QWERTY or similar keyboard are next to each other (and the Levenshtein distance between the names of the two props is only 1).
This is an excellent resource for information on bootloader unlock ability.
There are several components at play here:
ro.oem_unlock_supported is set at ROM build time; if 1, the OEM Unlocking toggle should be available. This property is not visible without root.
sys.oem_unlock_allowed is used by some "permissive" devices such as the Google Pixel to determine whether OEM unlocking should be allowed; in the case of the Pixel, this is done by checking an online whitelist of serial numbers
get_unlock_ability is controlled by the OEM Unlocking toggle. Off is 0, on is 1. If 0, the bootloader will reject fastboot flashing unlock. Can be checked in bootloader mode using ADB: fastboot flashing get_unlock_ability
How do i enable Secure Settings on Poco F1 MIUI 9.6.14.0? it always says "error occurred while executing Action: Password/Pin" i've already enabled Device Admin on my phone. USB debugging = ON, USB debugging (Security settings) = ON
Device Admin Apps: Tasker and Secure Settings checked
Notification access: Tasker checked
To fit the status bar with notch, it is necessary to change the density of the device screen
See the attached image.
Steps.
Enable "USB debugging" in "Develop options".
Enable "USB security setting" (bellow "USB debugging") (tap on yes to all).
Setup ADB on your computer with this tool
Open the ADB installation folder
Right click + shift and click on open command window here (on windows 10, type "CMD" in the upper bar and enter)
Type this and accept all permissions on the device screen:
ADB Devices
adb shell wm density 470
adb reboot
Click to expand...
Click to collapse
Done!
It is likely that the screen aspect looks a bit different, you can fix that by adjusting the size of the font in screen options.
Thanks
or change it in developer settings ...
there is no difference
Wow u change resolution from ADB! Mama's hacker!
andrecuellar said:
To fit the status bar with notch, it is necessary to change the density of the device screen
See the attached image.
Steps.
Enable "USB debugging" in "Develop options".
Enable "USB security setting" (bellow "USB debugging") (tap on yes to all).
Setup ADB on your computer with this tool
Open the ADB installation folder
Right click + shift and click on open command window here (on windows 10, type "CMD" in the upper bar and enter)
Type this and accept all permissions on the device screen:
Done!
It is likely that the screen aspect looks a bit different, you can fix that by adjusting the size of the font in screen options.
Thanks
Click to expand...
Click to collapse
This is not solution, already have it on forum, changing resolution it's not what all we want! Stop repost this sh!t.
Thank you. I didn't know these. Is there a way to only fit the status bar , because when I change this, all the icons and text shrink. I have a theme with the icons very big, and I would like to keep it that way.
Nope
Okey so. Doesn't work.
How can I go back?
This is a thread for those who don't want to root their device to force 120Hz on every app.If you are looking for a root solution, then use the LSPosed module called MIUI Performance Saver - Download here
In this way, you can force 120Hz in applications such as: YouTube, MX Player, Google Maps and many others that run at 60Hz by default in MIUI.
You will notice the changes, but you can check it by turning on the refresh rate counter in developer options and check the changes before and after.
First method via ADB
1. In your device, in developer options, enable usb debugging and usb debugging (security settings) and connect your phone to the PC.
2. Download platform tools and extract to a folder
3. Open console in the platform tools folder
4. Enter the following command:
For MIUI 13:
Code:
adb shell settings put system user_refresh_rate 1
For MIUI 14:
Code:
adb shell settings put secure user_refresh_rate 1
If first method doesn't work for you, then try second method.
Second method via Settings Database Editor app
Download this app from the Play Store and for it to work properly, download and install this file from github (settings-database-provider.apk).
For MIUI 13:
1. Open Settings Database Editor app
2. Search "user_refresh_rate"
3. Cick on it to edit the value and replace 120 with 1 and save changes
4. Done
For MIUI 14:
MIUI 14 requires you to grant permissions to the Settings Database Provider app via ADB
1. In your device, in developer options, enable usb debugging and usb debugging (security settings) and connect your phone to the PC.
2. Download platform tools and extract to a folder
3. Open console in platform tools folder
4. Enter the following command:
Code:
adb shell pm grant com.netvor.settings.database.provider android.permission.WRITE_SECURE_SETTINGS
5. Open Settings Database Editor app
6. Search "user_refresh_rate"
7. Cick on it to edit the value and replace 120 with 1 and save changes
8. Done
Keep in mind that it may not work because Xiaomi changes something under the hood of the updates.
I dont know what to say, force fps can cause useless battery drain on app that dont really need ... Do you really need 120hz when you send sms or making call or even messenger ... All do what they want but i wont use it
snx413 said:
I dont know what to say, force fps can cause useless battery drain on app that dont really need ... Do you really need 120hz when you send sms or making call or even messenger ... All do what they want but i wont use it
Click to expand...
Click to collapse
I've been using this method since I had the Poco F3 and I've never noticed that the battery was draining much because of it. I'm used to 120Hz and find it irritating to suddenly switch to 60Hz when scrolling in YouTube or some other app. I am not forcing anyone to force 120Hz on their devices.
Yeah but its most of the time at 120 btw, only you tube and tik tok seems to lower it at 60,
I miss my poco f3... They have all custom rom they want pfff, i sold to my brother ...
root and non root method doesnt work for my poco f3 with xiaomi.eu, i tried global too
HappyTrix said:
root and non root method doesnt work for my poco f3 with xiaomi.eu, i tried global too
Click to expand...
Click to collapse
Can you provide more information? Any errors when executing commands in ADB? Can't find user_refresh_rate in setedit app? It's impossible that it wouldn't work on Poco F3, because I had this device until recently (now I don't have it anymore) and both methods worked perfectly in global ROMs and xiaomi.eu.
is there any way to force it from 120hz to 60hz instantly when i stop swiping? it only works when brightness is above 50%, if below 50% it's always 120hz
nhquocnam said:
is there any way to force it from 120hz to 60hz instantly when i stop swiping? it only works when brightness is above 50%, if below 50% it's always 120hz
Click to expand...
Click to collapse
This is MIUI, nothing can be done about it. You can try Magisk root + LSPosed "MIUI Performance Saver" module and force 120hz, which "maybe" will solve your problem, or you can wait for some custom rom that will hopefully come out for the Xiaomi 12T Pro someday, as long as Xiaomi releases kernel source code for this device.
I cant seem to get my ADB to work u have any guides? and there is no "console" in the platform tools folder please help me
uvzen said:
This is a thread for those who don't want to root their device to force 120Hz on every app.If you are looking for a root solution, then use the LSPosed module called MIUI Performance Saver - Download here
In this way, you can force 120Hz in applications such as: YouTube, MX Player, Google Maps and many others that run at 60Hz by default in MIUI.
You will notice the changes, but you can check it by turning on the refresh rate counter in developer options and check the changes before and after.
First method via ADB
1. In your device, in developer options, enable usb debugging and usb debugging (security settings) and connect your phone to the PC.
2. Download platform tools and extract to a folder
3. Open console in the platform tools folder
4. Enter the following command:
For MIUI 13:
Code:
adb shell settings put system user_refresh_rate 1
For MIUI 14:
Code:
adb shell settings put secure user_refresh_rate 1
Second method via SetEdit app
Download this app from Play Store
For MIUI 13:
1. Open Setedit app and scroll down to the end
2. Find "user_refresh_rate" "120"
3. Cick on it to edit the value and replace 120 with 1 and save changes
4. Done
For MIUI 14:
MIUI 14 requires you to grant permissions to the Setedit app via ADB
1. In your device, in developer options, enable usb debugging and usb debugging (security settings) and connect your phone to the PC.
2. Download platform tools and extract to a folder
3. Open console in the platform tools folder
4. Enter the following command:
Code:
adb shell pm grant by4a.setedit22 android.permission.WRITE_SECURE_SETTINGS
5. Open Setedit app
6. In the right corner, change the "System Table" tab to "Secure Table"
7. Scroll down to the end and find "user_refresh_rate" "120"
8. Cick on it to edit the value and replace 120 with 1 and save changes
9. Done
Click to expand...
Click to collapse
Thank you, useful af
I'm getting an error while running the adb command :
Exception occurred while executing 'put':
java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2331)
at com.android.providers.settings.SettingsProvider.mutateSecureSetting(SettingsProvider.java:1768)
at com.android.providers.settings.SettingsProvider.insertSecureSetting(SettingsProvider.java:1719)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:467)
at android.content.ContentProvider.call(ContentProvider.java:2533)
at android.content.ContentProvider$Transport.call(ContentProvider.java:530)
at com.android.providers.settings.SettingsService$MyShellCommand.putForUser(SettingsService.java:382)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:278)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:50)
at android.os.Binder.shellCommand(Binder.java:1054)
at android.os.Binder.onTransact(Binder.java:882)
at android.os.Binder.execTransactInternal(Binder.java:1290)
at android.os.Binder.execTransact(Binder.java:1249)
SooRaj SuResh said:
I'm getting an error while running the adb command :
Exception occurred while executing 'put':
java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2331)
at com.android.providers.settings.SettingsProvider.mutateSecureSetting(SettingsProvider.java:1768)
at com.android.providers.settings.SettingsProvider.insertSecureSetting(SettingsProvider.java:1719)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:467)
at android.content.ContentProvider.call(ContentProvider.java:2533)
at android.content.ContentProvider$Transport.call(ContentProvider.java:530)
at com.android.providers.settings.SettingsService$MyShellCommand.putForUser(SettingsService.java:382)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:278)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:50)
at android.os.Binder.shellCommand(Binder.java:1054)
at android.os.Binder.onTransact(Binder.java:882)
at android.os.Binder.execTransactInternal(Binder.java:1290)
at android.os.Binder.execTransact(Binder.java:1249)
Click to expand...
Click to collapse
Changing refresh rate via ADB doesn't work for me either. Xiaomi changed something in the permissions again during one of the updates. I just updated my thread, so try second method through the Settings Database Editor app, because I checked and it works for me on Xiaomi.eu weekly 23.5.22.
Very good find! I had it working on MIUI 13 but I had been waiting to get it working on MIUI 14 since forever, didn't know we had to modify the secure table for this. Also, do you know any more efficient ways to do this with root? I am always rooted.
SooRaj SuResh said:
I'm getting an error while running the adb command :
Spoiler: Code
Exception occurred while executing 'put':
java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2331)
at com.android.providers.settings.SettingsProvider.mutateSecureSetting(SettingsProvider.java:1768)
at com.android.providers.settings.SettingsProvider.insertSecureSetting(SettingsProvider.java:1719)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:467)
at android.content.ContentProvider.call(ContentProvider.java:2533)
at android.content.ContentProvider$Transport.call(ContentProvider.java:530)
at com.android.providers.settings.SettingsService$MyShellCommand.putForUser(SettingsService.java:382)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:278)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:50)
at android.os.Binder.shellCommand(Binder.java:1054)
at android.os.Binder.onTransact(Binder.java:882)
at android.os.Binder.execTransactInternal(Binder.java:1290)
at android.os.Binder.execTransact(Binder.java:1249)
Click to expand...
Click to collapse
Try with granting permission to the app. Even with that you will get an error which you can solve as follows:
How can I use adb to grant permission without root?
Background I'm trying to create an app that can grant and revoke permissions of other apps. To do this I'm using adb commands: pm grant packageName permissionName This works great if I call it
stackoverflow.com
Unknown.Guy said:
Also, do you know any more efficient ways to do this with root? I am always rooted.
Click to expand...
Click to collapse
If you have root then use LSPosed module MIUI Performance Saver.