Android系统中数据库应用

1.设置策略中的数据库

frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java


2.sqlite3操作

/data/data/com.android.providers.settings/databases/settings.db

sqlite3 settings.db                                                            

SQLite version 3.8.6 2014-08-15 11:46:33
Enter ".help" for usage hints.
sqlite> .tables
android_metadata   bookmarks          secure           
bluetooth_devices  global             system           
sqlite> select * from secure;
1|location_providers_allowed|
2|mock_location|0
3|backup_enabled|0
4|backup_transport|android/com.android.internal.backup.LocalTransport
5|mount_play_not_snd|1
6|mount_ums_autostart|0
7|mount_ums_prompt|1
8|mount_ums_notify_enabled|1
9|accessibility_script_injection|0
10|accessibility_web_content_key_bindings|0x13=0x01000100; 0x14=0x01010100; 0x15=0x02000001; 0x16=0x02010001; 0x200000013=0x02000601; 0x20000
0014=0x02010601; 0x200000015=0x03020101; 0x200000016=0x03010201; 0x200000023=0x02000301; 0x200000024=0x02010301; 0x200000037=0x03070201; 0x20
0000038=0x03000701:0x03010701:0x03020701;
11|long_press_timeout|500
12|touch_exploration_enabled|0
13|speak_password|0
14|accessibility_script_injection_url|https://ssl.gstatic.com/accessibility/javascript/android/AndroidVox_v1.js
15|lockscreen.disabled|1
16|screensaver_enabled|1
17|screensaver_activate_on_dock|1
18|screensaver_activate_on_sleep|1
19|screensaver_components|com.google.android.deskclock/com.android.deskclock.Screensaver
20|screensaver_default_component|com.google.android.deskclock/com.android.deskclock.Screensaver
21|accessibility_display_magnification_enabled|0
22|accessibility_display_magnification_scale|2.0
23|accessibility_display_magnification_auto_update|1
24|user_setup_complete|0
25|immersive_mode_confirmations|
26|install_non_market_apps|1
27|wake_gesture_enabled|1
28|lock_screen_show_notifications|1
29|lock_screen_allow_private_notifications|1
30|sleep_timeout|-1
31|android_id|618e371bb8071a47
33|input_methods_subtype_history|
34|selected_input_method_subtype|-1
35|lock_screen_owner_info_enabled|0
36|default_input_method|com.android.inputmethod.pinyin/.PinyinIME
37|trust_agents_initialized|1
38|enabled_accessibility_services|com.iflytek.xiri/com.iflytek.xiri.XiriAccessibilityService
39|accessibility_enabled|1
40|enabled_input_methods|com.android.inputmethod.pinyin/.PinyinIME
sqlite> .quit

3.例子

cd /data/data/com.android.providers.settings/databases
sqlite3 settings.db
sqlite>.dump
sqlite>select * from system;
24|sound_effects_enabled|0
sqlite>update system set value='1' where name='sound_effects_enabled';
sqlite>.quit



你可能感兴趣的:(Android系统中数据库应用)