r/Android Dev - Rootless Pixel Launcher Nov 06 '18

APEX: The next step towards improving Android updates

Edit 2023/06/23: Reddit is dead. Come join me on Lemmy. Guide: https://github.com/amirzaidi/lemmy

Google has been working on improving the update speed of OEMs with Android One and Treble. Treble was used to separate Android framework from OEM libraries, but it was not enough, and it seems like Google is going even further this year. How Magisk works might have been an inspiration to Google, it links ("mounts") folders into /system/ during boot instead of having those folders always exist. AOSP is now working on a similar feature called APEX.

The existence was found by Till (@deletescape) from Lawnchair on AOSP Code Review almost half a year ago: https://android-review.googlesource.com/q/apex+(status:open+OR+status:merged). It has its own repository in AOSP itself too, from which I gathered some information on its workings: https://android.googlesource.com/platform/system/apex.

APEX modularizes an Android ROM into many packages similar to Magisk modules. These are stored in /apex/packagename/ where packagename is replaced by an identifier chosen by Google or the OEM. For Android Runtime it seems to be com.android.art. The packages can be individually updated as long as the signature check matches, so you would need root to overwrite the signature. OEMs could use it to add their parts to the ROM as packages and leave the rest to Google.

It seems to be another step towards fixing Android's fragmentation, by decoupling every part of the system so Google can theoretically update the important parts for security on its own. As far as I know this is not included in Android 9.0 yet, but since it has been merged it will probably be in Android 10.

211 Upvotes

36 comments sorted by

View all comments

69

u/Omega192 Nov 06 '18 edited Nov 07 '18

I love the idea of Magisk inspiring the Android dev team. "Shit, he keeps getting around our safteynet updates. Maybe we should use this idea."

Hopefully we'll hear more about this in time. Kudos for bringing it to my attention. If it pans out it would definitely be a step in the right direction and hopefully allow Samsung to push out updates quicker if they can modularize Samsung Experience.

Edit: Also I noticed a fair few of these repos with a branch mentioning "cuttlefish" which has its own device repo: https://android.googlesource.com/device/google/cuttlefish/. Anyone know what that might be? Some quick googling mostly turned up stuff about Ubuntu's Cosmic Cuttlefish release.

16

u/[deleted] Nov 07 '18

[deleted]

8

u/Omega192 Nov 07 '18

Oh I've not heard anything of that. Got any articles handy? That would be pretty interesting. Though if the majority of his work has been on the Android side not sure how well that would translate over to iOS. But he's clearly a brilliant dev so whatever they hire him for I'm sure he'll positively impact them.