[UNOFFICIAL] LineageOS 19.1 for Amlogic G12*/SM1 Family Devices

Search This thread

npjohnson

Recognized Developer
Why is this the case? Is this inability particular to the version of the factory build that you have installed? Where is the failure? Are the dev options not available, or does adb over usb just not connect?




Since your device is exploitable and unlocked, have you considered installing fred's boot-from-usb ubuntu build?

Fred's ubuntu build preceded the unlock method release, and at the time of its release would have been of no use for a situation like yours because any attempt to modify the emmc system from the temporarily usb-booted system would cause avb to fail.

But since your device is unlocked and exploitable, you could use the temporarily usb-booted ubuntu system to dd a factory recovery image back to the emmc, and avb wouldn't be an issue. Fred's method also enables aml v2 factory burn via the reset button, which could give you another vector to write the recovery partition using the update utility via burn mode. The same methods could also be used to write a magisk-patched boot image to the boot partition.

Using an update command with burn mode may also provide a method to instantaneously boot to bootloader fastboot, without even rebooting the device.

The only issue you may run into when trying to do this is that the bootloader version may be stale relative to the bootloader that is currently installed on your device, so the bootloader used, or fred's method of disabling anti-rollback detection may need to be adjusted to take into account the bootloader version currently installed on your device. Also check if the temporary system uses its own environment.
This would also work.
 

goapy

Senior Member
Dec 30, 2021
137
35
Replace "reboot bootloader" with "fastboot"
The entire panoply of u-boot console commands is available via the exploit? But I suppose "update" would not work, because burn mode is disabled?

Has the current factory u-boot source (post-exploit) been posted somewhere? I have a suspicion that it has been hard-coded to ignore whatever value the lock variable may have.
 

npjohnson

Recognized Developer
The entire panoply of u-boot console commands is available via the exploit? But I suppose "update" would not work, because burn mode is disabled?

Has the current factory u-boot source (post-exploit) been posted somewhere? I have a suspicion that it has been hard-coded to ignore whatever value the lock variable may have.
We patched our U-Boot to allow burn mode, so you could totally use update.

You just need to directly boot into burn mode, which is actually easy, if you go into our U-Boot source and revert the AML burn V2 commit, when you run the exploit it will auto boot you into burn mode
 
  • Like
Reactions: kennkanniff
TL;DR - I was able to crash out of the recovery bootloop on dopinder... somehow...

Hmm... Well I just had an interesting evening. I have two of the dopinder boxes, so I figured I'd mess around with the second one. Was able to update from 18.1 to 19.1 via booting into 18.1 recovery, wiping everything, and sideloading 19.1. Booted up just fine. Started to mess around with enabling stuff, etc.

I decided to press my luck and tell the device to reboot to recovery via the OS. Ended up where everyone else did: unbootable device trying to get into a non-behaving recovery.

Kinda knew that's where I'd end up, so I pressed on. Soldered onto the UART points and had output from the device just fine, but didn't have input. Could see that it was banging its head against the wall, trying to boot into the recovery. So, I started messing around with OTG. Could see that while booting with the device's button depressed, that it would scan the usb drive I had plugged in, and it'd recognize the 18.1 recovery.img that I had on it.

Seeing the discussion above about tweaking the Sabrina stuff to get back up and running, I was going to go that direction. Since this device doesn't have USB C, I knew that the solution wouldn't be too pretty. I ended up tapping into +5v and GND points directly on the device side and supplied power directly. The OTG and thumb drive were being run fine in this manner. My thought process was that I could unplug the OTG (with the device still online, during the 10 sec period mentioned in the repo) after the exploit was run and then hot-swap in a USB cable that I had severed the non-data wires on. When I went to test this chopped cable itself (without messing with the exploit) and turned the power supply on, the device just came online properly.

So... I just wanted to relay this. Thinking of "re-bricking" again and seeing if I can get out of it. I foolishly accidentally had nested minicom and tmux (with overlapping meta keys) at some point in the X hours of tinkering. Accidentally nuked my session such that the running output was lost. Also wasn't logging to file at the time, as I wasn't expecting to be at an "attempt" at the time the device booted correctly.

Just wanted to post that I had something funky (with a positive outcome) happen.
 
Last edited:

goapy

Senior Member
Dec 30, 2021
137
35
Was able to update from 18.1 to 19.1 via booting into 18.1 recovery, wiping everything, and sideloading 19.1. Booted up just fine. Started to mess around with enabling stuff, etc.

