Project

General

Profile

Issue #1257 ยป Add-manifest-to-verification-params.patch

My Self, 08/26/2015 11:38 AM

View differences:

src/com/android/packageinstaller/InstallAppProgress.java
24 24
import android.content.Intent;
25 25
import android.content.pm.ApplicationInfo;
26 26
import android.content.pm.IPackageInstallObserver;
27
import android.content.pm.ManifestDigest;
27 28
import android.content.pm.PackageInfo;
28 29
import android.content.pm.PackageManager;
29 30
import android.content.pm.PackageManager.NameNotFoundException;
......
54 55
public class InstallAppProgress extends Activity implements View.OnClickListener, OnCancelListener {
55 56
    private final String TAG="InstallAppProgress";
56 57
    private boolean localLOGV = false;
58
    static final String EXTRA_MANIFEST_DIGEST =
59
            "com.android.packageinstaller.extras.manifest_digest";
57 60
    private ApplicationInfo mAppInfo;
58 61
    private Uri mPackageURI;
59 62
    private ProgressBar mProgressBar;
......
254 257
        Uri referrer = getIntent().getParcelableExtra(Intent.EXTRA_REFERRER);
255 258
        int originatingUid = getIntent().getIntExtra(Intent.EXTRA_ORIGINATING_UID,
256 259
                VerificationParams.NO_UID);
260
        ManifestDigest manifestDigest = getIntent().getParcelableExtra(EXTRA_MANIFEST_DIGEST);
257 261
        VerificationParams verificationParams = new VerificationParams(null, originatingURI,
258
                referrer, originatingUid, null);
262
                referrer, originatingUid, manifestDigest);
259 263
        PackageInstallObserver observer = new PackageInstallObserver();
260 264

  
261 265
        if ("package".equals(mPackageURI.getScheme())) {
src/com/android/packageinstaller/PackageInstallerActivity.java
26 26
import android.content.Intent;
27 27
import android.content.SharedPreferences;
28 28
import android.content.pm.ApplicationInfo;
29
import android.content.pm.ManifestDigest;
29 30
import android.content.pm.PackageInfo;
30 31
import android.content.pm.PackageManager;
31 32
import android.content.pm.PackageUserState;
......
69 70
    private Uri mOriginatingURI;
70 71
    private Uri mReferrerURI;
71 72
    private int mOriginatingUid = VerificationParams.NO_UID;
73
    private ManifestDigest mPkgDigest;
72 74

  
73 75
    private boolean localLOGV = false;
74 76
    PackageManager mPm;
......
520 522
            mPkgInfo = PackageParser.generatePackageInfo(parsed, null,
521 523
                    PackageManager.GET_PERMISSIONS, 0, 0, null,
522 524
                    new PackageUserState());
525
            mPkgDigest = parsed.manifestDigest;
523 526
            as = PackageUtil.getAppSnippet(this, mPkgInfo.applicationInfo, sourceFile);
524 527
        }
525 528
        
......
656 659
                        mPkgInfo.applicationInfo);
657 660
                newIntent.setData(mPackageURI);
658 661
                newIntent.setClass(this, InstallAppProgress.class);
662
                newIntent.putExtra(InstallAppProgress.EXTRA_MANIFEST_DIGEST, mPkgDigest);
659 663
                String installerPackageName = getIntent().getStringExtra(
660 664
                        Intent.EXTRA_INSTALLER_PACKAGE_NAME);
661 665
                if (mOriginatingURI != null) {
src/com/android/packageinstaller/PackageUtil.java
72 72
        metrics.setToDefaults();
73 73
        PackageParser.Package pkg =  packageParser.parsePackage(sourceFile,
74 74
                archiveFilePath, metrics, 0);
75
        packageParser.collectCertificates(pkg, 0);
75 76
        // Nuke the parser reference.
76 77
        packageParser = null;
77 78
        return pkg;
    (1-1/1)