• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

Search This thread

rczrider

Senior Member
May 20, 2015
693
522
Markarth
I still don't have the device to test this my own and very wonder if the Magisk root is preserved during OTA like in the good old days before Android 8.0, or if we want to enjoy the benefits of root, we must be prepared to patch the boot.img manually with every OS update? Has anyone checked?

Are you referring to OTA for LineageOS or OTA for stock (after bootloader unlock and root with Magisk)?

Another user answered for the former, so I'll answer for the latter (for dopinder, the ONN device): yes, with each OTA you will need to re-root with Magisk. This can be done either by flashing the Magisk APK (replace the .apk extension with .zip) by booting (not flashing) Lineage recovery (and requires a micro USB OTG Y cable so you can use a keyboard, as the hardware button won't work), or by extracting boot.img from the factory image zip and patching using Magisk once booted.

AFAIK, the second way doesn't really work right now because (again, AFAIK) no one has captured the OTA file for boot.img to be extracted. You can't set up a new ONN device without completing the setup wizard, which downloads the OTA before completion. Since you can't enable USB debugging (for doing a logcat and capturing the OTA URL) until after setup completes, it would take someone whose device is setup, has not received the OTA, and can do a logcat while the device updates in order to grab the OTA.

That leaves us with the first option of using a micro USB OTG Y-cable and Lineage recovery.

Something I don't know (which perhaps @npjohnson can comment on) is whether a stock OTA can re-lock the bootloader and and either brick the device (due to modifications that were done using root) or at the very least prevent us from unlocking again.
 

Big Dumb Object

Senior Member
May 22, 2020
50
20
Are you referring to OTA for LineageOS or OTA for stock (after bootloader unlock and root with Magisk)?
The first one.
Any LineageOS ROM will have it
Correct me if I'm wrong, but all modern devices with A-only and A/B partition scheme tend to rewrite the volumes that are essential to preserving Magisk during OTA. My Xiaomi Mix 2S (polaris) acts exactly that way, and it is very annoying. Here is a note in the official Magisk guide: https://topjohnwu.github.io/Magisk/ota.html
 

JoshuaDoes

Senior Member
The first one.

Correct me if I'm wrong, but all modern devices with A-only and A/B partition scheme tend to rewrite the volumes that are essential to preserving Magisk during OTA. My Xiaomi Mix 2S (polaris) acts exactly that way, and it is very annoying. Here is a note in the official Magisk guide: https://topjohnwu.github.io/Magisk/ota.html
You're right, but that's the purpose of the init.d extension. When Magisk patches a boot image and detects init.d support, it installs its init.d script and magiskboot to the boot image's ramdisk so that access to /data isn't needed to repatch after the OTA. And because Lineage Recovery also has init.d support, it knows to copy out the init.d scripts before replacing the boot image with the new unpatched one.
 

Big Dumb Object

Senior Member
May 22, 2020
50
20
You're right, but that's the purpose of the init.d extension. When Magisk patches a boot image and detects init.d support, it installs its init.d script and magiskboot to the boot image's ramdisk so that access to /data isn't needed to repatch after the OTA. And because Lineage Recovery also has init.d support, it knows to copy out the init.d scripts before replacing the boot image with the new unpatched one.
This is strange and contradicts my own experience, since I only found out about this issue because my polaris (A-only device), which has been running solely on official LineageOS or LOS for MicroG since the first day, inevitably removes root after OTA, while the presence of init.d support is confirmed by AFWall+ firewall app.

So, if anyone has any real success updating the flashed dopinder/sabrina/wade with Magisk — that would be the best answer to my query.
 

JoshuaDoes

Senior Member
This is strange and contradicts my own experience, since I only found out about this issue because my polaris (A-only device), which has been running solely on official LineageOS or LOS for MicroG since the first day, inevitably removes root after OTA, while the presence of init.d support is confirmed by AFWall+ firewall app.