I decided to press my luck and tell the device to reboot to recovery via the OS. Ended up where everyone else did: unbootable device trying to get into a non-behaving recovery.

I don't understand. How did you "tell the device to reboot to recovery via the OS"?

If you had just sideloaded 19.1 successfully, the recovery partition on the device would have contained the 19.1 recovery, which boots just fine if it is present with the entirety of the rest of the 19.1 OS.

So, which OS did you have installed when you told "the device to reboot to recovery"? And how exactly did you "tell it" to do so?

... ended up tapping into +5v and GND points directly on the device side and supplied power directly. The OTG and thumb drive were being run fine in this manner. My thought process was that I could unplug the OTG (with the device still online, during the 10 sec period mentioned in the repo) after the exploit was run and then hot-swap in a USB cable that I had severed the non-data wires on. When I went to test this chopped cable itself (without messing with the exploit) and turned the power supply on, the device just came online properly.

I don't understand what you were trying to accomplish by doing what you describe above.

dopinder is a vastly different device than sabrina when it comes to being stuck in a recovery bootloop, or any other sort of problem.

With dopinder, you're only a reset button press away from burn mode, which can be used to immediately load bootloader fastboot. You'd just have to hold the button until the usb connection is established, assuming that you have the worldcup drivers installed.

I did this several times last night while testing 19.1. Each time involved only a minute or so of downtime.
 
So, which OS did you have installed when you told "the device to reboot to recovery"? And how exactly did you "tell it" to do so?
lineage-19.1-20220513-UNOFFICIAL-dopinder.zip was what I sideloaded and was confirmed running at the time and the device was rebooted to recovery via "Advanced reboot" options in the power menu.

I don't understand. How did you "tell the device to reboot to recovery via the OS"?

If you had just sideloaded 19.1 successfully, the recovery partition on the device would have contained the 19.1 recovery, which boots just fine if it is present with the entirety of the rest of the 19.1 OS.

So, which OS did you have installed when you told "the device to reboot to recovery"? And how exactly did you "tell it" to do so?



I don't understand what you were trying to accomplish by doing what you describe above.

dopinder is a vastly different device than sabrina when it comes to being stuck in a recovery bootloop, or any other sort of problem.

With dopinder, you're only a reset button press away from burn mode, which can be used to immediately load bootloader fastboot. You'd just have to hold the button until the usb connection is established, assuming that you have the worldcup drivers installed.

I did this several times last night while testing 19.1. Each time involved only a minute or so of downtime.
I had not read this full 800+ message thread, I probably had a mix up is all then.

Edit: Rebooted device to recovery (via adb this time) and the device didn't come online, just like before. Found a linux version of the AML utils (as you suggested to use). Was able to interrupt boot with the button and when the device was seen in dmesg I fired off update bulkcmd fastboot >>> fastboot flash recovery recovery.img >>> fastboot boot boot.img and have a working recovery now. Spoilered my previous post.
 
Last edited:

goapy

Senior Member
Dec 30, 2021
137
35
lineage-19.1-20220513-UNOFFICIAL-dopinder.zip was what I sideloaded and was confirmed running at the time and the device was rebooted to recovery via "Advanced reboot" options in the power menu.

I may not have checked that exact sequence. I thought you meant that you couldn't even get to the screen where you could select "Advanced reboot", in the first instance.

I'll check it again. I'm sure all of this will be sorted out before official release. At least the build itself seems to run well enough. The OP states that "OTA is provided the same way officials would have them", but I'm not sure exactly what that means, or how the recovery might apply an OTA update, or if it can be disabled.
 

npjohnson

Recognized Developer
I may not have checked that exact sequence. I thought you meant that you couldn't even get to the screen where you could select "Advanced reboot", in the first instance.

I'll check it again. I'm sure all of this will be sorted out before official release. At least the build itself seems to run well enough. The OP states that "OTA is provided the same way officials would have them", but I'm not sure exactly what that means, or how the recovery might apply an OTA update, or if it can be disabled.
We have an Updater app that is I configure to point at my server.
 
  • Like
Reactions: endera
lineage-19.1-20220513-UNOFFICIAL-dopinder.zip was what I sideloaded and was confirmed running at the time and the device was rebooted to recovery via "Advanced reboot" options in the power menu.


