by tranq_cassowary · 1mo ago · 0 comments
> It won’t be an easy task, because each time Google releases a new version of AOSP, these volunteers will have to rip out the anti-user features in the latest version and replace that code with user-empowerment features. Because Google makes substantial changes to Android every year, the user-empowerment code will likely need to be refactored every year to work in each new AOSP release.
Would be nice if you would be able to give examples of those anti-user features and examples of desired user-empowerment features. New Android versions and SDK levels often bring security and privacy improvements. The permission model has evolved a lot over time and has only evolved to give the user more control over their applications.
> Google is actively rewriting its Android code in Rust to eliminate memory safety vulnerabilities and speed up its software development.
Sounds amazing. What is the issue with this? Do they need to go slow on making the system more secure in order to make it easier for external contributors? Do you think that it would be a net-positive to deliberately slow down taking up Rust?
> The important point is that Phosh is already a very solid interface and the tweaks that it needs are minor compared to the significant dev work that AOSP will require to make it an operating system that respects and empowers users. Even in the case of Plasma Mobile, the dev work that it requires is far less than AOSP would require. The work to improve the Phosh and Plasma Mobile interfaces is a one-time cost, whereas the code churn in AOSP will make it a constant struggle to keep reapplying changes with each new version that gets released by Google.
AOSP respects and empowers users much more than traditional Linux due to the proper security and privacy model, as I mentioned before. Trying to add something similar to Linux would be a very resource-heavy task and will break compatibility with a lot of apps because those are written with the expectation of having wide access to your system. So, you would also have to rewrite those apps, which would make it even more resource-heavy.
> As more and more Android apps become incompatible with the community’s AOSP fork, fewer people will be willing to use it.
If this hypothetical scenario that you've been painting in your blog post would happen then it's likely that the large FOSS ecosystem of Android apps will target the community AOSP fork instead of the hypothetical closed source Google Android. There are lot of FOSS Android apps, which can compete with the traditional Linux app ecosystem and even outcompete it for various app categories.
> Linux users are less likely to install rogue apps, because they can’t just find any random Linux software package on the internet and install it, like they can with random APK files found on the internet.
Many people use the AUR. An app being available in a package manager or on FlatHub doesn't mean it's well written or well maintained. And, nobody forces you to grab APKs from random sources, you can stick to reputable app stores or to the official websites and repositories of developers you decide to trust.
> However, Linux phones will need to be able to install Android apps if they are going to appeal to the mass market.
This seems to undermine most of the point you are trying to make.
> Even when those Android apps are run inside an LXC container, mobile Linux still needs to be prepared for all the malware and spyware that comes with running Android apps.
Doesn't make sense to want to use a more secure and private OS as a guest on a less private and secure host. It should be the reverse. LXC containers also aren't proper isolation like a VM.
You can perfectly run malware and spyware on desktop Linux, nothing is preventing you technically from doing so. On Android, contrary to desktop Linux, the system will prevent those apps from having invasive access to your system and user data, because of the permission model. On Linux, malicious software has more invasive access and can more easily escalate to even higher levels of access.
> However, adding good userspace security to mobile Linux won’t be nearly as much work as adding user empowerment features to AOSP. It will be difficult to convince long-time Linux users to accept application sandboxing with separate users and separate file encryption for each app, and it will probably require some experimentation to get the right balance between security and freedom. Nonetheless, it is wrongheaded to treat the dev work for better security in mobile Linux as an insurmountable task.
It's not wrongheaded. It will break a lot of software. It will ask a lot of time. Time which is reinventing the wheel because Android exists. And it will get a lot of counter from a desktop Linux culture which seems to care little about security and mostly cares about being able to modify as much things as possible to the extent of even being able to break stuff, because 'freedom'.
> It is important to recognize, however, that many Linux phones either come with AOSP preinstalled or have it installed by their users in order to run Android apps. Almost every mobile Linux distro provides instructions and packages to install Waydroid and microG. Jolla’s license for Sailfish OS includes its proprietary AppSupport. FuriLabs’ FLX1/s/s+ includes Andromeda, which is its fork of Waydroid. All of these solutions run AOSP inside an LXC container. In addition, Valve just open sourced Lepton, which runs Android games as a non-root user in an AOSP container, but it doesn’t include Google Play Services or microG.
Those Android subsystems are almost always heavily outdated and have their security degraded. To give two examples: Waydroid doesn't use SELinux so doesn't have proper application sandboxing anymore and Sailfish OS is at Android 13, while we are currently on Android 17.
> Many of Google’s proprietary Play Services have been replicated by the free/open source microG, which uses signature spoofing to make Android apps believe that Google Play Services are installed. Nonetheless, microG doesn’t always work correctly in some situations, such as Google Maps’ geofencing, in-app billing, AR, SafetyNet/Play Integrity attestation, reCAPTCHA, PackageInfo.signingInfo, etc. Some apps fail security checks in Waydroid, because it appears to be a rooted Android device.
A solution like sandboxed Google Play used by GrapheneOS doesn't have most of the issues MicroG has. It's unaltered Google Play forced into the regular app sandbox. The only thing that really doesn't work with it are apps enforcing strong Play Integrity, which is an anti-trust issue that hopefully will be resolved in the future by regulators.
> Presumably Jolla’s AppSupport has been receiving AOSP upgrades, but Waydroid needs to be better supported in the future if Linux phones are going to rely on it to run Android apps.
Their official site says they reached Android 13, we are currently on Android 17.
> Instead of wasting resources on trying to fork AOSP, we should instead be focusing on how to better support Waydroid and microG for people who need to run Android apps.
Makes little sense to focus resources on the options to run Android apps insecurely. Better would be to donate resources or contributions to GrapheneOS and the GMSCompat project of GrapheneOS which enables running Google Play into the regular app sandbox.
> People often argue that using AOSP will provide access to more software, but that is not necessarily true if the goal is to only use free/open source software (FOSS). Google deliberately obscures the licensing of an app’s code from users by labeling both freeware and FOSS as “free” in its Play Store. There may be more total FOSS among those two million apps in the Play Store than in the Linux repositories, but selecting out the FOSS apps, vetting their code and organizing those apps into a separate repository will not be an easy task.
Vetting apps is an ongoing and imperfect task on desktop Linux as well. The Accrescent app store which is currently in development for Android will in the future offer a filter option to filter actual FOSS apps from proprietary apps. Labelling apps properly really isn't impossible.
> In contrast, Google is constantly changing the standards for its apps and forcing app creators to constantly update their code to keep their apps in the Play Store.
This is also due to the introduction of new privacy and security features that are part of newer SDK levels. That's part of the user empowerment you wanted to see. If Linux would add user-friendly security and privacy features that are mandatory, a lot of apps would also need updating.
> None of this is to suggest that AOSP is necessarily bad or that people currently using AOSP phones should abandon them. AOSP derivatives like LineageOS, crDroid, Evolution X, /e/OS and GrapheneOS provide an invaluable service to people seeking privacy and greater software freedom, plus the ability to extend the lifespan of their phones.
I don't know anything about crDroid and Evolution X, but LineageOS and /e/OS in particular really don't offer people privacy. See the great blog posts from Mike Kuketz which you can translate to your own language about custom OSes and their privacy and security: https://www.kuketz-blog.de/android-grapheneos-calyxos-und-co... . Also, see the comparison of Android OSes by Eylenberg for notable security and privacy differences: https://eylenburg.github.io/android_comparison.htm .
The claim that custom OSes expand the lifespan of phones is often misleading. They need manufacturer support to ship driver and firmware updates and those are necessary to have a properly secured phone. You can't un-EOL a phone by putting a custom OS on it.
> If our goal is the empowerment and greater freedom of people, mobile Linux appears to be a more feasible route to achieve those goals in the long term than AOSP.
There is little empowerment if you can't really decide what you give apps access to.
Off the top of my head, here are some of the anti-user features in AOSP/Android that I would change:
* Remote attestation. If someone wants this, they can turn it one, but the OS and apps shouldn't be able to impose this requirement on the user.
* Making it hard for people to root their phones. I can understand having root access turned off by default, but it should be an easy and documented process to turn on root access on your phone, but it should also require setting a root password, which the user has to enter when doing an administrative action in the system. After rooting the phone, the GUI will ask for the root password when doing certain administrative tasks and the terminal will ask for it when using `su`. However, I would enable non-root users to access more than they currently can (see below).
* Apps should not be able to decide that they won't execute based on rooted status, Play Integrity checks, SELinux enforcing, bootloader unlocked status, etc. It should be up to the user, not the app creator, whether an app is allowed to execute. The OS should inform the user about potential security problems, but not encourage app creators to put these restrictions on their apps. I realize, however, that an AOSP fork wouldn't have the power to stop app creators from doing this stuff, so I would include a clean Android work profile and make it so those problematic apps can't detect what has been done to the rest of the system.
* The Activity Manager (`am` command) needs to be designed or eliminated to stop restricting the user. It is very annoying that users can't just execute graphical apps from the terminal like in Linux, and the way `am` does it is designed to make users not use a terminal. Instead of `am start -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -a android.intent.action.VIEW -d file:////storage/emulated/0/VideoToPlay.mp4`, it should just be `vlc ~/VideoToPlay.mp4` like in normal Linux. Forcing apps to name the activity with the `-a` option, and to pass their parameters with the `-d` and `-es` options is designed to stop users from using options. Most Android apps have no command line options because Android makes it so painful to use them, and that is by design. Why does Android force users to refer to apps by reverse domain name order like "org.videolan.vlc" which is impossible to remember and so hard to type? Using the full reverse domain name for an app should only be necessary if there are two apps with the same name, and it should be possible to create an alias for apps so they can have short names. If a user (i.e. the person using the phone) initiates an app, then that person should be able to kill the app from the command line with a short command like `pkill app-name`. Currently, AOSP only allows `am force-stop com.example.myapp` if the phone has been rooted or if issuing through ADB (`adb shell am force-stop com.example.myapp`), which is an anti-user restriction that needs to be eliminated. I wouldn't require the `am` command at all for starting and stopping apps, but if AOSP/Android is going to use the `am` command, make everything easy to type and very short. It should be possible to set variables when executing apps just like in normal Linux (e.g. `MY_VAR=value myapp`) Instead, AOSP forces people to either root their phone or use adb, just to set variables when executing an app: `adb shell setprop wrap.com.example.myapp "env MY_VAR=value"`
* AOSP requires a rooted device or adb in order to use many commands, including `setprop`, the package manager (`pm`), most networking commands (`ip`, `ss`, `netstat`, etc.), use of wrap.com.example.appname or debug.com.example.appname, etc. It is really annoying that you have to root the device just to see the list of the installed packages with `pm list packages`, see the current battery state with `dumpsys battery` or even see the IP address with `ip a`.
* AOSP requires a rooted device or adb in order to view most of the directory structure on the device. In standard Linux, an ordinary user gets read-only access to `/`, `/dev`, `/sys`, etc., which makes it much easier to figure out how the system works and diagnose problems, but the device is basically a black box for the ordinary android user. I can understand forcing normal apps to access the hardware through the Android HAL and not be able to read the / directory, but terminal apps should have permissions, so the normal user can have read-only access to `/`, `/dev`, `/sys`, etc. Forcing users to execute some custom command like `termux-setup-storage` just to get permission to access the microSD card is bizarre and another anti-user feature.
* Forcing users to create an app just to execute a custom script from the launcher is another anti-user feature. Let’s say that you want tapping on an icon on your screen in order to run a custom script. In a standard Linux system, you just create the script, and then you add a launcher in the graphical interface to execute it or you add a `.desktop file` to the `~/.local/share/applications` to add it to the graphical interface. In AOSP/Android, you need to create your own app in Android Studio that has a `AndroidManifest.xml` file with this code: ``` <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> ``` And you need to have application code that has Java or Kotlin code like this: `Runtime.getRuntime().exec("/storage/emulated/0/your_script")` Then you need to create the apk file and sign it and install it. There are workarounds, like installing Termux and Termux:Widget, but those workarounds shouldn't be necessary. AOSP should make it as easy as standard Linux.
* The way permissions work in AOSP/Android is simply a hassle and requires too much cognitive load for the average user. When you first install a new app, you have no idea how the app works or what permissions it really needs. There are 324 different permissions in Android 17, and it is overwhelming for most people to install a messaging app and be asked for a dozen different permissions, such as Notifications, Identity, Contacts, SMS, Phone, Photos/Media, Storage, Camera, Microphone, Wi-Fi, Calendar and Location, which is why so many users simply grant all the permissions that are requested, so the permission system doesn't really work as intended.
It would be much better for the distro package manager to configure the app to grant just the permissions that most users of the distro would want, and then let the user set the permissions that she always wants to be asked about, but not be bothered with the rest. For example, Calendar and Location shouldn't be necessary for most users of a messaging app, so they wouldn't be granted by default, and the OS would ask for those permissions if the user tries to use a feature that requires those permissions. In a distro focused on security, the defaults would be different from a normal distro. The list of permissions granted by default should be shown to the user when installing, and users who want to pick and choose can open a dialog box to select the permissions. They can also set the permissions across all apps that they want to be asked about.
In my opinion, the user should only be asked about each permission only if an app comes from outside the default repository. Of course, this assumes that the default repository is only contains open source code, and the package manager is separate from the app creator and is reviewing the code in the interest of the AOSP distro's users.
* Each app has a different user assigned to it by AOSP/Android, and you can't change the name of that user, which is very inconvenient, because AOSP/Android creates random usernames that are very hard to remember. For example, every time I want to ssh to my AOSP phone, I have to open Termux and use the `whoami` command, because I can never remember that my Termux user is named u0_a281.