So, if anyone has any real success updating the flashed dopinder/sabrina/wade with Magisk — that would be the best answer to my query.
I can't say why that's the case for you, but it should be working on those devices and sounds more like a bug. Regardless, I forgot to directly state it but it does successfully repatch the boot image with Magisk when I run an OTA on my dopinder box (one of the first things I tested when I bought it), both with np's builds as well as my own local builds.
 
  • Like
Reactions: Big Dumb Object

Big Dumb Object

Senior Member
May 22, 2020
50
20
it does successfully repatch the boot image with Magisk when I run an OTA on my dopinder box (one of the first things I tested when I bought it), both with np's builds as well as my own local builds.
Thank you! It seems like a fairly unproblematic device. Can't wait for the work to be finished so I can make the purchase with confidence (want to buy a batch of dopinders at once for all my home screens).
 
  • Like
Reactions: JoshuaDoes

npjohnson

Recognized Developer
So, per device it's different:

deadpool/dopinder/wade: you can't update while you're rooted or have any sort of modification to system, it breaks. Breaks AVB, now. If you just have a magisk patched boot image, that should be fine I think, Magisk has OTA handling.

Sabrina: Don't update anything ever, this device will re-lock itself and probably brick itself if you do, once the exploit is run, you're unlocked and should leave it. As such, you can flash back to stock like the thread details, but beyond that, which will mean you can never unlock again, don't do anything like that.
 

rczrider

Senior Member
May 20, 2015
693
522
Markarth
deadpool/dopinder/wade: you can't update while you're rooted or have any sort of modification to system, it breaks. Breaks AVB, now. If you just have a magisk patched boot image, that should be fine I think, Magisk has OTA handling.
Is this in reference to LineageOS or stock? I assume the former ("breaks AVB") refers to LineageOS, while the latter ("Magisk patched boot image") refers to stock?

Unrelated: thank you for being so active in this thread, and for all the work you and others do to bring LineageOS to those who mostly just ask dumb questions or complain :p
 

npjohnson

Recognized Developer
Is this in reference to LineageOS or stock? I assume the former ("breaks AVB") refers to LineageOS, while the latter ("Magisk patched boot image") refers to stock?

Unrelated: thank you for being so active in this thread, and for all the work you and others do to bring LineageOS to those who mostly just ask dumb questions or complain :p
All of that was in reference to stock.

Lineage can be safely updated after pretty much any modification as it flashes a full OTA, and disables AVB. Will persist magisk through OTAs
 

lessslanted

New member
Nov 28, 2021
1
4
In case this helps anyone, this is how I've been getting USB debugging on without a google account and without updates.

