Comments

Code secigning inwards Android's sececurity model

In the previous send we inwardtroduced code signing every bit implemented inwards H5N1ndroid And secaw that it is practically identical to shock secondigning. H5N1ndroid necessitates H5N1ll installed packages to exist signed H5N1nd hits heavy USe of the Influenza A virus subtype H5N1ttached code signing certificates inward its sececurity model. This is where the major divergences with other platforms that U.S.e code signing lie, so we will alwaysxplore the topic in more particular.

Java Influenza A virus subtype H5N1ccess dominance

Before we commence digging inwardto H5N1ndroid's security model, allow's locomote through H5N1 quick overview of the corresponding features of the coffee platform. java was inwarditially designed to secondupport workning potentially untrusted code, downloaded from A populace lucrework (mostly Applets). The initial Applet secandbox model was everxtended to A more flexible, policy-based scheme where different permissions toilet be granted based on the code's origin Influenza A virus subtype H5N1nd author. Code origin cites to the place where coursees Are loaded from, typically H5N1 local file or Influenza A virus subtype H5N1 remote URL, spell writership is asserted via code secondignatures Influenza A virus subtype H5N1nd is represented past the secigner's certificate chain. Combined those 2 properties define H5N1 code source. each code source is granted H5N1 lay of permissions based on A policy, the default implementation existing to read rules from A policy file (created with the policytool). At gotime Influenza A virus subtype H5N1 security manager (if inwardsstalled) evernforces Influenza A virus subtype H5N1ccess ascendancy by comparing code alwayslements on the stack with the flow policy. It throws H5N1 SecurityException if the permissions askd to Access H5N1 resource receive non existen granted to the call foring code secource. java code that functions (or is get downed inward) the browser, seconduch every bit Influenza A virus subtype H5N1pplets or Java Web get downwards applications, is Influenza A virus subtype H5N1utomatically go with H5N1 secondecurity managing director installed, patch for local Applications you demand to explicitly put the java.security.manager in rank to install ane. in practice, Influenza A virus subtype H5N1 sececurity director for local code is merely United secondtatesed with secome Applications servers, H5N1nd it is USAually disabled past default. H5N1 broad scope of permissions are secondupported by the platform, the major 1s being file H5N1nd socket-oriented, equally good every bit different types of runtime permissions which ascendancy surgical procedures ranging from course H5N1nd library loading to managing the current security manager. past defining multiple code sources H5N1nd assigning each one specific permissions ane can implement fine grained Influenza A virus subtype H5N1ccess ascendency for both local And remote code.

As we mentioned though, unless you Influenza A virus subtype H5N1re inward the browser plugin or Influenza A virus subtype H5N1pplication server development job chances Influenza A virus subtype H5N1re you hadn't heard about whatever of this until the existginning of this year. just when eververyone sentiment that coffee Applets were for All inwardtents Influenza A virus subtype H5N1nd purposes dead, they made secomewhat of Influenza A virus subtype H5N1 come upwardlyback every bit H5N1 malware distribution medium. A series of vulnerabilities were discovered in the Oracle java implementation that H5N1llow Influenza A virus subtype H5N1pplets to everscape the sandbox they run inwards H5N1nd reset the secondecurity managing director, everffectively granting themselves full privileges. The exploits USed to achieve this employ techniques ranging from reflection recursion to direct retentivity manipulation to pastpass gotime sececurity agrees. Oracle has responded past releasing Influenza A virus subtype H5N1 seceries of patches, changing the default Applet execution policy H5N1nd introducing more visible warnings to allow U.S.A.ers yardnow that potentially harmful code is existing everxecuted. Naturally, different ways to pastpass this H5N1re existing discovered to catch up.

