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

    Installing Ubuntu Touch to a Xiaomi Mi A2 with Android 10

    Scheduled Pinned Locked Moved Solved Xiaomi Mi A2
    31 Posts 5 Posters 9.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.
      • E Offline
        embeddedmz
        last edited by embeddedmz

        Hi everyone,

        I bought a second hand Xiaomi Mi A2 with Android 10 installed on it. I need to install Android 9 : jasmine_sprout_stock_android9.zip I found a tool that's only available on Windows, but this last is having driver problems (in hardware manager it is not recognized) so I found Xiaomi ADB/Fastboot tools that can be run on Ubuntu 20 : https://github.com/Szaki/XiaomiADBFastbootTools/releases/tag/7.0.3

        UBports is telling me to have a specific Android installed on the phone and gave me this link to download it : https://github.com/ubports-xiaomi-sdm660/artifacts/releases/download/v0.1/jasmine_sprout_stock_android9.zip

        After unzipping this last, Xiaomi ADB/Fastboot tools can't recognize its content and outputs this error : Fastboot ROM not found.

        I can continue the installation process but I'm afraid that will make the installation fails if I don't have the specific android version.

        Thanks.

        1 Reply Last reply Reply Quote 0
        • MrT10001M Offline
          MrT10001
          last edited by MrT10001

          Make sure the phones bootloader is unlocked. This is vital for any ROM installation on phones. Do not relock the bootloader as this can brick the phone in certain circumstances. All Xiaomi stock ROM flashing seems to be aimed at a Windows PC (.exe files). You can install TWRP recovery through fastboot and install the ROM that way. The other way through fastboot is to extract the zip file and flash each file manually using the fastboot flash command. If you are OK with fastboot commands and flashing ROMs, try the install with Android 10 (it worked for me with a Redmi note 7). If it goes wrong you can always reflash to Android 9 and then try again. Ubuntu Touch in my experience won't brick your phone.

          Xiaomi Redmi Note 7.... And more...
          I have too many devices...

          1 Reply Last reply Reply Quote 1
          • E Offline
            embeddedmz
            last edited by

            TWRP crashes + I need more precise instructions

            MrT10001M N 2 Replies Last reply Reply Quote 1
            • MrT10001M Offline
              MrT10001 @embeddedmz
              last edited by

              @embeddedmz As I said make sure the bootloader is unlocked. Check this by enabling developer options (tapping the build version repeatedly to enable it). Once developer options are enabled go in and make sure USB debugging is enabled and OEM unlock is enabled. Reboot the phone and go back into developer options and there should be another option under OEM unlock to check the bootloader unlock status. Once that is done, connect the phone up to a PC and copy the Android 9 ROM for the phone to the root of the directory, i.e. not in a folder. Then reboot into fastboot mode and flash TWRP to the phone:

              fastboot flash recovery /path/to/twrp-3.6.0_9-0-jasmine_sprout.img
              

              As a side note, I install Android Studio, which gives me the latest ADB and Fastboot tools which for me on Windows and Linux work, rather than older versions that vary in their ability.

              Once installed boot into TWRP and install from a zip file. Choose the ROM zip and it should flash to Android 9.

              If you are unsure, Google as there are loads of sites that give really detailed instructions what to do.

              Xiaomi Redmi Note 7.... And more...
              I have too many devices...

              E 1 Reply Last reply Reply Quote 1
              • N Offline
                nero355 @embeddedmz
                last edited by nero355

                @embeddedmz
                Please only use official Xiaomi Tools to prepare your phone for Ubuntu Touch :

                • Xiaomi Flash Tool :
                  https://c.mi.com/in/miuidownload/detail?guide=2
                  It also installs the right drivers for you!
                • Xiaomi Unlock Tool :
                  https://en.miui.com/unlock/download_en.html
                  Only used for Unlocking the Bootloader!

                Carefully follow their instructions and make sure that :

                • You DO NOT lock your Bootloader EVER AGAIN !!! 😉
                • You have a phone that is 100% original!
                  So for example that the display has never been repaired by someone who has no idea what he is doing or accidentally used a non-original display to repair his phone! 😉

                Stick to those rules and you are all good to go! 🙂

                My phones :

                • BQ Aquaris E5 HD Ubuntu Phone Edition - Ubuntu Touch 16.04 LTS
                • ZUK Z2 Pro - ZUI Android 8.x
                • Xiaomi Mi 9T - Jolla SailFish 3.4.x Community Build

                P.S. : I am NOT a developer! ;)

                MrT10001M 1 Reply Last reply Reply Quote 1
                • MrT10001M Offline
                  MrT10001 @nero355
                  last edited by

                  @nero355 - @embeddedmz is not on windows so the Mi Unlock tool won't work, neither will the flashing tool. It does make life easier using windows for these tasks, but if it is unlocked you can flash a ROM with TWRP or manually in the CLI using fastboot. I would also use Google to search how to do that specific phone, as it is a lot quicker than me explaining it and missing a step or getting a step wrong. Time is my enemy.......

                  Xiaomi Redmi Note 7.... And more...
                  I have too many devices...

                  N 1 Reply Last reply Reply Quote 0
                  • N Offline
                    nero355 @MrT10001
                    last edited by

                    @mrt10001
                    Boot a small VM under Linux with Windows inside and Passthrough the USB Hub and it's ports and GO GO GO 🙂

                    My phones :

                    • BQ Aquaris E5 HD Ubuntu Phone Edition - Ubuntu Touch 16.04 LTS
                    • ZUK Z2 Pro - ZUI Android 8.x
                    • Xiaomi Mi 9T - Jolla SailFish 3.4.x Community Build

                    P.S. : I am NOT a developer! ;)

                    MrT10001M 1 Reply Last reply Reply Quote 0
                    • MrT10001M Offline
                      MrT10001 @nero355
                      last edited by

                      @nero355 said in Installing Ubuntu Touch to a Xiaomi Mi A2 with Android 10:

                      @mrt10001
                      Boot a small VM under Linux with Windows inside and Passthrough the USB Hub and it's ports and GO GO GO 🙂

                      Yes, thats one thing I would do, but a VM with windows is a PIA for the time taken to get it going. I know there is enthusiasm for UT, but I don't know how far people would go to install it, let alone their expertise in working through an issue to resolve it.

                      Xiaomi Redmi Note 7.... And more...
                      I have too many devices...

                      1 Reply Last reply Reply Quote 0
                      • E Offline
                        embeddedmz @MrT10001
                        last edited by embeddedmz

                        @mrt10001 said in Installing Ubuntu Touch to a Xiaomi Mi A2 with Android 10:

                        As I said make sure the bootloader is unlocked. Check this by enabling developer options (tapping the build version repeatedly to enable it). Once developer options are enabled go in and make sure USB debugging is enabled and OEM unlock is enabled. Reboot the phone and go back into developer options and there should be another option under OEM unlock to check the bootloader unlock status.

                        This is already done ! and with the tool I got from github the phone is unlocked all the time (I used volume keys and unlock screen button to do it, the smartphone was is "fastboot" with a bunny working on an android logo).

                        I downloaded TWRP from the play store and I didn't checked "run as root" as it crashes the app. This software used the browser to download a file named "twrp-installer-3.6.0_9-0-jasmine_sprout.zip" what I do with this file ?

                        Otherwise, the 1 GB Android 9 zip file I downloaded from github contains the following items :
                        alt text

                        @mrt10001 said in Installing Ubuntu Touch to a Xiaomi Mi A2 with Android 10:

                        Once that is done, connect the phone up to a PC and copy the Android 9 ROM for the phone to the root of the directory, i.e. not in a folder. Then reboot into fastboot mode and flash TWRP to the phone:
                        fastboot flash recovery /path/to/twrp-3.6.0_9-0-jasmine_sprout.img

                        These instructions are not clear for me 😞

                        @nero355 said in Installing Ubuntu Touch to a Xiaomi Mi A2 with Android 10:

                        Xiaomi Flash Tool :
                        https://c.mi.com/in/miuidownload/detail?guide=2
                        It also installs the right drivers for you!

                        No, the program is a joke and it doesn't install the drivers (I got a message in chinese)

                        In Windows 8.1, this is what it looks in the hardware manager + windows is not happy with the driver I found here : https://developer.android.com/studio/run/oem-usb for Xiaomi (it told me that it has a bad hash).

                        alt text

                        I'm doing all this because I want to ungoogle my life. Google is an evil company playing a key role in the new world order (and above all I'm fed up with Android spying on me through the microphone)

                        M N 2 Replies Last reply Reply Quote 1
                        • M Offline
                          mkarpicki @embeddedmz
                          last edited by mkarpicki

                          @embeddedmz , did you try to follow this instructions?
                          https://forums.ubports.com/topic/6951/ubports-quick-and-simple-install-on-xiaomi-mi-a2

                          I was in same sittuation, phone I bought had Android 10 but I downgraded it following tutorial I linked above.

                          E 3 Replies Last reply Reply Quote 2
                          • E Offline
                            embeddedmz @mkarpicki
                            last edited by

                            @mkarpicki No, I will follow it. Thanks !

                            1 Reply Last reply Reply Quote 0
                            • E Offline
                              embeddedmz @mkarpicki
                              last edited by embeddedmz

                              @mkarpicki in the tutorial he doesn't explain where he got the fastboot program. Can you give me a link ? I work under Ubuntu as my Win8.1 doesn't have the proper drivers for Xiaomi.

                              I tried to use another tool (https://github.com/Szaki/XiaomiADBFastbootTools/releases/tag/7.0.3) to boot the TWRP image but I got a black screen.

                              UPDATE : okay, I started the smartphone by pressing volume down and plugging it into the computer.

                              fastboot package is already installed in ubuntu.

                              UPDATE 2: I got a black screen after this :
                              ./fastboot boot ~/Downloads/twrp-3.5.2_9-0-jasmine_sprout.img

                              E M 2 Replies Last reply Reply Quote 0
                              • E Offline
                                embeddedmz @embeddedmz
                                last edited by

                                This post is deleted!
                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  mkarpicki @embeddedmz
                                  last edited by mkarpicki

                                  @embeddedmz you are fast.. before I noticed you replied, you already had 2 updates on progress..

                                  (one more tutorial basically similar: https://forums.ubports.com/topic/7101/install-ubports-on-xiaomi-mi-a2 )

                                  I did not have that black screen to be honest, I assume you did:

                                  • activate the developer mode,
                                  • list itemUSB debugging and
                                  • list item bootloader unlock)

                                  and then did

                                  ./fastboot flashing unlock
                                  ./fastboot flashing unlock_critical
                                  

                                  ?

                                  let me think a bit but I really think I did not do anything more than described - only thing which comes to my mind (but I did not assume it makes any difference) , I had Android Studio installed in past already with adb and whatever tools included from times I did try doing some Android development in free time.

                                  ps... please be aware I am also rookie here, I tried that week+ ago so I am not much more experienced in this area..

                                  E 1 Reply Last reply Reply Quote 0
                                  • E Offline
                                    embeddedmz @mkarpicki
                                    last edited by

                                    @mkarpicki Yes I have already followed those steps. On YouTube I found how to launch the FastBoot by pressing the volume down button then plugging the smartphone into the computer.

                                    I tried 10 different images for TWRP and I still have black screens 😢 😢 😢

                                    messayistoM M 2 Replies Last reply Reply Quote 0
                                    • messayistoM Offline
                                      messayisto @embeddedmz
                                      last edited by

                                      @embeddedmz You could take the risk and complete the installation process with Android 10 on your phone. I did that and - amazingly - it worked.
                                      Look here:
                                      https://forums.ubports.com/topic/6349/installation-succes-at-the-first-try

                                      As the thread says, the installation was much easier than I thought, but I probably just got lucky.

                                      M 1 Reply Last reply Reply Quote 1
                                      • M Offline
                                        mkarpicki @embeddedmz
                                        last edited by

                                        @embeddedmz , hmm. No idea to be honest, you are on Ubuntu (host machine) or Windows?
                                        I was on Ubuntu for whole process of reinstalling android , at some point I used Mac as ubports installer could not find device (I assume usb issue described somewhere). Do you have a chance try other host machine (or if on Win, check if you have some Google USB drivers - but no idea why would that help?)

                                        1 Reply Last reply Reply Quote 0
                                        • M Offline
                                          mkarpicki @messayisto
                                          last edited by

                                          @messayisto , If I would know that week+ ago - it would also save me some stress and Saturday night 🙂 (still was a pleasure but nice it worked with 10 for you!)

                                          1 Reply Last reply Reply Quote 0
                                          • MrT10001M Offline
                                            MrT10001
                                            last edited by

                                            @embeddedmz - I thought you didn't have access to a windows machine. This makes life easier, however upgrade to window 10 at least, windows 8.1 will have woefully inadequate support for drivers and items such as fastboot and ADB (USB device drivers). As the phone is unlocked, use the Mi Flash tool to downgrade the ROM to Android 9, it is by far the easiest method. There is an US English version, ignore the pop up box in Chinese, it is pretty much no use. However try installing UT with Android 10 first, it may just work. As I said, I download and use Android Studio as it installs the correct and latest Fastboot and ADB drivers and has always worked for me.
                                            This is my MiFlash tool in windows:
                                            miflashtool21.jpg - note the phone ROM is for kenzo - Redmi Note 3(not a Mi A2) as I was downgrading a different phone, use the select to browse to your ROM and DO NOT relock the bootloader.

                                            Xiaomi Redmi Note 7.... And more...
                                            I have too many devices...

                                            E 2 Replies Last reply Reply Quote 2
                                            • E Offline
                                              embeddedmz @MrT10001
                                              last edited by

                                              @mrt10001 OK Thank you, I will use my office computer (Windows 10) wednesday and let you know if that worked 🙂

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