I had not read this full 800+ message thread, I probably had a mix up is all then.

Edit: Rebooted device to recovery (via adb this time) and the device didn't come online, just like before. Found a linux version of the AML utils (as you suggested to use). Was able to interrupt boot with the button and when the device was seen in dmesg I fired off update bulkcmd fastboot >>> fastboot flash recovery recovery.img >>> fastboot boot boot.img and have a working recovery now. Spoilered my previous post.
Yes this worked for me to just needed to use amlogictools , sideloaded it with the 18 version / then reset it while holding the button on the side used the tools to run update bulkcmd fastboot >>>> then fastboot flash recovery lineage-19.1-20220515-recovery-dopinder.img >>>> then fastboot boot lineage-19.1-20220515-recovery-dopinder.img and just factory reset. Booted up just fine
 
Last edited:

kennkanniff

Senior Member
May 6, 2013
181
279
Why is this the case? Is this inability particular to the version of the factory build that you have installed? Where is the failure? Are the dev options not available, or does adb over usb just not connect?




Since your device is exploitable and unlocked, have you considered installing fred's boot-from-usb ubuntu build?

Fred's ubuntu build preceded the unlock method release, and at the time of its release would have been of no use for a situation like yours because any attempt to modify the emmc system from the temporarily usb-booted system would cause avb to fail.

But since your device is unlocked and exploitable, you could use the temporarily usb-booted ubuntu system to dd a factory recovery image back to the emmc, and avb wouldn't be an issue. Fred's method also enables aml v2 factory burn via the reset button, which could give you another vector to write the recovery partition using the update utility via burn mode. The same methods could also be used to write a magisk-patched boot image to the boot partition.

Using an update command with burn mode may also provide a method to instantaneously boot to bootloader fastboot, without even rebooting the device.

The only issue you may run into when trying to do this is that the bootloader version may be stale relative to the bootloader that is currently installed on your device, so the bootloader used, or fred's method of disabling anti-rollback detection may need to be adjusted to take into account the bootloader version currently installed on your device. Also check if the temporary system uses its own environment.
I fixed my device by using fred's exploit to put device in USB burn mode and flashing a working 18.1 recovery using the the update tool found in the bin directory. Thanks allot for all your help.
 
  • Like
Reactions: BTK19

RDS5

Senior Member
ive noticed how theres new builds available. i tried booting the recovery (15th may) but it didnt boot (same thing as before).
@goapy said that one of his wouldnt boot the recovery either (were both on wade) but what could the issue here be?
i know that 19.1 would probably work if i flashed it from 18.1 recovery, but if for whatever reason it tries to reboot to recovery, id be in for a hell of a time, since it would stay stuck on the android tv screen.
any chance of fixing the recovery?
 

RDS5

Senior Member
Has anyone able to install a mouse toggle for this device. certain apps are broken due to it. Just wondering ?
no sadly, i tried to use mouse toggle and it wouldnt work.
i wish there was some kind of mouse toggle alternative, it would be a gigantic save.
does anyone know of alternative apps? ive only tried the free one but the paid one only supports a handful of devices.
 

goapy

Senior Member
Dec 30, 2021
137
35
@goapy said that one of his wouldnt boot the recovery either (were both on wade) but what could the issue here be?
i know that 19.1 would probably work if i flashed it from 18.1 recovery, but if for whatever reason it tries to reboot to recovery, id be in for a hell of a time, since it would stay stuck on the android tv screen.
any chance of fixing the recovery?

I haven't tried 20220515 yet, but it seems that all of the supported devices, not just dopinder, have had problems with the 19.1 recovery while in one state or another.

@kennkanniff's problems with sabrina started with the installation of the 19.1 recovery and were resolved by flashing the 18.1 recovery.

The current builds, apart from the recovery, seem fine or even good on all of the supported devices.
 
  • Like