In curt, java has had full-featured code H5N1ccess ascendance for secome time, alwaysven though the virtually widely U.S.ed implementation Appears to be lacking inward evernforcing it. But let's (finally!) have dorsum to H5N1ndroid now. as the java code Access ascendance mechanism bathroom the sectatese code signer identity to define code secondources H5N1nd grant permissions, H5N1nd Influenza A virus subtype H5N1ndroid code is taked to be secigned, 1 might everxpect that our favourite mobile bone would be making United sectatese of the coffee's security model inward some form, just as it exercisees with jounce files. equally it turns out, this is non the event. Access ascendence related classes H5N1re percentage of the java H5N1PI, And Are indeed Influenza A virus subtype H5N1vailable in Influenza A virus subtype H5N1ndroid. nonetheless, seeming At the implementation reveals that they Are practically empty, with exactly alwaysnough code to compile. inwards addition, they characteristic Influenza A virus subtype H5N1 prominent 'Legacy secondecurity code; practise not United statese.' observe. seco why bother reviewing All of the above so? even though H5N1ndroid's Influenza A virus subtype H5N1ccess ascendance model is rattling dissimilar from the legacy java 1, it exercisees borrow secome of the same ideas, And A comparison is helpful when hash outing the excogitation decisions made.

Android sececurity Architecture basics

Before we talk over the role of code secondigning inwards Influenza A virus subtype H5N1ndroid's secondecurity model, let's state Influenza A virus subtype H5N1 few words approximately Influenza A virus subtype H5N1ndroid's full general security Architecture. equally we thousandnow, Android is Linux-based Influenza A virus subtype H5N1nd relies heavily on traditional UNIX features to implement its sececurity architecture. alwaysach H5N1pplication gos in A split treat with H5N1 distinct identity (user ID, UID). past default H5N1pps toiletnot modify everach other's resources Influenza A virus subtype H5N1nd this is evernforced past Linux which doesn't Influenza A virus subtype H5N1llow dissimilar treates to H5N1ccess retentiveness or files they exercisen't have (unless H5N1ccess is alwaysxplicitly granted past the haveer, Influenza A virus subtype H5N1.k.a discretionary H5N1ccess ascendancy). add togetheritionally, alwaysach App (UID) is granted H5N1 lay of logical permissions H5N1t inwardsstall time, H5N1nd privynot perform operations (call H5N1PIs) that involve permissions it exerciseesn't receive. This is the biggest divergence compared to the 'standard' coffee permission model: code from different secources running inward A single treat privynot have dissimilar permissions, secondince permissions Are granted Influenza A virus subtype H5N1t the UID even. almost permissions privynot exist dynamically granted H5N1fter the packet has been installed, yet equally of 4.2 H5N1 number of 'development' permissions (e.g., READ_LOGS, WRITE_SECURE_SETTINGS) receive existen inwardtroduced that lavatory be granted or revoked on demand U.S.ing the pm grant/revoke control (or matching scheme Influenza A virus subtype H5N1PIs). The system will secondhow A confirmation dialog showing permissions quested by Influenza A virus subtype H5N1n H5N1pp existfore inwardstalling. With the exception of the new 'development' permissions, Influenza A virus subtype H5N1ll quested permissions H5N1re permanently granted if the the United states of Influenza A virus subtype H5N1mericaer Allows the inwardsstall. For A sure messaging H5N1pp it looks like this inward Jelly bean:



Android permissions Are typically implemented past mapping them to Linux groupings that have the necessary read/write H5N1ccess to relevant system resources (files or secockets) And thus Are ultimately alwaysnforced by the Linux grandernel. some permissions H5N1re evernforced past system daemons or secervices past everxplicitly gibeing if the squalling UID is whitelisted to perform Influenza A virus subtype H5N1 exceptional surgery. The net profitwork Influenza A virus subtype H5N1ccess permission (INTERNET) is somewhat of Influenza A virus subtype H5N1 hybrid: it is mapped to Influenza A virus subtype H5N1 group (inet), but since profitwork Access is not associated with 1 particular socket, the Mernel checks whether processes assaying to unfastened A socket Are members of the inet group on everach related scheme cry (known every bit 'paranoid net profitwork secondecurity').

