Can somebody explain to me what are the benefits of Android System App over a "normal" app
(besides that fact that a system app cannot be uninstalled)?
Special permissions?
There is some confusion here.
First, if you are talking about "system app" as just being one with FLAG_SYSTEM set, all this means is that the app is located on the /system partition, which is the read-only partition that is basically the firmware of the device. (It can only be modified as part of an OTA firmware update.) These apps can't be removed simply because they are on a partition that can't be modified.
The only thing special about a system application beyond this is that there are a handful of signature permissions that can also be granted to any app on the system image. For example there is a permission to directly talk with the package manager to install an app (without going through the system UI) that such an app can have; this is useful for any app store / market pre-loaded on a device.
Being signed with the platform certificate is an orthogonal concept -- such an app can be either on the system image or installed as a third party app (though obviously in almost all cases these come pre-installed). Such apps have access to a whole suite of low-level permissions for interacting with the platform. Very few apps are signed with this certificate; it is only for core platform applications. Unless you are working with a hardware vendor on a device, you won't have access to this.
All of the platform's certificates (whether they be available to all apps, require an app be signed with the platform cert, or are available to apps installed on the system partition) are declared by the platforms manifest, just like any other app:
https://android.googlesource.com/platform/frameworks/base/+/master/core/res/AndroidManifest.xml
There are permissions that can only be obtained by systems apps. For example the permission brick can be requested by every app but it is only granted to apps that are signed as system apps. There are some other features that make more sense I think directly installing and removing apps would be a system only permission too.
From your explanation I guess you mean the the pre-installed applications (like the Browser or the Messages app). You can take a look in these apps at https://android.googlesource.com. (search for platform/packages/apps/...).
You will find that these application are no difference to your own custom developed Apps, except you can't remove them. They cannot be removed as they provide the basic functionality to operate your phone / device. So, same security constraints apply there.
Related
Background
Without root, I know that it's possible to install a single, normal APK using Intent (here).
Given root, I know that it's possible to install it using this .
This will install the app like a normal installation process, as a user-app.
There is also a way to install a split apk app (here), though for some reason I didn't succeed using it.
The problem
I want to know how to convert and/or install an app to be a system-installed-app, and back to be a user-app.
This includes both APK files of apps that aren't yet installed, and of apps that are already installed.
What I've found
I've found some very old ways to convert an existing app (or installing a new one) into a system app (here, for example or here), saying (in short) I should just move the APK file into /system/app/ path.
Thing is, this might have worked in the past, but now it's not. I think the reason for this is that the apps on /system/app/ exist in a different way now: each app has a folder with some files inside of it.
As for converting back to user app, I can't find it. Same goes for installing a split apk app to system app and convert it back to user app.
In fact, there are apps on the Play store (such as this one) that I remember that could convert other apps into system apps just fine (using root) - now can't do anything.
The questions
When did the method of installing/converting an app to system app worked? How come it doesn't work anymore?
What should be done installing/converting an app to system app, and back to user app, on both old and new Android versions?
Is the same thing possible for split-apk apps (example: AirBnb app) , or at least installed ones?
As I know the procedure which define system app has changed over the time.
The Privileged Permission Whitelisting AOSP documentation may help you:
Privileged applications are system applications located in the
/system/priv-app directory on the system image. Historically, device
implementers had little control over which signature|privileged
permissions could be granted to privileged apps. Starting in Android
8.0, implementors can explicitly whitelist privileged apps in the system configuration XML files in the /etc/permissions directory. Apps
not explicitly listed in these XML files are not granted privileged
permissions.
Below described process won't work with every android build versions but in most cases it will work as expected.
1 - When did the method of installing/converting an app to system app
worked? How come it doesn't work anymore?
You have two situations to install the application like system app.
When building an android image
You can place the application you want system privileges in /system/app folder and building system will sign it with the platform key and it will work as a system application.
After gaining root permission of installed images
If you can access your android system as the root user, then you can simply push the certain application to /system/app directory on android device.
2 - What should be done installing/converting an app to system app,
and back to user app, on both old and new Android versions?
If you want to make your application as a system application, you need to add android:sharedUserId="android.uid.system" as application attribute on your AndroiManifest.xml file
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:sharedUserId="android.uid.system"
android:theme="#style/AppTheme">
For most of the custom images, manufacturer toolkit is provided and it can be used to create a new image file with system applications. If you don't have such a tool, you can root your device and push apk file to system/app directory.
According to my understanding, we don't have any straight forward way to revert back system app to user app. What you can do is simply uninstall system application and again install it as user application.
3 - Is the same thing possible for split-apk apps (example: AirBnb
app), or at least installed ones?
Above procedure should work with split-apk apps. But unable to confirm because I have no prior experience.
The apk i saw for rooted phones or w.e is called systemizer apk it claims to turn any apk into system apk thrpugh it and prolly back again is what im assuming it could or couldnt but nice if it does =} id decompile it and see what it does to do sucha thing if i needed the code instead for my own project.
On Android can users choose to install any apps permanently?
And if so how does this work? I know when you first get an Android there are pre-installed apps that are permanent and you cant uninstall them but is there anyway in which we can permanently install apps ourselves?
What you're looking for is a 'system app'.
The apps installed on your Android devices can be broadly categorized as system apps or user apps, based on their installation location. The user apps are just all your normal app installations through the Google Play Store, Amazon Appstore or sideloading. These go into the /data partition of your Android phone, which is the part of the internal memory made available for user data and apps.
System apps are basically the apps that come pre-installed with your ROM. In a standard Android user environment, the user doesn’t have write access to the /system partition and thus, installing or uninstalling system apps directly isn’t possible. The process isn’t as hard as it may sound. However, there is a catch.
In order to install an app as a system app on your Android device, your device must either be _root_ed, or have a custom recovery installed (or both).
Here's how to install an app as a system app
By permanantly, I assume installing them as System Apps.
For that, you might need to root your phone. Google "installing android app as system app" and you will get a lot of answers. This is one sample
As the question is generic, so I am not adding the steps.
Easy way- If you don't uninstall an app, it will stay there permanantly. In addition, you can use additional security for preventing accidental uninstallation.
I'm developing a remote-control application for Android.
I want to be able to lock/unlock the screen.
To do this there are two ways:
Making the app a Device Administrator.
Using PowerManager.goToSleep(), which requires the DEVICE_POWER permission, which is a system permission.
So eclipse tells me "this permission is only granted to system apps".
I really need this and some other system permissions in my app, as it's a remote control app that must be able to control system features.
From the support page:
Uploading System Applications
Most developers will not need to upload system applications and may ignore this section. System applications may come pre-installed on certain devices and may or may not already be published in the Play store.
If you need to upload a system application and encounter an error message when doing so, please contact us. Please be sure to select the Publishing issues and distribution option.
If I'm understanding it right, It's possible to make a system application. how?
I'm developing a remote-control application for Android
Fortunately, this is not possible, except perhaps if you run as root, or you download the Android source code, modify it, and roll it into your own ROM mod.
If I'm understanding it right, It's possible to make a system application. how?
Build your own ROM mod. Sign the app with the same signing key as is used to sign your ROM mod. Put your app in your ROM mod. Install your ROM mod on your device.
This, of course, will limit your app's distribution to those devices running your ROM mod.
A lot of “system” permissions are really SIGNATURE_OR_SYSTEM permissions. For those, you need to do one of the following:
After building the APK, install it as a system app.
Sign the app with the same key as the Android distribution on your device.
For the first option, you would need to be root on your device. Regular APKs reside in /data/app, while system APKs need to be placed in a different folder (on Android 6 and 7 it’s /system/priv-app, earlier versions may differ). However, this is not very suitable for an app to be distributed to end users, especially if your target audience is not very tech-savvy.
For the second option, you need to build Android from source for your target device. If you sign the app with the same key as your Android build, then users running that build of Android can install it in the usual manner.
I have added the Android Licensing to my Application. to check for the application licensing.
There is also one option like copy protection during uploading the application on Android Market.
So if i have Implemented the Android Licensing to My apps, then should i have to give it to copy protection ?
Is it necessary to give copy protection ?
If i have not given copy protection and have given Android Licensing to My Application, then user can be able to copy it to anoter device. But should it be able to install in to another device ? I have to know about it..
So Please let me know what steps i have to take ?
Should i have to give copy protection on if i have given Licensing or not ?
Thanks in advance.
Taken from here:
Replacement for Copy Protection
Android Market Licensing is a flexible, secure mechanism for controlling access to your applications. It effectively replaces the Copy Protection mechanism offered on Android Market and gives you wider distribution potential for your applications.
A limitation of the legacy Copy Protection mechanism on Android Market is that applications using it can be installed only on compatible devices that provide a secure internal storage environment. For example, a copy-protected application cannot be downloaded from Market to a device that provides root access, and the application cannot be installed to a device's SD card.
With Android Market licensing, you can move to a license-based model in which access is not bound to the characteristics of the host device, but to your publisher account on Android Market and the licensing policy that you define. Your application can be installed and controlled on any compatible device on any storage, including SD card.
Although no license mechanism can completely prevent all unauthorized use, the licensing service lets you control access for most types of normal usage, across all compatible devices, locked or unlocked, that run Android 1.5 or higher version of the platform.
Google's "app filtering" is VERY buggy... and getting worse.
Many of our apps are listed "not available on this device"... even when the OS version is ok... the device is NOT on our "exclude list"... the device has absolutely NO screen-size or screen-resolution limits. Google still claims "not available on this device".
I'm RUNNING the apps... as we speak... right on several of the "forbidden devices". They install and run 100% fine. But they are forever listed as "not for this device" in the store.
Great way to sell apps. Users can't download them on 100 different fully legal devices.
I'm wondering whether the official google Android Marketplace application has access to some restricted functionality in the OS, or if it just uses the standard APIs available. Anyone up to date on this matter?
Update
Would it be possible to get an application signed by the manufacturer so that you can access these functionalities, or does google have to do this?
Market does a few things that third party applications can't do -- most notable is being able to install apps without going through the permission screen (allowing it to verify permissions before downloading the app).
This is not a matter of signing -- Market is signed with Google's cert, not with a device's cert. The special things it does are features available to apps that are bundled as part of the system image. If Market were made available as a third party app, it would not be able to do these things. Likewise a third party app that is included by a manufacturer in their system image will have access to some additional functionality by virtue of being there.
Historically Market has also used a number of private APIs, which it could live with because it is always bundled with the device, so if one of those APIs changes the manufacturer will just need to make sure that they fix that to be able to run Market. Over time we have been cleaning that up to have it use many fewer private APIs.
The Android Market is part of the signed firmware of the device, and it is not an SDK application. Hence, it "has access to some restricted functionality in the OS". So, for example, while an SDK application can request to install an app, it can't uninstall an app.