Android setting 값 저장되어 있는 db file 위치와 내용 보기


android 개발을 하다보면 setting 값을 매번 바꾸어 주어야 할 때 그 귀찮음은 이루 말할 수 없습니다.

이때 사용할 수 있는 간단한 방법은 setting 이 다 끝난 상태의 값들을 local PC 로 저장해 놓았다가 다음에 setting 값 변경이 필요하다면 로컬에 저장된 파일을 다시 push 하여 기본 세팅값 들을 간단히 변경할 수 있습니다.


그럼 setting 값들이 저장된 db 파일이 있는 위치를 알아야 하겠죠?


db file 은 /data/data/com.android.providers.settings/databases/settings.db 에 위치해 있습니다.

db 의 table 을 보면 


sqlite> .table

.table

android_metadata   bookmarks          secure

bluetooth_devices  global             system


와 같이 들어 있음을 알 수 있습니다. 이 중 system 이나 secure 의 내용이 일반적으로 세팅에 많이 사용되는 table 입니다.



그럼 system 의 내용을 볼까요? 아래의 내용을 보면 music 볼륨, system voluem 등 값이 저장되어 있음을 알 수 있습니다.


sqlite> select * from system;

select * from system;

1|volume_music|11

2|volume_ring|5

3|volume_system|7

4|volume_voice|4

5|volume_alarm|6

6|volume_notification|5

7|volume_bluetooth_sco|7

9|mute_streams_affected|46

10|vibrate_when_ringing|0

11|dim_screen|1

13|dtmf_tone_type|0

14|hearing_aid|0

15|tty_mode|0

16|screen_brightness|82

17|screen_brightness_mode|1

18|window_animation_scale|1.0

19|transition_animation_scale|1.0

20|accelerometer_rotation|1

21|haptic_feedback_enabled|1

22|notification_light_pulse|1

23|dtmf_tone|1

24|sound_effects_enabled|1

26|lockscreen_sounds_enabled|1

27|pointer_speed|0

28|mode_ringer_streams_affected|422

30|alarm_alert|content://media/internal/audio/media/14

31|next_alarm_formatted|

32|notification_sound|content://media/internal/audio/media/103

33|ringtone|content://media/internal/audio/media/185

34|volume_music_headset|6

35|volume_music_headphone|6

36|media_button_receiver|com.google.android.music/com.google.android.music.playback.MediaButtonIntentReceiver

37|screen_off_timeout|1800000



secure 의 내용은 아래와 같습니다. bluetooth address 등 많은 값들이 저장되어 있네요.


sqlite> select * from secure;

select * from secure;

2|mock_location|1

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; 0x200000014=0x02010601; 0x

200000015=0x03020101; 0x200000016=0x03010201; 0x200000023=0x02000301; 0x200000024=0x02010301; 0x200000037=0x03070201; 0x200000038=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|0

16|screensaver_enabled|1

17|screensaver_activate_on_dock|1

18|screensaver_activate_on_sleep|0

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

25|android_id|336353ae4535862c

27|enabled_input_methods|com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME:com.google.android.googlequicksearchbox/com.google.android.

voicesearch.ime.VoiceInputMethodService

28|input_methods_subtype_history|

29|selected_input_method_subtype|-1

30|selected_spell_checker|com.google.android.inputmethod.latin/com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService

31|selected_spell_checker_subtype|0

32|lock_screen_owner_info_enabled|0

33|voice_recognition_service|com.google.android.googlequicksearchbox/com.google.android.voicesearch.serviceapi.GoogleRecognitionService

34|default_input_method|com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME

35|enabled_print_services|com.google.android.apps.cloudprint/com.google.android.apps.cloudprint.printdialog.services.CloudPrintService

36|enabled_on_first_boot_system_print_services|com.google.android.apps.cloudprint/com.google.android.apps.cloudprint.printdialog.services.CloudPrintService

37|sms_default_application|com.android.mms

38|bluetooth_name|Odin

39|bluetooth_address|22:22:EB:9F:2D:F2

40|bluetooth_addr_valid|1

41|location_providers_allowed|gps,network

42|allowed_geolocation_origins|http://www.google.co.uk http://www.google.com

43|user_setup_complete|1

44|last_setup_shown|eclair_1


참고로 wifi 의 MAC Address 는 /system/wifi/broadcom/nvram/bcmXXXX_nvram.txt  파일에 저장되어 있습니다. 물론 bcmXXX 를 사용할때의 값 입니다.


이제 이 database 파일을 pull 명령어로 로컬 PC에 저장한 후 다시 Android Machine 에 넣으면 됩니다. 명령어는 아래와 같습니다.


local PC 에 저장할 때

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


Android Machine 에 넣을 때

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


이상 Android setting 값 저장되어 있는 db file 위치와 내용 보기에 대한 글 이였습니다.




Posted by 인포개더러
,