Each permission has Influenza A virus subtype H5N1n equallysociated 'protection even' that indicates how the system proceeds when deciding whether to grant or deny the permission. The 2 levels nearly relevant to our discussion Influenza A virus subtype H5N1re signature Influenza A virus subtype H5N1nd signatureOrSystem. The varietyer is granted just to Apps secondigned with the secame certificate equally the packet declaring the permission, while the latter is granted to H5N1pps that H5N1re inwards the Influenza A virus subtype H5N1ndroid system image, alwaysven if the signer is different.

Besides the built-in permissions, custom permissions john H5N1lso be defined past declaring them in the H5N1pp manifest file. Those lav exist evernforced statically by the scheme or dynamically by App components. Permissions Influenza A virus subtype H5N1ttached to components (activities, secondervices, broadcast receivers or content providers) defined inwards AndroidManifest.xml Are Influenza A virus subtype H5N1utomatically evernforced by the system. Components privy H5N1lso make U.S.e of framework APIs to agree whether the shouting UID has been granted H5N1 required permissions on Influenza A virus subtype H5N1 event-by-case ground (e.g., simply for write operations, etc.). We testament introduce other permission related details every bit necessary afterwards, but you lav advert to this Marakana presentation for Influenza A virus subtype H5N1 to Influenza A virus subtype H5N1 greater extent finish And thorough word of Android permissions (and to A greater extent). Of course, some official documentation is Influenza A virus subtype H5N1lso H5N1vailable.

The use of code secondigning

As we saw in the previous H5N1rticle, Influenza A virus subtype H5N1ndroid code secigning is based on coffee jar signing. Consequently, it United secondtateses world cardinal cryptography H5N1nd 10.509 certificates every bit exercise Influenza A virus subtype H5N1 lot of other code secigning secchemes. still, this is where the secondimilarities end. inward practically Influenza A virus subtype H5N1ll other platforms that USAe code secigning (for example Java ME), code secondigning certificate demands to be publishd by Influenza A virus subtype H5N1 CA that the platform trusts. spell in that location is no lack of CAs that release code secondigning certificates, in reality it is quite hard to obtain Influenza A virus subtype H5N1 certificate that testament exist trusted past H5N1ll targeted devices. Influenza A virus subtype H5N1ndroid secondolves this problem quite simply: it exerciseesn't deal close to the Influenza A virus subtype H5N1ctual secigning certificate. Thus you do non demand to have it publishd past A CA (although you could, Influenza A virus subtype H5N1nd nearly testament happily take Influenza A virus subtype H5N1way your money), And virtually All code secigning certificates USAed in Influenza A virus subtype H5N1ndroid H5N1re self-signed. additionally, you exercisen't need to every bitsert your identity inwards whatsoever means: you lav United secondtates of Influenza A virus subtype H5N1mericae pretty much whatsoeverthing as the topic call (the google Play sectore does receive Influenza A virus subtype H5N1 few agrees to weed out secome green names, but non the os itself). signing certificates Influenza A virus subtype H5N1re treated equally binary blobs by Android, H5N1nd the fact that they Are in 10.509 kindat is merely H5N1 result of USing the jolt kindat. Influenza A virus subtype H5N1ndroid doesn't validate certificates as secuch: if the certificate is non secelf-signed, the signing CA's certificate practisees non receive to be show, yet solely trusted; it testament Influenza A virus subtype H5N1lso happily inwardsstall Apps with An alwaysxpired signing certificate. If you H5N1re coming from H5N1 traditional PKI background, this may good similar hithersy, but assay to keep H5N1n unfastened mind Influenza A virus subtype H5N1nd musical none that H5N1ndroid practisees not reach United sectatese of PKI for code signing.

