Monday, October 26, 2015

samsung galaxy s 3 - Can't pass the initial setup wizard on SG3 with broken screen digitizer


So i burned digitizer on i9305 by flashing corrupted recovery. Then i flashed new working custom ROM and recovery, after Stock JB tried some KitKats like MoKee, Omni, CyanOgen 10/11 but i'm facing the same problem with all of them. After booting fresh android i got stuck on the welcome screen / first run setup wizard, cuz can't click anywhere. This phone supports USB OTG so i am able to use mouse in TWRP recovery for example, but the driver is not working on the welcome screen yet. Also i cant use ADB to simulate screen touch cuz it doesn't connect when the initial setup is active. I don't have any backup of initialized/configured android so this is no go either.


Any ideas how to get further? Thanks for any tip.



Answer




Finally found solution via editing /data/data/com.android.providers.settings/databases/settings.db file via sqlite3. Just adb pull that file to your computer, if you use stock recovery you must mount userdata partition manually, in that case see Android ADB Shell Recovery Mounting for hints. Also you can't just pull the file directly but copy it inside adb shell to your sdcard or some intermediary filesystem. Eg. busybox cp sett* /sdcard


To get rid of the initial setup:


update global set value=1 where name='device_provisioned';

update secure set value=1 where name='user_setup_complete';
insert into secure (name,value) VALUES ('device_provisioned','1');

Yes, the device_provisioned must be present in both tables. However on the stock JB there was no global table, so you don't need to take care of it and the secure table is missing some records we update here so these need to be inserted instead. On stock JB before editing the settings.db run PRAGMA wal_checkpoint and PRAGMA journal_mode = DELETE described here: https://stackoverflow.com/a/21258892/881375 otherwise updates on existing rows won't take effect because android will rollback on reboot. For CyanOgenMod 11 just delete the settings.db-journal file and it should be OK.


It was neccessary after pushing the settings.db file back to folder on device to


chmod 660 settings.db

chown system:system settings.db

in this order, because chmod may set the owner and group back to root


USB OTG mouse is still not working sadly, so i guess i must get access for adb anyway.


To enable USB debugging (ADB):


setprop persist.service.adb.enable 1 ('setprop persist.sys.usb.config mtp,adb' if needed)

settings.db:


update secure set value=5037 where name='adb_port';
update global set value=1 where name='adb_enabled';


After booting dialog to confirm PC's fingerprint appears. To avoid this get your adbkey.pub (on linux may be located at ~/.android):


adb push adbkey.pub /data/misc/adb/adbkey.pub
cat adbkey.pub >> adb_keys

After all of this you can input tap|swipe|text anything to control your phone and get access for bluetooth or OTG mouse/keyboard etc. I hope this helps. The fingerprint injection is needed for Android 4.2.2+.


Thanks to xda-developers and android issues with adb security at code.google.com.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...