1

In some applications , when I go to Settings > Application > any application detail , “Disable” button is disabled.

https://android.googlesource.com/platform/packages/apps/Settings/+/master/src/com/android/settings/applications/InstalledAppDetails.java )

From the above link I know if an application is Home app or System app , it wont allow to disable that application .

https://android.googlesource.com/platform/packages/apps/Settings/+/b58b5127040b3c843fe42544a89a1085cf7e74f6/src/com/android/settings/Utils.java

If you check the isSystemPackage() API , it seems to verify if the app is signed with system signature.

Is it because it is a system app or because it is signed with System signature?

I can many system apps(kept in system/apps) have “Disable” button enabled.

Also , its not mentioned anywhere that apps with System signature can’t be removed.

Or , it is a case of Privileged app stored in system/priv-app.

Surbhi
  • 163
  • 2
  • 13
  • (I think): because the app is **System signed** it can enable/disable specific features using manifest file, (disable disable button, disable clear data button, ... etc). the second issue (app location) i think only pre-installed apps can be placed on that path. **OR** the device have to be rooted so user can grant super user access level and install the app on that path – Yazan Aug 10 '16 at 07:30
  • @Yazan I don't think developer can disable clear data/disable button via manifest file. Please provide some detail how it can be done via manifest. Yes, the apps for which "Disable" button is disabled are actually pre-installed. So I am wondering why some pre-installed apps can be disabled wheres as others can't be disabled. – Surbhi Aug 10 '16 at 08:06
  • yes they can do it but again only if the app is **System App** you can use this in your manifest (on application tag) `android:allowClearUserData="false"` it will work if your app is sys app (signed by system signature) – Yazan Aug 10 '16 at 08:16
  • check this question discussing that option http://stackoverflow.com/questions/6531173/how-to-disable-the-clear-data-button-in-application-info-of-manage-appliaction – Yazan Aug 10 '16 at 08:17
  • @Yazan , thank you for the above link. So we can handle clear data for a system app. My concern is the "Disable " button in Application Settings. Any way to disable that for system app. Also , by system app you mean app installed at system/app location or app signed with system signature, bcoz according to below link , they are quite different. https://www.ricston.com/blog/explaining-behavior-android-application-system-apps-nonsystem-apps – Surbhi Aug 10 '16 at 08:47
  • i think a sys app is the app signed with a System Signature. my assumption (not sure) is the Disable of Disable button is just an option, in manifest, just like clear data ?! not sure if it's exist – Yazan Aug 10 '16 at 09:24

1 Answers1

2

After all the research , which included verifying signatures of various preloaded applications (with and without Disable button enabled ) , I have concluded it depends on the Signature.

If an app is signed with System Signature, then its not allowed to Disable that app.Also , not all preloaded apps have system signature.

Surbhi
  • 163
  • 2
  • 13