Turn device on...
-connect remote control
-select language
-skip phone setup
-hit settings key on remote "cog-wheel"
-go to "apps" > "see all apps"
-select "update" and force stop
-select "show system apps"
-select "dynamic system updates" and force stop
-select and disable (or force stop):
*(it probably doesn't need to be all of these but I got sick and tired of narrowing it down)
google
google one time init
google partner setup
google play services
google services framework
market feedback agent
second screen setup auth bridge
settings suggestions
setup wizard (force stop)
setupcustomizer

-back out, back out, back out, until...
-setup remote again
-select language again

!!! - Pay attention directly after the next step. If you see anything other than "successfully connected to internet" then you missed something and it's going to download the update - hit settings button and wifi off

-sign in to network (It should say "checking connection" "successfully connected to internet")
-as soon as you see the screen with a black background and "updating apps" message
-hit settings button on remote
-turn off WiFi

Now developer options can be enabled and USB debugging turned on.
 

npjohnson

Recognized Developer
This might be off topic but does anyone know if it’s possible to get the Fire Stick remote microphone to work with any of the listed Android TVs. All the buttons work, but the microphone doesn’t detect any voice or sound
Nope - proprietary software receiver app/Audio HAL tie-ins.
In case this helps anyone, this is how I've been getting USB debugging on without a google account and without updates.

Turn device on...
-connect remote control
-select language
-skip phone setup
-hit settings key on remote "cog-wheel"
-go to "apps" > "see all apps"
-select "update" and force stop
-select "show system apps"
-select "dynamic system updates" and force stop
-select and disable (or force stop):
*(it probably doesn't need to be all of these but I got sick and tired of narrowing it down)
google
google one time init
google partner setup
google play services
google services framework
market feedback agent
second screen setup auth bridge
settings suggestions
setup wizard (force stop)
setupcustomizer

-back out, back out, back out, until...
-setup remote again
-select language again

!!! - Pay attention directly after the next step. If you see anything other than "successfully connected to internet" then you missed something and it's going to download the update - hit settings button and wifi off

-sign in to network (It should say "checking connection" "successfully connected to internet")
-as soon as you see the screen with a black background and "updating apps" message
-hit settings button on remote
-turn off WiFi

Now developer options can be enabled and USB debugging turned on.
Don't do this... You want the update. On dopinder/wade/deadpool you should absolutely take the OTA it recommends before starting.
 
  • Like
Reactions: seriousneo

ferbulous

Senior Member
May 12, 2012
254
22
Hi guys, I'm using walmart onn 4k with sony receiver.
I can use the onn remote to control the receiver volume but it failed to power on/off the receiver (tried all 9 attempts but none worked during power setup)
I had no problems to control both volume/power with my firetv stick 4k.

Is there a way I can configure the remote to learn IR for the power control?
 

UnionBlvd

Senior Member
Aug 12, 2012
89
22
Don't do this... You want the update. On dopinder/wade/deadpool you should absolutely take the OTA it recommends before starting.
Not on wade, at least not anymore. As someone else mentioned, the latest Dynalink update disables unlocking, and even after using the recovery tool to flash the older factory ROM I could no longer unlock mine.
 

npjohnson

Recognized Developer
Not on wade, at least not anymore. As someone else mentioned, the latest Dynalink update disables unlocking, and even after using the recovery tool to flash the older factory ROM I could no longer unlock mine.
I'm really doubtful here.

Especially considering you don't even need to toggle the switch, and you can always use brin mode to unlock by hand... I just really don't believe that.
 

Big Dumb Object

Senior Member
May 22, 2020
50
20
Not on wade, at least not anymore. As someone else mentioned, the latest Dynalink update disables unlocking, and even after using the recovery tool to flash the older factory ROM I could no longer unlock mine.
It's alarming! If the Walmart has declared war on this thread, we may soon be left with no cheap options for purchase. Can you clarify the release date of the nasty update? Apparently, all Dynalinks (and possibly Onns) manufactured later that date can be left in the store with calm. (But confirmation still needed.)
 

UnionBlvd

Senior Member
Aug 12, 2012
89
22
It's alarming! If the Walmart has declared war on this thread, we may soon be left with no cheap options for purchase. Can you clarify the release date of the nasty update? Apparently, all Dynalinks (and possibly Onns) manufactured later that date can be left in the store with calm. (But confirmation still needed.)
I think the update was released in late Sep, I just got it last week after returning my Dynalink to stock. I had flashed a self-built Lineage image and the device wouldn't boot, flashing it back to stock was the only thing that got it going again.
 
  • Like
Reactions: Big Dumb Object

npjohnson

Recognized Developer
I think the update was released in late Sep, I just got it last week after returning my Dynalink to stock. I had flashed a self-built Lineage image and the device wouldn't boot, flashing it back to stock was the only thing that got it going again
Okay, so if you can flash things, the bootloader is already unlocked, and as I suspected, that's not the worry.

Self built lineage wouldn't boot until about a month ago, as selinux policy wasn't done.
 

Top Liked Posts

  • 3
    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.
    1
    I would like to try the script/mod for my own curiosity. I am an intermediate adb-fastboot user. But it will be a great learning experience.

    Are you going to create a thread to maintain this mod or post it on Github?

    Thanks... 👍
    its not really a mod. its just a helper script for the devices listed in thread..
    In other words, you download the stock rom that the OP displays link too.
    and unzip it, and add the contents to stock_image directory

    then run restore_stock_askey_adt3.bat and wait.. it will do everything needed to get your box back to stock, as if you just bought it and took it home.


    Another good thing about this, using USB Burn Mode, you pretty much cant brick your device and if you do, you can still restore it. As long as you dont completely flash some messed up bootloader from another device or something.. you can restore it with no problem.. pretty much zero chance of bricking..
  • 3
    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.
    1
    I used USB Burning mode to flash the images with Amlogic Updater tool..
    just couldnt get dtb to flash only dtb0............ But still it reset it and flashed..

    but yes new firmware stops everything from working.........

    If you were able to restore the factory firmware using usb mode, then the bootloader shouldn't be locked.

    I found a version of the Amlogic USB update tool (update.exe) and was able to recover my device to the 20210326 factory firmware. The bootloader is still unlocked, so all is good with this device. I don't know why I had trouble the first time.
    1
    Could it be that you found a clue for OMX problem?
    I have a few ideas to try once home from holidays.

    I'm hoping 12 just fixes it, but I bricked my Deadpool hard. So. Limited atm. Lol
    1
    please tell me if there is support afr for onn. box?
    afr?

    Adaptive framerate? No. It doesn't have android 12, nor support it yet.
    1
    I would like to try the script/mod for my own curiosity. I am an intermediate adb-fastboot user. But it will be a great learning experience.

    Are you going to create a thread to maintain this mod or post it on Github?

    Thanks... 👍
    its not really a mod. its just a helper script for the devices listed in thread..
    In other words, you download the stock rom that the OP displays link too.
    and unzip it, and add the contents to stock_image directory

    then run restore_stock_askey_adt3.bat and wait.. it will do everything needed to get your box back to stock, as if you just bought it and took it home.


    Another good thing about this, using USB Burn Mode, you pretty much cant brick your device and if you do, you can still restore it. As long as you dont completely flash some messed up bootloader from another device or something.. you can restore it with no problem.. pretty much zero chance of bricking..
  • 17
    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 18.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:
    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:
    • Hardware backed OMX - Therefore, by proxy, L1 DRM is broken, we're currently trying to fix it, but it's proving tough to figure out. Software OMX fallback is in use for now, though, and works fine on almost all non-DRM videos.
    • SELinux is permissive, this is only due to a lack of time to put together a decent looking sepolicy for the devices,
    • (wade/dopinder only) Side-button doesn't work - On wade, you can use the IR remote to navigate recovery, on dopinder, you'll need an OTG adapter, and a keyboard or controller to attach.
    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, or at least, it will once we fix hardware backed OMX. L1 certificates, and the mechanism that reports is all still exist and work as expected.

    • Can I haz Netflix?

      Not the Android TV one, not until we fix hardware backed OMX, at least - after that it should work fine. For now, you can go sideload the tablet Netflix, it works fine!

    • 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.

    • 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
    10
    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!
    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
    sabrina support is live, enjoy.
    4
    This is is exactly what I've been waating to do just didn't want to go through the tedious parrt of figuring out the keymap remapping scheme . Could you share your changes or point me in the right direction? Also can I get some clarification on DRM is it working or not working ? The OP is a little confusing. If I understand correctly it is not working but only because od broken HW omx not bootloader unlock so it's just a bug not a limitation. Or is that incorrect? (I'll help with development btw, synced tree last night . Gonna dive in tonight)
    Netflix and Amazon Prime 4k work with Magisk on stock, safetynet ctsProfile does fail but looks like it doesn't matter like OP said.

    For remap I placed the attached folder in /data/adb/modules