This is a follow-up question to Apply update from ADB: how to use it when you are locked out of the device. Basically, I intend to somehow use this command to remove the lock screen:

adb sideload customROM.zip

But, the customROM.zip should be something like described here to enable USB debugging. The problem is, those steps are incomplete:

Steps to Enable USB Debugging Using Recovery Mode

  • Unzip the stock ROM.

  • Within the extracted folder, you will find the system.img well extract it too using Ext4 Unpacker

  • Also, extract the Update-SuperSU.v1.65.zip file.

  • Now open the folder where you have extracted the system.img files

  • Grab any .apk file from this folder and change the extension from .apk to .zip

  • And Copy the RSA Certificated to the Update-SuperSU.v1.65 folder (delete previous files if exist)

  • Also, copy the build.prop to the system folder located within Update-SuperSU.v1.65 folder

  • Locate the update-script file within this folder and edit it using Notepad++

  • You need to update the build.prop file after adding the following line at the bottom

  • Next step is updating SQLite Database

  • Which can be done by adding the following code to the update-script file
    sqlite3 /data/data/com.android.providers.settings/databases/settings.db "UPDATE global SET value=1 WHERE name='adb_enabled'"

Cheers! You have Enabled USB Debugging Now you can install your custom or stock ROM using ADB – USB Debugging

Although the above steps seem incomplete, they look convincing that there might be a way to modify a stock ROM to enable USB debugging by:

adb sideload modified-stock-ROM-which-just-enables-USB-debugging-and-does-nothing-else.zip

Is there any better explanation than those steps?

  • A non-rooted stock device should not allow to install unsigned updates. As it is a Samsung device this may be a bit different (unlocking and flashing e.g. via Odin is different to most Android devices) but at least when booting first time after making your changes the device should clear all user data because of the manipulation. As I wrote in your last post the best way is to perform a factory reset.
    – Robert
    Commented Nov 10, 2020 at 21:25
  • @Robert Right, but factory reset erases all data. I just want to keep phone camera photos and videos =)
    – Megidd
    Commented Nov 10, 2020 at 21:27
  • And the device PIN/pattern has been designed to protect those images from "unauthorized access" (authorized is the person who knows the PIN). I understand that this not what you want to hear. Also keep in mind that the files should be encrypted which means that even if you manage to bypass the lock screen you might still not have access to the files.
    – Robert
    Commented Nov 10, 2020 at 21:37
  • we can only tell you what is not possible android.stackexchange.com/q/227110
    – alecxs
    Commented Nov 10, 2020 at 22:11
  • 1
    if someone knows if it is possible (or not) to exploit your device on locked bootloader then it's user elliwigy but believe me that whole stuff you found is all outdated, there is no hope in 2020. this is how i did on another ancient device forum.xda-developers.com/showthread.php?t=2965462
    – alecxs
    Commented Nov 11, 2020 at 19:18

1 Answer 1


Do those steps above. However, when you get adb access on the phone, use it to rm the gesture or passwd file located in /system/system_ext/etc/passwd. This will remove the lock when you use it. Just input anything and it will let you in, which will then unencrypt your files as well.

This is the solution to the best of my knowledge, it's possible I may be incorrect but I think it will work.

  • I don't have the phone any longer. So, I cannot double-check your approach. Maybe someone can test it later :)
    – Megidd
    Commented Nov 3, 2023 at 10:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .