Android Data Management with ADB and Content Providers¶
Unlock the full potential of Android's Content Provider system using ADB commands. This detailed guide is designed for developers and tech enthusiasts who want to gain deeper insights into managing system settings, querying databases, and manipulating data with precision. Whether you're adjusting system preferences, accessing contact information, or managing SMS and call logs, these commands provide the tools you need to interact with Android's underlying data systems efficiently. Elevate your Android management skills and streamline your data operations with these expert techniques.
Set ringtone from /sdcard/
Set ringtone to foo.ogg
over adb from PC
Query settings for system¶
View sim info by slot¶
Set vibrator for specifik settings/profile¶
adb shell content query --uri content://com.android.settings.personalvibration.PersonalVibrationProvider
List all names of secure settings¶
adb shell content query --uri content://settings/secure/ | awk -F "[=,]" '{print "adb shell content query --uri content://system/settings/"$4}'
Query all settings with gnu parallel¶
echo -e "secure\nsystem\nglobal"| parallel -k -j3 "adb shell content query --uri content://settings/{}"
Disable developer mode¶
adb shell content update --uri content://settings/global --where "name='development_settings_enabled'" --bind value:s:0
Add new setting with content¶
adb shell content insert --uri content://settings/secure --bind name:s:oem_unlock_allowed --bind value:s:1
Change "new_setting" secure setting to "newer_value"¶
adb shell content update --uri content://settings/secure --bind value:s:newer_value --where "name='new_setting'"
Status for developer mode¶
adb shell content query --uri content://settings/global --where "name='development_settings_enabled'"
Status for developer mode¶
Find contents in sdk map and create samples for this cheatsheet¶
adb shell "su -c content query --uri content://com.samsung.rcs.autoconfigurationprovider/root/* |tr ' ' '\n'"
Print device number¶
adb shell "su -c content query --uri content://com.samsung.rcs.autoconfigurationprovider/root/application/1/im/fthttpcsuser"
Delete a certain setting¶
Insert a setting and value to foo¶
adb shellcontent insert --uri content://settings/secure --bind name:s:user_setup_complete --bind value:s:1
Change setting to another setting¶
adb shell content update --uri content://settings/secure --bind value:s:newer_value --where "name='new_setting'
Read will be able to read all kind of file extensions like zip, mp3 etc¶
Print current type for a content, example:¶
Below will print all nbames and mmsproxy¶
adb shell su -c content query --uri content://telephony/carriers/sim_apn_list --projection name:mmsproxy
Print heapdump¶
Print calls¶
Print shadow calls¶
Print call filters¶
Print call log¶
Print downloads¶
Print all downloads¶
Print current downloads¶
Print my all live¶
Print sms changes¶
Print sms¶
Print sms inbox¶
Print sms sent¶
Print sms draft messages¶
Print sms outbox¶
Print sms convertations¶
Print carrier information¶
Print mms ids¶
Print mms¶
Print mms inbox¶
Print sent mms¶
Print mms drafts¶
Print mms outbox¶
Print mms via sms¶
Print mms via sms convertation¶
Print mms via sms byphone¶
Print undelivered mms via sms¶
Print drafted mms via sms¶
Print locked mms via sms¶
Priint serach results for mms via sms¶
Print device carriers¶
Print device carriers apn list for simcard¶
adb shell su -c content query --uri content://telephony/carriers/sim_apn_list --projection name:mmsproxy
Print device carriers dpc¶
Print device carriers filtered¶
Print device carriers enforce manage¶
Print device preferapnset subids¶
Print device preferapnset subid¶
Print cellbroadcastas¶
Print cellbroadcasts history¶
Print cellbroadcasts öegacy¶
Print cellbroadcasts service state¶
Print cellbroadcasts carrier-id¶
Print cellbroadcasts all info about carrier-id¶
Print cellbroadcasts simcard info¶
Print all contact settings available¶
Contact list¶
Print contacts by filter¶
Print deleted contacts¶
Print contacts that has an email of im id added¶
Print contact group¶
Print deleted contact groups¶
Print all phone numbers¶
Print all phone number filters¶
Print all group memberships¶
Print all contacts groupmemberships in raw format¶
Print contact methods¶
Print contacts email address¶
Print contacxts presence¶
Print contacts organizations¶
Print contacts photo path¶
Print fcontacts extensions¶
Get google contacts with full info¶
adb shell content query --uri content://com.android.contacts/data --projection display_name:data1:data4:contact_id
Get google contacts and print notes for every contact¶
adb shell content query --uri content://contacts/phones/ --projection display_name:number:notes
adb shell content query --uri content://contacts/people/
Count people in contact list¶
List the phone numbers¶
List the groups¶
List group membership¶
List organizations¶
Trick device that setup already has been done (FRP Bypassing)¶
adb shellcontent insert --uri content://settings/secure --bind name:s:user_setup_complete --bind value:s:1
adb shell am start -n com.google.android.gsf.login/
adb shell am start -n com.google.android.gsf.login.LoginActivity
Dump global settings¶
Dump secure settings¶
Print target dir to all applications settings dir that can be edited manually¶
Query secure settings Select "name" and value columns from secure settings where name is equal to new_setting and sort the result by name in ascending order¶
Remove "new_setting" secure setting¶
Download current ringtone and play on PC via ffplay:¶
Auto rotation on¶
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:1
Auto rotation off¶
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
Rotate to landscape¶
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1