HybridELEC / HybridELEC_Rebooter

Release-only repo for the HybridELEC Rebooter app used in Android+CE+EE firmware
7 stars 3 forks source link

Missing shortcut for AndroidTV #1

Open Schaka opened 2 months ago

Schaka commented 2 months ago

Since the app is missing one and I lost the source, you can just install this on your Android box and it WILL start HybridELEC Rebooter if installed too.

Feel free to add it to the repo with a little note. Rebooter_ATV.zip

7Ji commented 2 months ago

Thanks, would add this to README.

Actually I'd prefer to (re)write the rebooter and open-source it here and add the shortcut. But sadly that would not be top priority.

Schaka commented 2 months ago

Yeah, I figured. If you can tell me roughly what it requires, I may give it a shot.

I'm fairly confident in my Java/Kotlin skills, but the last time I touched Android at all was 2014, so it's been a while.

Edit: If I can find the time, I may try to decompile and see what I can restore.

7Ji commented 2 months ago

That app is not complicated. It just packs statically compiled 32-bit fw_setenv built against Debian Wheezy armhf, extracts it to exetutable place, su to run it with root permission, set bootcmd to something like restoring the envs to default then executing boot script from a certain partition (5 for CE, 6 for EE IIRC), then reboot. As the bootcmd itself would restore the envs to default next boots would go into Android, unlike official CE/EE booting logic. But if I'm rewriting this I would not carry fw_setenv and pass args anymore, I'd rather write a dedicated .c for the job.

A bonus point, whatever systems you deploy alongside Android, be it CE, EE, or CE+EE, you can always boot into the first system using their official booting logic. That is, if you booted an external CE/EE once and your booting envs are updated by them, the SD->USB->eMMC CE/EE->Android booting flow goes just like if you've installed the first system using ceemmc. In that case Android can only be entered through their GUI option. Using HE Rebooter to boot to eMMC CE/EE once and the box would be fixed back to Android booting flow.

Another bonus point, there could be no Android system at all. You can really just flash an image with only essential parts (for <S905X4 pretty much only bootloader and DTBs are needed, for >=S905X4 more box-specific AB partitions are needed). Some external helper is needed to deploy CE/EE official booting flow in this case once before eMMC CE/EE is bootable (e.g. insert CE/EE SD card and make sure they boot into system, after that their booting flow would be persistent). I don't provide hepacker building options for this case as there's no easy guess for which partitions to keep, and such image would be abused easily by box resellers, especially for EmuELEC.

7Ji commented 2 months ago

FYI I've started to write hybrid_android_helper, a single binary to encapsule all root operations. The future rewrite of Rebooter should only need to extract it and run it with simple arguments.

Schaka commented 2 months ago

Thanks. I haven't had a chance to look into it yet. I'll try over the weekend if possible.