Reactions: kennkanniff

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Fun fact - GXL/GXM support is incoming. VIM1/VIM2/ADT-2 to start, but people should be able to use these to bring up dev boards and china boxes with nominal effort.
    3
    Just got a dopinder from Walmart and read through all 48+ pages of this thread -- thanks everyone for all your contributions.

    Before flashing the latest 19.1 LineageOS build, is there anything I should (or shouldn't) do with the device? Should I plug it in and let it update to the latest update (if one is available, depending what build it shipped with)? Or does it really not matter one way or another if I'm going to flash LineageOS?

    Just want to make sure they didn't do something screwy like lock the bootloader and/or disable unlocking, etc.

    Thanks in advance.
    Update to newest build on stock.

    Enable ADB.

    adb reboot bootloader
    fastboot oem 'setenv lock 10101000;save'
    fastboot reboot bootloader
    fastboot flashing unlock
    fastboot flash dtb lineage-dtb.img
    fastboot flash dtbo lineage-dtbo.img
    fastboot flash recovery lineage-recovery.img
    fastboot reboot-bootloader
    fastboot boot lineage-recovery.img

    Use button to select "Factory Reset", "Wipe Data", once complete, "Apply Update", "From ADB"

    Then adb side load /path/to/lineage.zip, click reboot, profit.
    2
    Still stuck at fastboot.
    i will run a build shortly and check whats going on
    2
    Thanks. Can you share u-boot.bin for M5? I used a random one I found on the internet but the image does not flash.

    to get a working u-boot.bin for the m5 do the following:

    Code:
    git clone https://github.com/Stricted/deadpool_u-boot_build ~/deadpool_u-boot_build
    cd ~/deadpool_u-boot_build
    ./build_m5.sh
    cp uboot-bins/u-boot.bin <path to android source>/device/bananapi/m5/factory
    2
    Builds still in progress by chance? Just checked and the folder still looks empty here: https://download.ods.ninja/Android/lineage/dopinder/

    I cannot thank you enough for supporting all of these devices! Greatly appreciated!
    Yup, give it 2 days. TVs last
  • 21
    lineage-os-logo.png

    Amlogic G12*/SM1 Family Devices
    Code:
    - Your warranty is now void.
    - You have been warned.
    - Use at your own risk.

    Introduction:
    This is the Unofficial Lineage OS 19.1 thread for the Amlogic G12*/SM1 SoC family of devices.

    Downloads:
    Please follow the install instructions in your device's Wiki page linked below exactly, and make sure your device's firmware matches the required firmware listed:
    • deadpool - Google ADT-3
    • dopinder - Walmart Onn UHD Box
    • sabrina - Chromecast with Google TV - Broken at the moment - working on fixing it.
    • wade - Walmart Dynalink 4K Box
    We also support a few development boards, but at least (for now, until we have time to write up instructions), you're on your own to figure out the install process and set things up:
    If you don't follow these instructions, or use 3rd party add-ons (like Magisk) please don't expect support here.

    Known Bugs:
    • SELinux is permissive, this is only due to a lack of time to put together a decent looking sepolicy for these devices.
    • (sabrina only) The remote firmware sometimes gets hung up, you can reboot to solve this issue.
    Notes:
    • GApps are baked in - No, I will not be building without GApps included for this device. These builds are built, packaged, and signed by me, and not affiliated with LineageOS whatsoever.
    • OTA is provided the same way officials would have them.
    • Firmware is shipped in the ROM package for this device, so you'll end up on the newest version of compatible firmware after install. Please don't touch firmware partitions after install.
    FAQ:
    • Does L1 Widevine DRM break when I unlock my bootloader?

      Nope, it works fine. L1 certificates, and the mechanism that reports is all still exist and work as expected.

    • Can I haz Netflix?

      Yup, but only if your devices stock build supports it.

    • Is this Android TV or Google TV?

      Android TV, with some of the better components of Google TV.

    • Can I go back to stock and relock the bootloader?

      Yeah, grab the factory image for your device and flash it just like you would for a Pixel device, you can find the factory images here. Don't know it I'd relock though, consider that process largely untested on these device. Especially on sabrina, where you can't necessarily re-unlock should you ever want to.

    • Are these the stock codenames for these devices?

      Astute observation, no, they are not. The ADT-3 is actaully `adt3`, but earlier in production is was `deadpool`, which is much cooler. The Dynalink box internally is extremely similar to the ADT-3, so we coined it `wade` after Wade Wilson, AKA deadpool. The Onn box is in the same family, but different enough to coin it `dopinder`, after, well, go watch Deadpool the movie I guess. sabrina is actually the codename given by Google - no clue as to the reason.

    • Does it pass SafetyNet?

      Nope, SELinux is permissive, among other things. You can probably use Magisk if you really need that, but the good news is, 99% of Android TV apps don't care about SafetyNet, unlike on mobile, where a lot of them do. It will likely pass after we finish enforcing SELinux, though.

    • Does the stock remote work?

      Yup, just like it would on stock, in-remote-microphone and all! If it's an IR remote like wade's, it will even work in recovery!

    • Can we we support higher resolution than 4K, higher FPS, or HDR on non-certified screens?

      Nope.

    • I have a very similar device! Can I install these builds and use them?

      No. Please don't do that. You will brick your device, as we include firmware and bootloader images.

      If you're a developer looking to help port to a new device, contact me.

    Kernel Source: https://github.com/LineageOS/android_kernel_amlogic_linux-4.9

    Contributors:
    • npjohnson
    • stricted
    • webgeek1234
    • deadman96385
    • trautamaki
    • luca020400
    • aleasto
    • bgcngm
    13
    Yeah, you used the stock recovery. You need to fastboot flash, then fastboot boot recovery, I'll update the docs.

    For dopinder, it's needed right now.

    Found a procedure for dopinder without the need for keyboard/OTG.

    The docs under "Installing a custom recovery using fastboot" state to use "adb reboot fastboot" which doesn't work for booting recovery, needed to do "adb reboot bootloader" instead.

    Full command log (after unlocking bootloader and re-enabling USB debugging) of the install process with just a regular Micro USB to USB A cable:
    Code:
    adb reboot bootloader
    fastboot flash recovery lineage-18.1-20210805-recovery-dopinder.img
    fastboot boot lineage-18.1-20210805-recovery-dopinder.img
    adb reboot sideload
    adb sideload lineage-18.1-20210805-UNOFFICIAL-dopinder.zip
    # if successful then load bootloader and factory reset
    adb reboot bootloader
    fastboot -w
    fastboot reboot

    Successfully booted to LineageOS after this!
    6
    Note:

    Since the Lineage Android TV Builds for this little box (aka Boxes), are stable for the most part, but seems
    people are bouncing back in forth from Stock to Lineage and back to stock.

    I created a batch file that will auto flash the stock images and wipe data and so on.. pretty much it will
    make your box as it was when you first booted it after taking it home to try it.

    2nd, I also created a batch file that will backup current images.. No need for a fancy recovery or anything like the
    such. it will use the worldcup or what I like to say, USB Burn mode, and backup each and every partition.
    as well as some not so much needed ones like, misc and metadata. (Just for giggles)..

    backups will be copied to backup dir, I also created a separate batch file to restore your backup.


    I am one that hates doing things the long way over and over, so I always create ways to make things simple
    in the future for people.

    This way, you all can test your hearts out all the new lineages and still have your full Stock backup (including data).
    and restore back in forth as you wish.

    I will upload the backup_restore zip package as soon as I can and with @npjohnson permission I will link
    in thread. Otherwise you will have to just DM/PM me and ill link you the location.

    I am just trying to help the many that I seen complain and dont understand how to go back in forth.
    so with this script, it should take care of most on that. No Fancy Recovery needed...

    you will need worldcup driver for Amlogic........ you can find that on your own.

    Also, to get into USB Burn mode, press side button while plugging in USB cable.
    Keep pressing till you see the LOGO or hear the sound from your computer.

    then just run the batch file and wait..

    if its easier for you:

    Run the batch file, it will keep saying waiting for device..
    Just press the side button while plugging in USB, when you see it start, then release button...........
    and wait till finished..

    Only TESTED On Dopinder Boxes, but im sure they are all the same as for the partition layouts.
    5
    I ultimately settled on 1126400000, gives ~1.1GB to the system and accommodates the app adjustments I've been making for my builds without tripping OpenGApps' space check for TV stock
    this ended up being _wayyyyy_ to much, as this is the full value of the partition vs just the space to reserve, both will work, but we want to split it amongst partitions. One of our guys recalculated it and got it working.

    Should be good to build now from breakfast/extract-files (or syncing the muppets).

    Only thing left is hardware OMX. Hopefully we can figure it out!
    4
    It's been a month and a half since we discussed the possibility of the tablet-flavored (non-TV) release. It seems that the number of complaints has decreased and the basic quality of builds has improved enough to bother you again in this regard: are there any positive changes in this direction, or it is not worth expecting to get a full-featured Android on dopinder? (I'm still following this thread carefully to make a buying decision.)
    Eh, soon, sure.

    I'll look into making a buildable target