How to continue using an android system with a broken touchscreen?


Question

I have many working android cellphones with broken touchscreen but with a working screen and I would like to use them as computing device and/or additional screen. Is there a way to do that?


Answer

Provided your device has an unlockable bootloader and a custom recovery (I strongly advice against buying devices which are artificially destined to become useless, that should be prohibited by law), you should.



In any case I advice anyone worrying their device could break anytime to already have unlocked bootloader and activated wifi and adb (through network, if worrying about usb port breaking) at boot.
Remember that if you are unlocking your bootloader for the first time doing so WILL DELETE all userdata and if you are not in Europe it could void your warranty.



First of all, proceed to install fastboot and adb on your pc, connect the device to the pc and then




  • unlock fastboot (the bootloader) on the device and flash the TWRP custom recovery (if no custom recovery is available you could somehow extract your base recovery image and enable adb and root access editing its default.prop);

  • boot recovery and open a shell with adb shell;

  • find system and userdata (and probably boot) partitions with fdisk -l /dev/block/mmcblk0;

  • mount system with mount -t ext4 <system_partition_file> <mountpoint>);

  • enabling debug is unnecessary cumbersome if you didn't have already enabled it.



    First try adding the following into system's build.prop:



    ro.secure=0
    ro.debuggable=1
    persist.service.adb.enable=1


    If that didn't work, you could try switching to 1 the adb_enabled setting in <data_partition_mount_point>/system/users/0/settings_global.xml.



    If even that didn't work, then you have to rebuild your boot image, properly editing the default.prop file to enable adb and then switching the adb_enabled setting like above.



    You can find information on how to do that here
    (keep in mind that it will probably require device-specific information like kernel_offset, ramdisk_offset, second_offset and tags_offset so you have to find those somewhere first).




    • unmount system and mount userdata;

    • add your adb server public key (placed into ~/.android/adbkey.pub) into userdata's /misc/adb/adb_keys (with a text editor or any other means) to skip device confirmation;

    • umount userdata and reboot the device;




Now that you can connect through adb, install scrcpy on your operating system and use the device remotely from your computer.



And if like me you forgot your pin code, you can disable it by moving the files starting with locksettings from /data/system.
Remember that if you are using file-based encryption, moving or directly changing the pin in the sqlite3 database with



UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled';


will make your encrypted file inaccessible.



References




Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes