继上文《
删除Android预装软件包,防止恢复出厂再次安装,并装上自己的APP》类刷机后,发现我的手机锁定里面的滑动锁,图案锁,密码锁等可以设置,但是按电源键或者自动锁屏时间到了后失效不灵了,而且按电源键2秒直接关机,也没关机菜单了。
针对这个问题,我成功设置回来了,下面是在Linux上使用adb成功恢复的全过程。
建议你先看到底后再进行操作~~
前提:
步骤:
1.zhipeng@ubuntu:~/samsung$
adb start-server
2.zhipeng@ubuntu:~/samsung$
adb push keystr sdcard/
3.zhipeng@ubuntu:~/samsung$
adb shell
4.shell@android:/ $ su
5.shell@android:/ #
mount -o remount,rw rootfs /
6.shell@android:/ # cp sdcard/keystr /efs/imei/
6.shell@android:/ # cp sdcard/keystr /efs/
FactoryApp/
6.
shell@android:/ # cp
/storage/sdcard0/keystr
6.
shell@android:/ # cp
1开启adb服务
2将文件推送至手机内存(推送到其他目录需要android root权限,但是linux是没有root权限的)
3.进入android 终端
4.使用root
5.挂载 sdcard 为可读写,(否则下一步会报错:read-only)
6.将sdcrard/keystr 拷贝至对应的目录。
那如何知道这些目录的呢,下面是查询cp keystr目录的步骤:
shell@android:/ #
find | grep keystr
./efs/imei/keystr
./efs/FactoryApp/keystr
./efs/FactoryApp/keystr_bak(这个是我自己cp 命令备份的OFF)
./storage/sdcard0/keystr
./proc/LinuStoreIII/keystr
find: ./proc/6240: No such file or directory
find: ./proc/6262: No such file or directory
find: ./proc/6719: No such file or directory
./data/media/keystr
shell@android:/ #
od -x /efs/imei/keystr /efs/FactoryApp/keystr /storage/sdcard0/keystr /data/media/keystr
0000000 4e4f 4e4f 4e4f 4e4f
0000010
shell@android:/ #
od -x /efs/FactoryApp/keystr
0000000 4e4f
0000002
shell@android:/ #
cat /efs/FactoryApp/keystr
ONshell@android:/ #
(内容是OFF,十六进制:4e4f)
shell@android:/ #
od -x /efs/FactoryApp/keystr_bak
0000000 464f 0046
0000003
shell@android:/ #
cat /efs/FactoryApp/keystr_bak
OFFshell@android:/ #
(内容是OFF,十六进制:464f)
od命令查看文件的十六进制,确保keystr输出的结果第一行是
0000000 4e4f
可以使用
vi keystr
打开查看,里面内容是ON,如果是OFF建议使用cp命令备份一个bak。
shell@android:/ #
ls -al /proc/LinuStoreIII/
-rw-r--r-- root root 0 2014-02-26 13:55 MD5_checksum
-rw-rw-r-- radio radio 0 2014-02-26 13:55 keystr
...
这里面的keystr是设备radio,不用管这个。
将前面的keystr全部替换~~
7.重启手机试试看~~
说明:第5步,可以直接跳过,但是第6步需要把cp 替换为cat:
cat sdcard/keystr > /efs/imei/keystr
这种方法执行完后需要ctrl+d一次,而且后期使用sdcard很不方便。
参考: