does Package Have Same Signature - Android App

Android examples for App:Package

Description

does Package Have Same Signature

Demo Code

// Licensed under the Apache License, Version 2.0
//package com.java2s;
import android.content.Context;

import android.content.pm.PackageManager;

public class Main {
    public static boolean doesPackageHaveSameSignature(Context context,
            String productPackage) {
        int compareSignatures = context.getPackageManager()
                .checkSignatures(context.getPackageName(), productPackage);
        return PackageManager.SIGNATURE_MATCH == compareSignatures;
    }//from  w  w  w .  jav  a2 s .c o m
}

Related Tutorials