A list of all Android permissions
gist.github.com
gist.github.com
Oh how what a mess the intro of this one was.
Over night Android went from a potential production platform to a straight media consumption platform, as now only system apps could write to removable storage.
This is why I absolutely won't consider any Android devices in future. The hardware's been admirable, particularly with a folio-style case and bluetooth keyboard. Great battery life. The display is limited, but the best as can be hoped for.
But the limitations on what I as a user can do drive me bloody bananas.
It's a very short drive, and an entirely uninteresting challenge.
Google, Samsung, and Logitech specifically have fucked this up hard and irretrievably.
This is not a hostile limitation - it's a backwards-incompatible API change that the ecosystem hasn't fully adapted to.
A laptop running Linux. The mobile world isn't ready for non-trivial use. May never be, though I'm watching Ubuntu's progress.
It's just two different use cases and different security/freedom tradeoffs. Not sure if I'd call Android a general purpose operating system.
As you point out, the benefit of Android was never quite taken advantage of.
However, Google's upcoming Android laptops will hopefully push the issue to the fore. It would be amazing to have a more powerful alternative to iOS on the iPad Pro, more powerful in ways we notice everyday, rather than just being more powerful on paper.
If we observe Windows tablets, with the MS Surface at the forefront, many of them come with a easily accessible USB-A port (I recall Gigabyte tried to sell a tablet that came complete with a ethernet port even, but i think that series has since been discontinued).
What worries me is that Google introduced this change to placate big media. Because around the same time they made the big announcement that people could now buy movies and music via the Android Marketplace (later renamed Google Play).
So the tiny, fiddly ports are more robust.
You can access your media if you use a file explorer and media player which support the new API.
> If we observe Windows tablets, with the MS Surface at the forefront, many of them come with a easily accessible USB-A port
And all of the applications running on it can access all of your media. Life is easy when there's only one single flat security domain.
But the bigger point is that I don't think it's just the USB port that limited Android's flexibility. Android was supposed to be a more flexible, more powerful iOS. That didn't play out in ways the average end user cares about.
And that was its big issue. They used the firmware model for a general purpose OS. This keeps Android from having the simple install models we've come to expect with Windows/some Linux distros/MacOS. I wrote a thing on this a while back:
BTW, event thought Chromebooks gets updates all the time the kernel and drivers are the same one as when they originally shipped. This means that older Chromebooks will not be able to run Android apps, as it is done using kernel provided containerization.
https://www.chromium.org/chromium-os/chromiumos-design-docs/...
If you can unlock your bootloader, you can build your own version of chromeos and the kernel, but trust me, it's not as good. You'll have a chromium-based OS, not chrome based-- it's a lot like the difference between Chromium vs. Chrome in Linux, only affecting the whole OS.
I haven't done it in a few years, but I imagine that with the Android integration, even if it builds, you'll have more of a stock AOSP experience sans any Google cloud features. Good for freedom and privacy, but if you're bothering to replace the OS like that actual Linux may be a better call.
But if you go for standard Linux, you may run into issues with hardware support, especially graphics acceleration... just sayin'. The closed-source graphics drivers written for ChromeOS may not play friendly with Xorg or whatever.
Aside from potential issues w such blobs, I don't see any reason you couldn't unlock the bootloader and try updating your own kernel...
I didn't realize ChromOS was in the same boat. That's really shit. In traditional Linux, a lot of drivers get merged right into the tree. Even for proprietary drivers/blobs, we have linux-firmware. For the most part, the initrd files on Arch/Debian/Ubuntu can load a lot of modern hardware.
I wish Google Android/Chrome devs would get their shit together and stop this individual build madness. An initrd full of drivers and linux-firmware do not take up that much space, and many phones now have the footprint of tiny laptops vs the old <8GB tiny flash roms.
Google wields a heavy hand with their (no-so-)open handset alliance (OHA). They can get manufactures to at least commit their blobs to a standard google-firmware package and keep a fork of their Kernel that builds all major drivers into a standard initrd package. Manufactures could always strip out all the crap for their custom ROMS, but this would allow AOSP to just run, out of the box, like Windows 10 or Ubuntu, on a large chunk of hardware.
Google's decisions in Android structure feel asinine.
localhost / # uname -a
Linux localhost 3.8.11 #1 SMP Mon Sep 26 02:48:53 PDT 2016 armv7l ARMv7 Processor rev 4 (v7l)
SAMSUNG EXYNOS5 (Flattened Device Tree) GNU/Linux
Recently built kernel. Unless things have changed from a few years back (when I last played with it), there are multiple (3) kernel partitions in ChromeOS:https://www.chromium.org/chromium-os/chromiumos-design-docs/...
...and you can manually select between them by using the "cgpt" command from the shell:
So on an ARM device, you could say:
sudo cgpt add -i 6 -P 5 -S 1 /dev/mmcblk0
If I'm not mistaken, this would mean to set partition 6 (a kernel) with a priority of 5 (compared to other partitions at boot), successful flag set to 1 on mmc block device 0-- (the internal mmc, where mmcblk1 is the external sdcard). I think if that kernel fails, that flips the successful flag to 0 and it falls back to the next priority kernel on the reboot. But like I said, it's been a while so don't quote me.See more here: https://www.chromium.org/chromium-os/chromiumos-design-docs/...
Also, if you weren't aware, to get into the shell:
ctrl-alt-T
shell
sudo bash
cgpt --help
if you play with cgpt, be VERY careful. Also, if you're thinking of replacing kernels or whatnot, be aware that on most (all?) devices, the partitions are signed, so you'll have to turn off any checks first.http://developer.android.com/guide/topics/providers/document...
They also made a video explaining how it works:
https://www.youtube.com/watch?v=C28pvd2plBA
Info about scoped directory access in Android 7.0:
https://developer.android.com/training/articles/scoped-direc...
Incidentally I didn't see READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE in the list.
Thing is that SAF only arrived with 4.4, and didn't properly handle anything more than single file access until 5.0. The the write_media_storage permission was introduced in 3.1. Thats some 5 releases and 2 years of goofing around before they sorted their own mess.
Oh and the external_storage permissions where there initially, but they seem to have edited it since in an effort to clear out some non-Android stuff.
Your camera app used to be able to access your WhatsApp backup folder and your documents. It was just a flat file system. Developers would request the permission even though all they needed was a caching folder or something, but they could read and upload all of your documents, too.
This change, while breaking a bunch of applications until they migrate to the new fine-grained API, was a necessary one.
(many storage media are formatted using FAT, so the media API is probably not implemented using Unix permissions)
As for FAT, I said in another comment that Google has already imposed MTP on us and Android's adoptable storage uses ext4 anyway, so they could easily require it on all removable storage where application data is stored.
Removable storage, SD, USB, etc, was moved from external_storage to media_storage with Android 3.1.
Note that external_storage was still about putting files in an area readable by any and all apps that had read_external_storage permission.
In other words, the change would do jack all to safeguard against idiots like the whatsapp app devs.
Sure there was! Simply generate a random key, store it in the (small) private storage area, and use it to encrypt whatever you want to write. Instant private area!
On a related note, there's some research[0] into parsing the Android OS source code and coming up with a mapping of "API call => required permission", and by apply this mapping to the source code of your own app the list of required permissions can be generated automatically. What do you guys think of this approach?
This should be less relevant for apps using post-marshmallow-style permissions which don't need to be granted on install.
Surely that must be part of the documentation of each API call, right? Like, "You must enable android.permission.X or this call will fail"? If it is, why not just scrape the documentation, and if it's not, how does anyone develop for Android?
Disclaimer: I only read the abstract.
But some of the permissions listed can't even be used without system permission, meaning your app has to be signed with the same keys the OS was (iirc more recently I've seen a device that didn't need this) and installed in a special system directory. Permissions like getting the users local MAC address...
https://source.android.com/devices/tech/config/runtime_perms...
So starting with Android 6, the user can say "no way" to granting a permission when asked, or at any time after installation (via the app settings menu), and the app has to gracefully notice and/or handle the lack of permission without crashing or otherwise screwing up. This means the app must be designed where the permissions-related stuff can be called asynchronously. I wrote a bit about this in my question here:
https://stackoverflow.com/questions/32134299/can-you-request...
If just you start writing the app with every permission granted you're potentially going to have a huge headache when you go back to pin down the permissions you'll actually need-- now you need to go back and revise the logic so it can handle possible denials. Probably wiser to do that as you go, no?
And that's just the base functionality-- there's a UI question too that would benefit some advance-thinking. Do you want to hit the user with a huge list of permissions the first time they launch the app? Or maybe only in groups when they do key operations. Or perhaps individually. This is a question that may be informed by an early understanding of what permissions will be needed, so you know when to ask and what to do if denied.
Here's the most popular permissions we've identified:
permission | apps | pct_apps
------------------------------------------------------------+---------+----------
android.permission.INTERNET | 2607544 | 92.90
android.permission.ACCESS_NETWORK_STATE | 2332429 | 83.10
android.permission.READ_EXTERNAL_STORAGE | 1707550 | 60.83
android.permission.WRITE_EXTERNAL_STORAGE | 1696178 | 60.43
android.permission.READ_PHONE_STATE | 1154963 | 41.15
android.permission.WAKE_LOCK | 989176 | 35.24
android.permission.ACCESS_WIFI_STATE | 944675 | 33.65
android.permission.ACCESS_FINE_LOCATION | 798122 | 28.43
android.permission.ACCESS_COARSE_LOCATION | 770878 | 27.46
android.permission.VIBRATE | 734366 | 26.16
com.google.android.c2dm.permission.RECEIVE | 687083 | 24.48
android.permission.GET_ACCOUNTS | 676143 | 24.09
android.permission.CAMERA | 436581 | 15.55
android.permission.RECEIVE_BOOT_COMPLETED | 429658 | 15.30
android.permission.RECORD_AUDIO | 243793 | 8.68
android.permission.GET_TASKS | 235717 | 8.39
android.permission.CALL_PHONE | 218079 | 7.76
com.android.vending.BILLING | 200927 | 7.15
android.permission.READ_CONTACTS | 190848 | 6.79
com.google.android.providers.gsf.permission.READ_GSERVICES | 188162 | 6.70
android.permission.SYSTEM_ALERT_WINDOW | 176363 | 6.28
com.android.launcher.permission.INSTALL_SHORTCUT | 164649 | 5.86
android.permission.SET_WALLPAPER | 156845 | 5.58
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS | 131898 | 4.69
android.permission.WRITE_SETTINGS | 122783 | 4.37
android.permission.USE_CREDENTIALS | 110675 | 3.94
android.permission.BLUETOOTH | 106272 | 3.78
android.permission.MODIFY_AUDIO_SETTINGS | 102882 | 3.66
android.permission.SEND_SMS | 97892 | 3.48
android.permission.WRITE_CONTACTS | 97585 | 3.47
com.android.browser.permission.READ_HISTORY_BOOKMARKS | 97147 | 3.46
android.permission.CHANGE_WIFI_STATE | 97074 | 3.45
android.permission.READ_CALL_LOG | 90001 | 3.20
com.android.vending.CHECK_LICENSE | 79279 | 2.82
android.permission.BLUETOOTH_ADMIN | 78199 | 2.78
android.permission.FLASHLIGHT | 74952 | 2.67
android.permission.RECEIVE_SMS | 73898 | 2.63
android.permission.BROADCAST_STICKY | 67092 | 2.39
android.permission.DISABLE_KEYGUARD | 66887 | 2.38
com.android.browser.permission.WRITE_HISTORY_BOOKMARKS | 65765 | 2.34
android.permission.READ_CALENDAR | 61989 | 2.20
android.permission.WRITE_CALENDAR | 61327 | 2.18
android.permission.READ_LOGS | 60059 | 2.13Here's the top 250:
https://mixrank.com/playstore/apps?expiration=2016-11-03&pag...
This because Google switched to putting different permissions into bins, and the networking bin is accepted by default. Note also that these days a user is only notified if a update introduces a new bin requirement, not on every permission change.
https://mixrank.com/appstore/apps?expiration=2016-11-03&sdk_...
We've found 49k+ android apps with Crashlytics. Here's the top 10:
https://mixrank.com/playstore/apps?expiration=2016-11-03&sdk...
android.permission.ACCESS_FINE_LOCATION | 798122 | 28.43
android.permission.ACCESS_COARSE_LOCATION | 770878 | 27.46
There might be a legitimate reason that 1 app in 8 needs access to the camera, but that also seems a high. android.permission.CAMERA | 436581 | 15.55* Banking apps/shopping want access to the camera to scan your debit/credit/gift cards, instead of having to type it out.
* messaging apps/email etc want access to the camera so you can msg/email photos
* games that are vaguely 'social' and want to have a real photo of you as an in-game avatar etc.
I forgot about that type of use, which makes the camera usage rate a lot more reasonable.
android.permission.BRICK'
I hope that doesn't do what I think it does...for reference : https://developer.android.com/guide/topics/security/permissi...
The others ones are still there but pretty much an implementation detail now for Marshmallow apps (I know M+ is a tiny market share at the moment, but it will only increase).
I work with hardware that comes with stock AOSP, and getting a "daemon" style service to run from boot without closing took several workarounds, even though it should have been as simple as "START_STICKY" with a foreground service Android's Service model is very clearly not meant to support such a simple usecase. The most reliable way is actually to modify the image because only system services are supposed to be allowed to do that.
Working with services that aren't reliably started can also be bad for UX even if you don't have the usecase I had of needing a daemon because there might be a high cost associated with starting up. People also don't want every service showing a notification to stay alive.
After trying to model this complex device management system I was working on in nice contained pieces we could maintain separately, I was forced to stuff it into one monolithic app. Performance improved because we no longer needed workarounds to keep the multiple services alive, just one was enough, and we only needed one process to stay alive (a process which is always second from the top in recent usage because our hardware only needs to run our app and a 2nd party one).
Intents are unstable because no one follows the standards for verbs properly. Samsung's built in apps are notorious for crashing if you try to use extras. Facebook won't crash, but it won't respect EXTRA_TEXT or EXTRA_SUBJECT properly because they only want you sharing a URL. Pinterest crashes on sharing some images that other apps don't.
I'd almost go as far as saying you can find a crash report that's app-specific for any major app (Gmail, Facebook, etc.) that you'd expect to see receive a share intent by googling "<insert app name> android intent crash". It's almost always something with the app that's taking the intent not respecting the intent contract properly.
On top of all that, the usual reason there is a "high cost to starting something" is that it hits a server and hasn't cached the data it needs. The OS can't solve that for you.
Our service really is the most important service on the device because if our service goes down the device is essentially "bricked" (these are embedded android devices so we lose visibility on the installation), but adding our service to the image means managing images for every device variation we use (and some of those device's manufacturer's won't be happy to have someone else managing said images since it means more work for them [build image, send it to us, we modify it, send it back to them, they use it vs just building an image and using it]).
It's a unique use case, but it's not hard to imagine more common software that could take advantage of daemons, even if it's just to provide smarter background processing than the "all-or-nothing" defaults provide (like START_STICKY). Besides being rather unique to our use case, I'd also say it doesn't have to do with apps from different creators working together...
And I don't think the network is involved most cases of expensive services, because the OS (or more specifically, Google's services on most end user devices) already help solve that with things like the GCMNetworkManager and ConnectivityManager callbacks for optimizing network access.
I would put a service-starter service in the device images. I see that might be a problem, too, because it seems like you are only "lightly embedded," with multiple hardware platforms. But this could be a really lo-impact thing for your hardware partners and relatively clean. Alternatively, provide a modified launcher, if you are not already replacing the launcher with your own embedded app, that tickles the service on startup. There are probably other advantages to having your own Home app if I understand your situation correctly.
Google has to be heavy handed because too much mobile development is crap, and a low-bidder contract development shop wouldn't hesitate to take the anti-social way to an implementation if they could. The road to hell is paved with cheapass outsourcing.
I also tried some tricks with replacing the launcher since we have full root access, but the launcher process was getting killed almost as often as our custom services.
Since I moved to a single-process model I've had fewer killed services, but we still have the AlarmManager kicking them off just in case.
A lot of the moves Google's been making, from shutting down file uris for content providers feel like they're meant to shut down the "easiest way out for developers", things that are easy for devs, but bad for the average mobile user, but they're also hurting Android for other usecases. I guess the plan is to push Brillo for that, but being able to leverage Android's ecosystem on embedded has some advantages
Point of sale system?
Therefore, from a security perspective, there are far fewer coarser permissions.
https://stuff.mit.edu/afs/sipb/project/android/docs/referenc...
You can list all the permissions in the system, or just those an app uses or see all the "dangerous" groups from adb. For example:
adb shell pm list permissions -g -d
Enjoy.