amo13 / Anarchy-Droid

One-Click Android Rom Installation Assistant
https://anarchy-droid.com
GNU General Public License v3.0
113 stars 15 forks source link

ROM addition #9

Closed SkewedZeppelin closed 2 years ago

SkewedZeppelin commented 2 years ago

I maintain a privacy and security hardened ROM called DivestOS since 2014. https://divestos.org/

I'm happy to help with adding support for it in your tool as installation is a major painpoint I find users have. Available OTA ZIPs can be queried like so:

https://divestos.org/updater.php?base=LineageOS&device=$DEVICE-CODENAME

However due to featuring verified boot support there are also avb_key.pkmd and fastboot update compatible packages that are required for initial install on AVB devices.

If willing I'm happy to make a dedicated/stable API. Just let me know what data is needed and in what format.

amo13 commented 2 years ago

Amazing! I didn't know about this rom yet, but I'd also welcome its addition to Anarchy-Droid. There are a few others I wanted to add (Havoc, EvolutionX, Mokee, Calyx, Graphene), but I failed scraping/querying the availability for given devices. It's awesome that you directly provide the query API endpoint. And divestOS seems to support quite a few devices, great!

Unfortunately, I haven't worked with any bootloader relocking or verified boot, which I consider very advanced, with an "untechy" audience in mind. So I definitely need to dive into this a bit. If Anarchy-Droid should be able to automate all the process as far as possible, I need to know the differences from the standard installation procedure, let's say for LineageOS. A way for the application to decide if something verified-boot-related is to be done or not for a given device. A few device are listed as "Status: Broken" on the download page. So Anarchy-Droid would probably need to get that information before offering to install that rom. Same goes for "Relockable: Will Brick" or "Untested" or "Irreversible". That information would probably be nice to have in the API.

Do you happen to know some basic go? Because, to be honest, at the moment, I don't have a lot of free time to develop and I don't have devices to test the AVB stuff. If you feel like trying, you could fork the repo and play around a bit. I'd be happy to answer any questions about the code. Otherwise, I can imagine to find some time to add divestOS to the app, but it would be using the same installation procedure as LineageOS, without verified boot and bootloader relocking. (And also, note that the initial installation with bootloader unlock coming from a stock rom is only supported for Samsung, Sony, Motorola and Oneplus. For the other brands, I couldn't find an easy way to automate that in a user-friendly way.)

amo13 commented 2 years ago

Oh, and just out of curiosity, what are the "...-fastboot.zip" variants of the roms available for some devices? And how to use them?

SkewedZeppelin commented 2 years ago

Do you happen to know some basic go

I do not.

I don't have a lot of free time to develop

Totally understandable, and I don't expect anything from you (in a good way). I just wanted to put it on the table. Maybe in the future I can potentially fund-raise for the work to be done.

"...-fastboot.zip" variants

For devices that don't have an explicit /recovery partition. This is offered and is for installing the system via fastboot update ...-fastboot.zip. Specifically it contains the raw /boot, /system, and /vendor images.

For devices that do have a recovery available the recommended install is boot DivestOS recovery, and adb sideload the full update. It is also best practice to perform the adb sideload for the OTA after using the fastboot method, as the -fastboot.zip files don't currently contain firmware (as in firmware updates for modem and bootloader).

amo13 commented 2 years ago

Requesting https://divestos.org/updater.php?base=LineageOS&device=osprey in the browser works just fine, but if I request it with curl in the terminal (or with Anarchy-Droid), I simply get a Forbidden response. Are there any specific headers to set?

SkewedZeppelin commented 2 years ago

there is a basic bot check based on user agent: https://github.com/Divested-Mobile/DivestOS-Website/blob/master/sbnr/utils.php#L74

amo13 commented 2 years ago

New version released with DisvestOS added. Only installation is supported though, no bootloader relocking. The rom is installed the exact same way LineageOS would be installed. Thanks for mentioning your rom here!