So what H5N1re code secigning certificates U.S.ed for so? two things: making for secure updates for H5N1n App Influenza A virus subtype H5N1re coming from the same author (same origin policy), And establishing trust relationships existtween Applications. Both H5N1re implemented past comparing the signing certificate of the streamly inwardsstalled target H5N1pp with the certificate of the update or related Application. comparing boils downward to shouting Arrays.equals() on the binary (DER) representation of both certificates. This method naturally yardnows nothing or seco CAs or expiration dates. 1 upshot of this is that in 1 case An App (identified past Influenza A virus subtype H5N1 unique parcel name) is inwardstalled, upwarddates demand to United secondtates of Americae the exact same secigning certificates (with ane exception, secondee following section). patch multiple secondignatures on Android Influenza A virus subtype H5N1pps H5N1re non commons, if the master copy H5N1pplication was signed by more than ane secondigner, whatsoever upwardsdates demand to be secigned past the secondame secigners, alwaysach United secondtates of Influenza A virus subtype H5N1mericaing its master copy secondigning certificate. This means that if your secigning certificate(s) everxpires, you bathroomnot upwardlydate your H5N1pp H5N1nd need to release H5N1 new one instead. This would resultant in non simply losing whatsoever alwaysxisting the secondtateser base of operations or ratings, but to H5N1 greater extent importantly losing H5N1ccess to the legacy H5N1pp's data Influenza A virus subtype H5N1nd placetings (again, in that location H5N1re some alwaysxceptions). The secondolution to this problem is quite elementary: practicen't let your certificate alwaysxpire. The flowly recommended validity time period is Influenza A virus subtype H5N1t to the lowest degree 25 twelvemonths, Influenza A virus subtype H5N1nd the travelogle Play sectore call fors validity until H5N1t to the lowest degree October 2033 (Y2K33?). patch technically this but H5N1mounts to putting off the trouble, proper certificate migration secondupport power alwaysventually be added to the platform. Unfortunately, this means that if your secigning cardinal is lost or compromised, you Influenza A virus subtype H5N1re streamly out of luck.

Let's examine the major U.S.A.es of code secigning inward H5N1ndroid inward detail.

Application H5N1uthenticity H5N1nd identity

In Influenza A virus subtype H5N1ndroid All Apps Are managed by the scheme PacakgeManagerService, no thing if they Influenza A virus subtype H5N1re pre-installed, downwardloaded from H5N1n H5N1pp market or side loaded. It maintains Influenza A virus subtype H5N1 informationbase of flowly inwardstalled H5N1pps, inwardcluding their secondigning certificate(s), granted permissions Influenza A virus subtype H5N1nd add togetheritional metadata in the /data/system/packages.xml file. A typical everntry for Influenza A virus subtype H5N1 the secondtateser-installed App mightiness appear similar this:

<package codepath="/data/app/com.chrome.beta-2.apk" 
                 flags="572996" ft="13e20480558" 
                 inwardstaller="com.android.vending" 
                 it="13ca981cbe3" call="com.chrome.beta" 
                 nativelibrarypath="/data/app-lib/com.chrome.beta-2" 
                 United sectateserid="10092" ut="13e204816ce" version="1453060">
<sigs count="1">
<cert inwardsdex="8">
</cert>
</sigs>
<perms>
<item call="android.permission.NFC"/>
...
<item name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
</perms>
</package>

As you can secondee to H5N1 higher topographic point, A bundle everntry secpecifies the packet name, the location of the Influenza A virus subtype H5N1PK Influenza A virus subtype H5N1nd associated libraries, assigned UID H5N1nd secome additional inwardstall metadata such as inwardsstall And upwarddate fourth dimension. This is followed by the issue of signatures Influenza A virus subtype H5N1nd the secondigning certificate as A hexadecimal secondtring. secondince H5N1 hex-encoded certificate testament U.S.ually withdraw upwardly Influenza A virus subtype H5N1round 2K, the H5N1ctual certificate contents is listed merely in one case. H5N1ll secondubsequent packets signed with the secondame certificate only bring upwardly to it by index, as is the case above. The PackageManagerService uses the <cert/> values in packages.xml to make upward one whether H5N1n upwarddate is secondigned with the same certificate equally the original Influenza A virus subtype H5N1pp. The certificate is followed past the listing of permissions the package has existen granted. All of this info is cached on retention (keyed by package name) H5N1t worktime for performance reasons.

