android设备密码破解和暴力解锁

执行下列操作前,先备份数据库
1、adb pull /data/system/locksettings.db
2、adb pull /data/system/*locksettings*.db
3、adb pull /data/data/com.android.providers.settings/databases/settings.db


一、没有密码的情况下解锁(触摸屏不灵敏)
adb shell wm dismiss-keyguard

二、有密码的情况下解锁:
1)命令强制破解(python程序循环尝试破解)
adb shell locksettings set-pattern --old 12369 12369
locksettings set-pin --old xxxx xxxx
locksettings set-password --old xxxx xxxx
locksettings clear --old xxxx

2)命令暴力删除密码
root删除用户密码数据库:/data/system/locksettings.db
adb shell settings put system lockscreen_disabled false
update secure set value=0 where name='lockscreen.disabled';
adb shell rm -f /data/system/locksettings.db*
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update secure set value = '0' where name = 'screensaver_enabled'"

3)命令通过拉起界面获取进程内部数据破解(反编译apk)
adb shell am start -n com.android.settings/.password.SetupChooseLockPassword
adb shell am start -n com.android.settings/.password.ChooseLockPassword
ConfirmLockPattern$InternalActivity

adb shell am start -n com.android.settings/.SetupChooseLockGeneric
Starting: Intent { cmp=com.android.settings/.SetupChooseLockGeneric }

adb shell am start -n com.android.settings/.ChooseLockGeneric
Starting: Intent { cmp=com.android.settings/.ChooseLockGeneric }

参考:
https://www.theandroidsoul.com/change-remove-lockscreen-pattern-pin-password-adb-android-oreo/
https://stackoverflow.com/questions/23277316/set-screenlock-setting-interactively

你可能感兴趣的:(移动开发)