轉載時請註明出處和作者連絡方式
文章出處:http://www.limodev.cn/blog
作者連絡方式:李先靜 <xianjimli@gmail.com>
一位朋友玩Broncho A1的鎖屏圖案,結果手機被鎖住了,輸入google ID也不行(在我這裡可以)。恢複系統吧,他又不想重裝所有軟體,於是我研究了一下在命令列修改系統設定的方法。他不是搞技術的,所以我讓他把 settings.db改個名或者刪除掉,不過那樣做有點暴力。這裡介紹一種稍微麻煩但更友好一點的方法。
1.先要編譯一個sqlite3命令列工具(external/sqlite/dist)。
(需要在Android.mk裡把LOCAL_MODULE_TAGS := debug一行注釋掉)
2.把編譯好的sqlite3上傳到A1上。
# adb push out/target/product/littleton/system/xbin/sqlite3 /data
3.用串口或adb串連到A1的終端上。
adb shell<br /># cd /data<br /># chmod 775 sqlite3
4.用sqlite3操作資料系統設定資料庫。
# ./sqlite3 /data/data/com.android.providers.settings/databases/settings.db
查看資料庫中的表:
sqlite> .tables<br />android_metadata bookmarks secure<br />bluetooth_devices gservices system
查看錶system中的內容:
sqlite> select * from system;<br />1|volume_music|11<br />3|volume_system|5<br />5|volume_alarm|6<br />7|mode_ringer|2<br />8|vibrate_on|4<br />9|mode_ringer_streams_affected|38<br />10|mute_streams_affected|46<br />11|dim_screen|1<br />12|stay_on_while_plugged_in|0<br />13|screen_off_timeout|60000<br />14|airplane_mode_on|0<br />15|airplane_mode_radios|cell,bluetooth,wifi<br />16|auto_time|1<br />17|screen_brightness|102<br />18|window_animation_scale|1.0<br />19|transition_animation_scale|0.0<br />20|accelerometer_rotation|1<br />21|dtmf_tone|0<br />22|date_format|MM-dd-yyyy<br />23|notify_led_color|255<br />24|notify_incoming_call|1<br />25|notify_missed_call|1<br />26|notify_SMS_MMS|1<br />27|notify_email|1<br />28|notify_voice_mail|1<br />29|notify_remind|1<br />63|volume_voice|4<br />64|volume_voice_last_audible|4<br />73|lock_pattern_tactile_feedback_enabled|0<br />111|lock_pattern_visible_pattern|1<br />122|font_scale|1.0<br />127|next_alarm_formatted|<br />129|lock_pattern_autolock|1<br />130|lockscreen.patterneverchosen|1<br />131|volume_notification|5<br />132|volume_notification_last_audible|5<br />133|volume_ring|5<br />134|volume_ring_last_audible|5<br />135|lockscreen.lockedoutpermanently|1
查看錶system的schema:
sqlite> .schema system<br />CREATE TABLE system (_id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT UNIQUE ON CONFLICT REPLACE,value TEXT);<br />CREATE INDEX systemIndex1 ON system (name);
修改表中相關內容:
sqlite> update system set value='0' where name='lockscreen.lockedoutpermanently';<br />sqlite> update system set value='0' where name='lock_pattern_autolock';<br />sqlite> update system set value='0' where name='lock_pattern_visible_pattern';
退出資料庫:
sqlite> .quit
5.重啟Broncho A1:
/data # reboot