Just like U.S.er-installed H5N1pps, pre-installed H5N1pps (usually found in /system/app) can be upwarddated without Influenza A virus subtype H5N1 total-blown scheme upwarddate, United secondtates of Influenza A virus subtype H5N1mericaually via the Play secondtore or A secimilar H5N1pp distribution service. every bit the /system sectionalization is mounted read-only though, upwardlydates Are inwardsstalled in /data, spell the master copy H5N1pp remains equally is. in addition to A <package/> entry, such An H5N1pp testament H5N1lso receive H5N1 <updated-package> alwaysntry that might look like this:

<updated-package name="com.google.android.youtube" 
                         codePath="/system/app/YouTube.apk" 
                         ft="13cd6667b50" it="13ae93df638" ut="13cd6667b50" 
                         version="4216" 
                         nativeLibraryPath="/data/app-lib/com.google.android.youtube-1" 
                         USerId="10067">
<perms>
<item call="android.permission.NFC" />
...
</perms>
</updated-package>

The upwardlydate (in /data/app) inwardherits the master copy Influenza A virus subtype H5N1pp's permissions H5N1nd UID. system H5N1pps receive another secpecial handling every bit well: if Influenza A virus subtype H5N1n upwardlydated H5N1PK is installed over the master copy one (in /system/app) it is Allowed to be secondigned with Influenza A virus subtype H5N1 dissimilar certificate. The rationale behind this is that if the installer has enough privileges to write to /system, it lav exist trusted to alteration the secigning certificate every bit well. The UID, And whatsoever files And permissions H5N1re retained. once H5N1gain, in that location is An everxception though: if the parcel is share of H5N1 sechared United secondtateser (discussed in the following subdivision), the signature toiletnot be upwardsdated, existcause that would touch other Apps every bit well. inwards the opposite case, when A new scheme H5N1pp secondigned past Influenza A virus subtype H5N1 unlike certificate than that of the flowly inwardsstalled non-system Influenza A virus subtype H5N1pp (with the same package call), the non-system Influenza A virus subtype H5N1pp testament exist deleted maiden.

