UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Navigating (enabling developer mode) with broken screen (oneplus 3t)

    Scheduled Pinned Locked Moved Unsolved Support
    29 Posts 5 Posters 6.8k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • D Offline
        doniks @Toadtoad
        last edited by

        @Toadtoad said in Navigating (enabling developer mode) with broken screen (oneplus 3t):

        @doniks I booted into TWRP. Opened up the adb shell and did the following:

        yeah that doesn't sound right. up front please add pwd and ls -l before you mount, otherwise it's kinda hard to know from the distance what actually gets mounted where

        twrp mount system
        chroot system

        the more I think about it, I think ALL halium ports use an image file and not the system partition. it looks like you are mounting the partition.

        please show ls -l / inside the chroot, then we can be sure

        PATH=$PATH:PATH

        not sure, what you are trying to achieve here ... I don't think it does what you think it does ... I think you are adding the literal string ":PATH" to the end of the $PATH environment variable which doesn't make much sense.

        However, since you are not using export I also think it does not affect the lines following, so it is (luckily/unluckily) immaterial

        passwd phablet

        And I got /bin/sh: 3: passwd: not found

        Since it doesn't seem like I'll set up adb or ssh, any suggestions to run headlessly on my phone? Thanks.

        You're jumping to conclusions.

        Please do (I'm just typing from memory, so be careful when copy/pasting and give us relevant output to help you)

        ls -l / 
        cat /etc/fstab
        mount 
        mount /data 
        ls -l /data 
        

        then please see here how to chroot into a halium rootfs http://docs.halium.org/en/latest/porting/debug-build/logging-in.html?highlight=chroot#logging-in

        and again, just to make sure we are on the same page, please ls -l / once inside the rootfs

        ToadtoadT 1 Reply Last reply Reply Quote 0
        • ToadtoadT Offline
          Toadtoad @doniks
          last edited by Toadtoad

          @doniks Okay, I'll try it out. The PATH thing was a typo on my part; I did PATH=$PATH:/bin, but it seems like I didn't have the right idea from the start, so I'll try your instructions. Thanks

          Edit:
          ls -l /

          total 3372
          dr-xr-xr-x   4 root root         0 1970-01-04 02:12 acct
          lrwxrwxrwx   1 root root        11 1970-01-01 00:00 bin -> /system/bin
          lrwxrwxrwx   1 root root        50 1970-01-01 00:00 bugreports -> /data/user_de/0/com.android.shell/files/bugreports
          drwxr-xr-x   3 root root        60 2017-01-12 13:56 cache
          lrwxrwxrwx   1 root root        13 1970-01-01 00:00 charger -> /sbin/charger
          dr-xr-xr-x   2 root root        40 1970-01-01 00:00 config
          lrwxrwxrwx   1 root root        17 1970-01-01 00:00 d -> /sys/kernel/debug
          drwxr-xr-x   8 root root      4096 2017-01-09 11:51 data
          lrwxrwxrwx   1 root root        12 1970-01-01 00:00 default.prop -> prop.default
          drwxr-xr-x  10 root root      3760 1970-01-04 02:12 dev
          drwxr-xr-x   2 root root       140 2017-01-12 13:56 etc
          -rw-r--r--   1 root root     33643 1970-01-01 00:00 file_contexts
          -rw-r--r--   1 root root    674825 1970-01-01 00:00 file_contexts.bin
          -rwxr-x---   1 root root   2212400 1970-01-01 00:00 init
          -rwxr-x---   1 root root      3114 1970-01-01 00:00 init.rc
          -rwxr-x---   1 root root       103 1970-01-01 00:00 init.recovery.hlthchrg.rc
          -rwxr-x---   1 root root        52 1970-01-01 00:00 init.recovery.ldconfig.rc
          -rwxr-x---   1 root root        35 1970-01-01 00:00 init.recovery.mksh.rc
          -rwxr-x---   1 root root      5727 1970-01-01 00:00 init.recovery.qcom.rc
          -rwxr-x---   1 root root       111 1970-01-01 00:00 init.recovery.service.rc
          -rwxr-x---   1 root root      1323 1970-01-01 00:00 init.recovery.usb.rc
          drwxr-xr-x   3 root root        60 1970-01-01 00:00 license
          drwxr-xr-x   3 root system      60 1970-01-04 02:12 mnt
          drwxr-xr-x   2 root root       200 1970-01-01 00:00 odm
          drwxr-xr-x   2 root root        40 1970-01-01 00:00 oem
          drwxrwxrwx   2 root root        40 1970-01-04 02:12 persist
          -rw-r--r--   1 root root     23786 1970-01-01 00:00 plat_file_contexts
          -rw-r--r--   1 root root      7212 1970-01-01 00:00 plat_hwservice_contexts
          -rw-r--r--   1 root root      6687 1970-01-01 00:00 plat_property_contexts
          -rw-r--r--   1 root root      1315 1970-01-01 00:00 plat_seapp_contexts
          -rw-r--r--   1 root root     14057 1970-01-01 00:00 plat_service_contexts
          dr-xr-xr-x 384 root root         0 1970-01-01 00:00 proc
          lrwxrwxrwx   1 root root        15 1970-01-01 00:00 product -> /system/product
          -rw-r--r--   1 root root      3042 1970-01-01 00:00 prop.default
          drwxr-xr-x   3 root root        80 1970-01-01 00:00 res
          drwx------   2 root root        40 2019-04-15 10:55 root
          drwxr-x---   2 root root      6700 2017-01-12 13:59 sbin
          drwxrwx---   3 root root      4096 2017-01-09 11:51 sdcard
          -rw-r--r--   1 root root    387957 1970-01-01 00:00 sepolicy
          drwxr-xr-x   2 root root        40 1970-01-04 02:12 sideload
          drwxr-x--x   2 root root        40 1970-01-01 00:00 storage
          dr-xr-xr-x  12 root root         0 1970-01-04 02:12 sys
          drwxr-xr-x  24 109  113       4096 2017-01-10 21:47 system
          drwxrwxr-x   2 root shell       80 2017-01-12 14:01 tmp
          drwxr-xr-x   5 root root       180 1970-01-01 00:00 twres
          -rw-r--r--   1 root root      5272 1970-01-01 00:00 ueventd.rc
          drwxrwxrwx   2 root root        40 2017-01-12 13:56 usb_otg
          drwxr-xr-x   3 root root        60 1970-01-01 00:00 vendor
          -rw-r--r--   1 root root      6178 1970-01-01 00:00 vendor_file_contexts
          -rw-r--r--   1 root root         0 1970-01-01 00:00 vendor_hwservice_contexts
          -rw-r--r--   1 root root       218 1970-01-01 00:00 vendor_property_contexts
          -rw-r--r--   1 root root         0 1970-01-01 00:00 vendor_seapp_contexts
          -rw-r--r--   1 root root         0 1970-01-01 00:00 vendor_service_contexts
          -rw-r--r--   1 root root        65 1970-01-01 00:00 vndservice_contexts
          

          cat /etc/fstab

          /dev/block/sda3 /cache ext4 rw 0 0
          /dev/block/sda15 /data ext4 rw 0 0
          /dev/block/sda2 /persist ext4 rw 0 0
          /dev/block/sde20 /system ext4 rw 0 0
           /usb_otg vfat rw 0 0
          

          mount

          'rootfs on / type rootfs (rw,seclabel,size=2834740k,nr_inodes=708685)
          tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=2918948k,nr_inodes=729737,mode=755)
          devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
          proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
          sysfs on /sys type sysfs (rw,seclabel,relatime)
          selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
          tmpfs on /mnt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=2918948k,nr_inodes=729737,mode=755,gid=1000)
          none on /acct type cgroup (rw,relatime,cpuacct)
          tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=2918948k,nr_inodes=729737)
          pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
          adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
          /dev/block/sda15 on /data type ext4 (rw,seclabel,relatime,data=ordered)
          /dev/block/sda15 on /sdcard type ext4 (rw,seclabel,relatime,data=ordered)
          /dev/block/sde20 on /system type ext4 (rw,seclabel,relatime,data=ordered)
          

          mount /data

          mount: '/dev/block/sda15'->'/data': Device or resource busy
          

          ls -l /data

          1|OnePlus3:/ # ls -l /data
          total 32792
          -rw-------  1 root   root   33554432 1973-06-18 14:57 SWAP.img
          drwxrwx--x 44 system system     4096 1973-06-18 14:58 android-data
          drwxr-xr-x  3 root   root       4096 1973-06-18 14:57 cache
          drwx------  2 root   root       4096 1970-01-01 00:02 lost+found
          drwxrwx---  3 root   root       4096 2017-01-09 11:51 media
          drwxr-xr-x  5 root   root       4096 1973-06-18 14:58 system-data
          drwxr-xr-x  3 root   root       4096 2020-06-26 05:32 user-data
          

          The first step of the guide you linked involves the following the command: mount /data/rootfs.img /a, which outputs that rootfs.img does not exist.

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            doniks @Toadtoad
            last edited by

            @Toadtoad thanks for the clear post!

            The first step of the guide you linked involves the following the command: mount /data/rootfs.img /a, which outputs that rootfs.img does not exist.

            oh. uhh. I am really surprised. You are positive that UT is installed right? Maybe things are not working as I thought they are :man_shrugging: Can you show ls -l /system?

            There is a thread about the oneplus 3t in the porting - devices section. People there should know how to chroot in

            ToadtoadT 1 Reply Last reply Reply Quote 0
            • LakotaubpL Offline
              Lakotaubp
              last edited by

              https://forums.ubports.com/topic/3253/oneplus-3-3t/538 Just to help speed things along if needed.

              1 Reply Last reply Reply Quote 2
              • ToadtoadT Offline
                Toadtoad @doniks
                last edited by

                @doniks
                ls -l /system

                total 88
                drwxr-xr-x   2 root root 4096 2020-06-26 06:53 android
                drwxr-xr-x   2 root root 4096 2017-01-10 21:46 bin
                drwxr-xr-x   2 root root 4096 2016-04-12 20:14 boot
                lrwxrwxrwx   1 root root   14 2020-06-26 06:53 cache -> /android/cache
                lrwxrwxrwx   1 root root   13 2020-06-26 06:53 data -> /android/data
                drwxr-xr-x   3 root root 4096 2020-06-26 05:28 debian
                drwxr-xr-x   4 root root 4096 2020-06-26 05:24 dev
                drwxr-xr-x 110 root root 4096 1973-06-18 14:58 etc
                lrwxrwxrwx   1 root root   16 2020-06-26 06:53 factory -> /android/factory
                lrwxrwxrwx   1 root root   17 2020-06-26 06:53 firmware -> /android/firmware
                drwxr-xr-x   3 root root 4096 2020-06-26 05:32 home
                drwxr-xr-x  19 root root 4096 2020-06-26 05:28 lib
                drwx------   2 root root 4096 1970-01-01 00:00 lost+found
                drwxr-xr-x   2 root root 4096 2020-06-26 05:23 media
                drwxr-xr-x   2 root root 4096 2020-06-26 05:23 mnt
                lrwxrwxrwx   1 root root   12 2020-06-26 06:53 odm -> /android/odm
                drwxr-xr-x   3 root root 4096 2020-06-26 05:31 opt
                lrwxrwxrwx   1 root root   16 2020-06-26 06:53 persist -> /android/persist
                drwxr-xr-x   2 root root 4096 2016-04-12 20:14 proc
                drwx------   2 root root 4096 2020-06-26 05:32 root
                drwxr-xr-x   8 root root 4096 2020-06-26 05:31 run
                drwxr-xr-x   2 root root 4096 2020-06-26 05:32 sbin
                drwxr-xr-x   2 root root 4096 2020-06-26 05:23 srv
                drwxr-xr-x   2 root root 4096 2016-02-05 09:48 sys
                lrwxrwxrwx   1 root root   15 2020-06-26 06:53 system -> /android/system
                drwxrwxrwt   2 root root 4096 2020-06-26 05:32 tmp
                drwxr-xr-x   2 root root 4096 2020-06-26 06:53 userdata
                drwxr-xr-x  10 root root 4096 2020-06-26 05:23 usr
                drwxr-xr-x  11 109  113  4096 2020-06-25 12:57 var
                lrwxrwxrwx   1 root root   22 2020-06-26 06:53 vendor -> /android/system/vendor
                

                Should I reinstall UBPorts?

                D 1 Reply Last reply Reply Quote 1
                • D Offline
                  doniks @Toadtoad
                  last edited by doniks

                  @Toadtoad said in Navigating (enabling developer mode) with broken screen (oneplus 3t):

                  @doniks
                  ls -l /system

                  total 88
                  drwxr-xr-x   2 root root 4096 2020-06-26 06:53 android
                  drwxr-xr-x   2 root root 4096 2017-01-10 21:46 bin
                  drwxr-xr-x   2 root root 4096 2016-04-12 20:14 boot
                  lrwxrwxrwx   1 root root   14 2020-06-26 06:53 cache -> /android/cache
                  lrwxrwxrwx   1 root root   13 2020-06-26 06:53 data -> /android/data
                  drwxr-xr-x   3 root root 4096 2020-06-26 05:28 debian
                  drwxr-xr-x   4 root root 4096 2020-06-26 05:24 dev
                  drwxr-xr-x 110 root root 4096 1973-06-18 14:58 etc
                  lrwxrwxrwx   1 root root   16 2020-06-26 06:53 factory -> /android/factory
                  lrwxrwxrwx   1 root root   17 2020-06-26 06:53 firmware -> /android/firmware
                  drwxr-xr-x   3 root root 4096 2020-06-26 05:32 home
                  drwxr-xr-x  19 root root 4096 2020-06-26 05:28 lib
                  drwx------   2 root root 4096 1970-01-01 00:00 lost+found
                  drwxr-xr-x   2 root root 4096 2020-06-26 05:23 media
                  drwxr-xr-x   2 root root 4096 2020-06-26 05:23 mnt
                  lrwxrwxrwx   1 root root   12 2020-06-26 06:53 odm -> /android/odm
                  drwxr-xr-x   3 root root 4096 2020-06-26 05:31 opt
                  lrwxrwxrwx   1 root root   16 2020-06-26 06:53 persist -> /android/persist
                  drwxr-xr-x   2 root root 4096 2016-04-12 20:14 proc
                  drwx------   2 root root 4096 2020-06-26 05:32 root
                  drwxr-xr-x   8 root root 4096 2020-06-26 05:31 run
                  drwxr-xr-x   2 root root 4096 2020-06-26 05:32 sbin
                  drwxr-xr-x   2 root root 4096 2020-06-26 05:23 srv
                  drwxr-xr-x   2 root root 4096 2016-02-05 09:48 sys
                  lrwxrwxrwx   1 root root   15 2020-06-26 06:53 system -> /android/system
                  drwxrwxrwt   2 root root 4096 2020-06-26 05:32 tmp
                  drwxr-xr-x   2 root root 4096 2020-06-26 06:53 userdata
                  drwxr-xr-x  10 root root 4096 2020-06-26 05:23 usr
                  drwxr-xr-x  11 109  113  4096 2020-06-25 12:57 var
                  lrwxrwxrwx   1 root root   22 2020-06-26 06:53 vendor -> /android/system/vendor
                  

                  Now, this looks like UT! I am so surprised.

                  Should I reinstall UBPorts?

                  No, no need. Seems you were correct earlier! Just double check that there is a home/phablet folder in there then it is 100% that this is UT. Then find the passwd executable. It has to be in any of bin sbin usr/bin usr/sbin I'm sure. Then chroot /system and change phablet's password using that passwd that you just found.

                  PS: Could you do me a favor? It's not really relevant for your passwd/ssh question, but it would help me understand how this halium port is put together. Can you paste ls -l /system/var/lib/lxc/android (or without the leading /system if you are inside the chroot)

                  ToadtoadT 1 Reply Last reply Reply Quote 0
                  • J Offline
                    joe
                    last edited by

                    Also try "phablet" as the default password. That's what it was on my OP3.

                    1 Reply Last reply Reply Quote 0
                    • ToadtoadT Offline
                      Toadtoad @doniks
                      last edited by

                      @doniks
                      Ah, I didn't add sbin, /usr/bin, and /usr/sbin to PATH. passwd was in /usr/bin. I changed the password, so I think I'm able to get in. But, it seems like adb isn't even supported on the OP3T, so it seems like a moot point. @joe since you were able to help me navigate to developer mode, do you think you can tell me how to open the terminal with a keyboard, so I could try to setup SSH?

                      J 1 Reply Last reply Reply Quote 0
                      • J Offline
                        joe @Toadtoad
                        last edited by

                        @Toadtoad
                        Once you can be sure that you are past the lock screen:
                        UPDATE on this for me for some reason:

                        • Hold superkey, and press a number to open any app . e.g. settings, which will prompt for password if locked.
                        • Enter password ** For me I now have to press TAB to make the cursor go to the password field.

                        You can reach the terminal or any app by pressing:

                        • Superkey (this will open the dash)
                        • Type in "terminal" , which should search for the app. Then press Enter.
                        • You should be in terminal now, and it asks for your password again. Type that in and press Enter.
                        • Now will be in the command line
                        ToadtoadT 1 Reply Last reply Reply Quote 0
                        • ToadtoadT Offline
                          Toadtoad @joe
                          last edited by Toadtoad

                          @joe Okay, I think nearly everything is setup for SSH. The one thing I can confirm isn't working yet is wifi. My network runs on wpa-psk, and I need some way to bring the credentials to the phone. Is this possible through adb shell?

                          EDIT: Also, do I need to TAB when opening the terminal before entering my password? Thanks.

                          J 1 Reply Last reply Reply Quote 0
                          • J Offline
                            joe @Toadtoad
                            last edited by

                            @Toadtoad
                            Refer to my first post for the wifi part.
                            Under

                            [wifi-security]
                            auth-alg=open
                            group=
                            key-mgmt=wpa-psk
                            pairwise=
                            proto=
                            psk=
                            

                            psk = [your wifi password]

                            I think you can copy the settings from another ubuntu machine under
                            /etc/NetworkManager/system-connections

                            You don't need to TAB for the password in terminal. Also it might vary for the one on the lock screen 😛

                            ToadtoadT 1 Reply Last reply Reply Quote 0
                            • ToadtoadT Offline
                              Toadtoad @joe
                              last edited by

                              @joe I tried copying the file from my Manjaro machine, replacing the permissions and adding the password, but it didn't seem to work, as I couldn't detect my phone on nmap from another computer on the LAN. I even tried to get into the terminal to use nmcli to connect (https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/configure-wifi-connections) but it didn't seem to work, either. How can i get my internet connected, and is there any way to verify I'm actually in the terminal? Sorry for how complicated this is getting, and thanks for the help.

                              J 1 Reply Last reply Reply Quote 0
                              • J Offline
                                joe @Toadtoad
                                last edited by

                                @Toadtoad
                                You are setting up via ADB through TWRP?
                                Permissions should be:
                                -rw------- 1 root root
                                And the profile in /data/system-data/etc/NetworkManager/system-connections is the exact name of the wifi SSID.

                                Not sure how you would know if you are in the terminal or not. One way would be to assume you are, then create a file e.g. "touch testfile" . Then go back to TWRP-adb and see if that file exists.

                                ToadtoadT 1 Reply Last reply Reply Quote 0
                                • ToadtoadT Offline
                                  Toadtoad @joe
                                  last edited by

                                  @joe The permissions were -rwxrwxrwx 1 root root, but that should work as well (albeit it could be more secure). The profile has the same name as the SSID.

                                  After testing, I don't think I was in the terminal. Should I try reinstalling UBPorts from scratch, and is there an initial setup page that I haven't bypassed that I may be hitting? I'm trying to figure out why I didn't access the terminal. I believe I followed the instructions exactly.

                                  C 1 Reply Last reply Reply Quote 0
                                  • C Offline
                                    Capsia @Toadtoad
                                    last edited by

                                    @Toadtoad Hi,
                                    You can test if you are in the terminal by connecting your headphones,
                                    then type:

                                    pactl load-module module-loopback
                                    

                                    Now you should hear your voice from the microphone to the headphones.
                                    If it works, make sure to unload the module before unplugging the headphones:

                                    pactl unload-module module-loopback
                                    

                                    If everything worked, you've successfully opened the terminal.
                                    (If you run the commands without plugged headphones, your phone will generate strange, loud sounds)

                                    ToadtoadT 1 Reply Last reply Reply Quote 1
                                    • ToadtoadT Offline
                                      Toadtoad @Capsia
                                      last edited by

                                      @Capsia Okay, based off of that, it seems like I am not in the terminal, unfortunately. Is there anything else I could try?

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post