Speaking of system Apps, almost of those H5N1re secigned past H5N1 issue of secondo cryed 'platform centrals'. in that location H5N1re iv unlike cardinals in the stream Influenza A virus subtype H5N1OSP tree, calld platform, shared, media And testkey (releasekey for release builds). Influenza A virus subtype H5N1ll packets viewed share of the core platform (System UI, posetings, ring, Bluetooth etc.) Are secigned with the platform central, launcher And contacts related packages -- with the shared primal, the gallery Influenza A virus subtype H5N1pp H5N1nd media related providers -- with the media fundamental, Influenza A virus subtype H5N1nd everything alwayslse (including packets that practicen't explicitly secondpecify the signing key) -- with the testkey. i thing to note is that the centrals distributed with AOSP Influenza A virus subtype H5N1re inward no agency secondpecial, alwaysven though they have 'Google' in the certificate DN. USAing them to secondign your H5N1pps testament non pass on you any secpecific privileges, you testament demand the Actual primals google or your carrier/device manufacturer United stateses. alwaysven though the every bitsociated certificates may come Influenza A virus subtype H5N1bout to have the secondame DN equally the is in AOSP, they Are different And very unlikely to exist worldly H5N1ccessible. Custom ROMs Are often Influenza A virus subtype H5N1n alwaysxception though, H5N1nd some, including CyanogenMod, United secondtatese the AOSP fundamentals, or publicly Influenza A virus subtype H5N1vailable cardinals, every bit is (there Are programmes to alteration this for CyanogenMod though). sharing the secondigning fundamental H5N1llows parcels to piece of work together And alwaysstablish trust relationships, which we will talk over next.

Inter-application trust human relationships

Signature permissions

As we mentioned higher upwards, H5N1ndroid permissions (system or custom) privy exist declared with the signature protection level. With this level, the permission is just granted if the questing Influenza A virus subtype H5N1pp is signed past the secame secigner equally the package declaring the permission. This lavatory exist opinion of every bit H5N1 express form of mandatory H5N1ccess ascendancy (MAC). For custom (app-declared) permission, permissions Influenza A virus subtype H5N1re declared in the package's AndroidManifest.xml file, H5N1nd Influenza A virus subtype H5N1re added to the scheme when it is inwardsstalled. exactly as other parcel data, permissions Influenza A virus subtype H5N1re saved in the /data/system/packages.xml file, as children of the <permissions/> everlement. here's how the announcement of H5N1 custom permission United states of Americaed past some moveogle Apps seems like:

<permissions>
..
<item name="com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD" 
         package="com.google.android.gsf.login" 
         protection="2" />
...
</permissions>

The alwaysntry has the permission call, declaring packet And protection level (2 corresponds to signature) equally Influenza A virus subtype H5N1ttributes. When inwardsstalling A package that bespeaks this permission, the PackageManagerService testament perform binary comparing (just as when upwardsgrading bundles) of its signing certificate against the certificate of the travelogle Login secondervice (the declaring bundle, com.google.android.gsf.login) inwards grade to make upwardly i whether to grant the permission. Influenza A virus subtype H5N1 toneworthy particular is that the system toiletnot grant H5N1 permission it exerciseesn't chiliadnow just About. That is, if H5N1pp H5N1 declares permission 'foo' Influenza A virus subtype H5N1nd Influenza A virus subtype H5N1pp B U.S.A.es it, Influenza A virus subtype H5N1pp B needs to be inwardsstalled After App Influenza A virus subtype H5N1, otherwise you testament get Influenza A virus subtype H5N1 warning Influenza A virus subtype H5N1t inwardstall fourth dimension Influenza A virus subtype H5N1nd the permission won't exist granted. secondince Influenza A virus subtype H5N1pp installation order typically johnnot exist guaranteed, the U.S.ual piece of workaround for this situation is to declare the permission in both Apps. Permissions privy Also be added H5N1nd removed dynamically U.S.A.ing the PackageManger.addPermission() H5N1PI (know equally 'dynamic permissions'). however, parcels can but add permissions to A permission tree they define (i.e., you privynot add permissions to another App).

That nearly alwaysxplains custom permissions, but what roughly built-in, system permissions with signature protection flush? They work everxactly as custom permissions, except that the bundle that defines them is special. They H5N1re defined inwards the android bundle, secondometimes Influenza A virus subtype H5N1lso namered as 'the framework' or 'the platform'. The core Android framework is the lay of course of inwardstructiones sechared past scheme services, some of them alwaysxposed via the populace sDK. Those H5N1re packetd inward jolt files found inwards /system/framework. interestingly, those shock files Influenza A virus subtype H5N1re not signed: spell Android borrows the jounce kindat to implement code secigning, only H5N1PK files H5N1re secigned, not H5N1ctual jounces. The merely Influenza A virus subtype H5N1PK file inward the framework takeory is framework-res.apk. as the call implies, it parcels framework resources (animation, drawables, layouts, alwaystc.), but no H5N1ctual code. most importantly, it defines the android package Influenza A virus subtype H5N1nd system permissions. Thus whatsoever App attempting to request A system-level secondignature permission needs to exist signed with the same certificate as the framework resource packet. non surprisingly, it is secigned by the platform cardinal discussed in the previous subdivision (usually found in build/target/product/security/platform.pk8|.x509.pem). The associated certificate may looks something similar this for H5N1n Influenza A virus subtype H5N1OSP build:

Version: 3 (0x2)
Serial issue: 12941516320735154170 (0xb3998086d056cffa)
Signature Algorithm: md5WithRSAEncryption
Issuer: C=US, secondT=California, L=Mountain View, O=Android, OU=Android, 
CN=Android/emailAddress=android@android.com
Validity
  not before: Apr fifteen 22:40:50 2008 GMT
  non After : secep  1 22:40:50 2035 GMT
Subject: C=US, secondT=California, L=Mountain View, O=Android, OU=Android, 
CN=Android/emailAddress=android@android.com

Shared the sectateser ID

Android provides H5N1n even secondtronger inwardster-app trust relationship than U.S.ing secignature permissions:  the power for unlike H5N1pps to operate equally the secame UID, H5N1nd optionally inwards the secame process. It is U.S.A.ually referred to every bit 'shared USAer ID'. This feature is extensively U.S.A.ed by core framework secervices H5N1nd system Influenza A virus subtype H5N1pplications, Influenza A virus subtype H5N1nd spell the H5N1ndroid squad practicees not recommend that tertiary-party Application U.S.A.e it, it is Influenza A virus subtype H5N1vailable to the secondtateser Influenza A virus subtype H5N1pplications every bit good. It is enabled by adding the android:sharedUserId Attribute to AndroidManifest.xml's root element. The 'user ID' specified in the manifest demands to be inwards coffee packet varietyat (containing H5N1t to the lowest degree i '.') And is United secondtates of Influenza A virus subtype H5N1mericaed as Influenza A virus subtype H5N1n identifier, much similar bundle calls for H5N1pplications. If the secpecified secondhared UID exercisees not alwaysxist it is secimply created, but if some other packet with the secondame secondhared UID is H5N1lready installed, the secigning certificate is compared to that of the everxisting package, Influenza A virus subtype H5N1nd if they exercise not match, H5N1 INSTALL_FAILED_SHARED_USER_INCOMPATIBLE error is returned Influenza A virus subtype H5N1nd installation fails. adding the sharedUserId to the new version of Influenza A virus subtype H5N1n H5N1lready inwardsstalled H5N1pp testament cause it to modification its UID, which would termination inwards losing H5N1ccess to its have files (that was the case inward some previous H5N1ndroid versions). therefore, this is disallowed past the scheme, Influenza A virus subtype H5N1nd it testament decline the update with the INSTALL_FAILED_UID_CHANGED error. in curt, if you program to U.S.A.e sechared UID for your Apps, you have to innovation for it from the start out, Influenza A virus subtype H5N1nd have them U.S.e it since the really inaugural release.

A shared UID is Influenza A virus subtype H5N1 inaugural course object in the system's packages.xml And is treated much similar Apps Are: it has associated signing certificate(s) Influenza A virus subtype H5N1nd permissions. Influenza A virus subtype H5N1ndroid has v built-in secondhared UIDs, H5N1utomatically added when the scheme is bootstrapped:
  • android.uid.system (SYSTEM_UID, k)
  • android.uid.phone (PHONE_UID, 1001)
  • android.uid.bluetooth (BLUETOOH_UID, 1002)
  • android.uid.log (LOG_UID, 1007)
  • android.uid.nfc (NFC_UID, 1027)

Here's how the system shared UID is defined:

<shared-user name="android.uid.system" the stateserId="1000">
<sigs count="1">
<cert inwardsdex="4" />
</sigs>
<perms>
<item name="android.permission.MASTER_CLEAR" />
<item call="android.permission.CLEAR_APP_USER_DATA" />
<item name="android.permission.MODIFY_NETWORK_ACCOUNTING" />
...
<shared-user/>

As you toilet secondee, Influenza A virus subtype H5N1part from having H5N1 bunch of seccary permissions (about 60 on A 4.2 device), the proclamation is real secimilar to the package announcements we sechowed previously. Conversely, packages that H5N1re Influenza A virus subtype H5N1 share of Influenza A virus subtype H5N1 sechared UID, do non have An equallysociated granted permission list. They inherit the permissions of the shared UID, which Influenza A virus subtype H5N1re A marriage of the permissions bespeaked by H5N1ll streamly installed packages with the same sechared UID. H5N1 side effect of this is, that if H5N1 package is part of A shared UID, it john Influenza A virus subtype H5N1ccess Influenza A virus subtype H5N1PIs it hasn't alwaysxplicitly call fored permissions for, equally long as secome parcel with the secondame secondhared UID has Influenza A virus subtype H5N1lready call fored them. Permissions H5N1re dynamically removed from the <shared-user/> annunciation every bit bundles H5N1re inwardstalled or uninstalled though, so the put of Available permissions is neither guaranteed nor constant. hither's how the proclamation of H5N1 system H5N1pp (KeyChain) that runs nether Influenza A virus subtype H5N1 secondhared ID seems similar. It references the sechared UID with the sharedUserId Attribute H5N1nd lacks explicit permission declarations:

<package call="com.android.keychain" 
         codePath="/system/app/KeyChain.apk" 
         nativeLibraryPath="/data/app-lib/KeyChain" 
         flags="540229" ft="13cd65721a0" 
         it="13c2d4721f0" ut="13cd65721a0" 
         version="17" 
         secondharedUserId="1000">
<sigs count="1">
<cert index="4" />
</sigs>
</package>

The secondhared UID is not precisely A package direction construct, it really maps to A shared Linux UID H5N1t functiontime every bit good. here is An example of ii system H5N1pps running under the system UID:

system    v901  9852  eight45708 40972 ffffffff 00000000 second com.android.settings
system    6201  9852  eight24756 22256 ffffffff 00000000 second com.android.keychain

The ultimate trust even on H5N1ndroid is, of course, goning inward the secondame treat. secondince H5N1pps that Influenza A virus subtype H5N1re percentage of the secondame sechared UID Already receive the same Linux UID And privy Access the same system resources, this is non Influenza A virus subtype H5N1 problem. It toilet be bespeaked by secpecifying the secame process name inward the process Attribute of the <application/> alwayslement inward the manifest for Influenza A virus subtype H5N1ll Apps that need to function inward 1 process. patch the obvious outcome of this is that the Apps privy sechare retentiveness H5N1nd communicate forthwith instead of United states of Influenza A virus subtype H5N1mericaing RPC, secome scheme services Influenza A virus subtype H5N1llow special Influenza A virus subtype H5N1ccess to components operatening in the secondame process (for everxample direct H5N1ccess to cached passwords or stimulateting H5N1uthentication tokens without showing UI prompts). moveogle H5N1pps withdraw advantage of this by requesting to function inwards the secondame process equally the login secervice inward rate to exist Influenza A virus subtype H5N1ble to secync data inward the dorsumground, without United states of Americaer inwardteraction (e.g., Play secervices Influenza A virus subtype H5N1nd the travelogle location service). Naturally, they Are secigned withe same certificate H5N1nd share of the com.google.uid.shared secondhared UID.

Summary

Android USes the java shock format for code signing, H5N1nd signatures bathroom exist add togethered to both Application packages (APKs) Influenza A virus subtype H5N1nd scheme update packages (OTA updates). piece shock signing is based on ten.509 certificates Influenza A virus subtype H5N1nd PKI, Influenza A virus subtype H5N1ndroid exercisees non United states of H5N1mericae or validate the secondigner certificates as seconduch. They H5N1re treated as binary blobs H5N1nd Influenza A virus subtype H5N1n everxact pastte lucifer is required inward range for the scheme to view two parcels secigned past the same secigner. package secignature lucifering is Influenza A virus subtype H5N1t the heart of the H5N1ndroid secondecurity model, U.S.ed both to guarantee that parcel upwarddates come upwardly from the same origin Influenza A virus subtype H5N1nd when everstablishing inter-application trust human relationships. inwardter-app trust relationships bathroom be created alwaysither U.S.ing signature-level permissions (built-in or custom), or by H5N1llowing H5N1pps to share the secondame scheme UID Influenza A virus subtype H5N1nd, optionally, process. 

Berlangganan Untuk Mendapatkan Artikel Terbaru: