当前位置: 首页>>代码示例>>Java>>正文


Java PackageManager.checkSignatures方法代码示例

本文整理汇总了Java中android.content.pm.PackageManager.checkSignatures方法的典型用法代码示例。如果您正苦于以下问题:Java PackageManager.checkSignatures方法的具体用法?Java PackageManager.checkSignatures怎么用?Java PackageManager.checkSignatures使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.pm.PackageManager的用法示例。


在下文中一共展示了PackageManager.checkSignatures方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkProVersion

import android.content.pm.PackageManager; //导入方法依赖的package包/类
public static boolean checkProVersion(Context context) {
    PackageManager manager = context.getPackageManager();
    return (manager.checkSignatures(context.getPackageName(), PRO_NAME) == PackageManager.SIGNATURE_MATCH || (BuildConfig.DEBUG && Constants.DEBUG_PRO));
}
 
开发者ID:lucasax,项目名称:Zero,代码行数:5,代码来源:Utils.java

示例2: isFrameworkPackage

import android.content.pm.PackageManager; //导入方法依赖的package包/类
private boolean isFrameworkPackage(PackageManager packageManager, String packageName) {
    if (fakeFramework) {
        try {
            PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0);
            return isFrameworkPackage(packageManager, packageInfo);
        } catch (PackageManager.NameNotFoundException e) {
            UILog.w("cannot find " + packageName, e);
            return false;
        }
    } else {
        return packageManager.checkSignatures(PACKAGE_FRAMEWORK, packageName) ==
                PackageManager.SIGNATURE_MATCH;
    }
}
 
开发者ID:brevent,项目名称:Brevent,代码行数:15,代码来源:BreventActivity.java

示例3: SetDonationKeyStatus

import android.content.pm.PackageManager; //导入方法依赖的package包/类
public void SetDonationKeyStatus() {

        if (BuildConfig.DEBUG) {
            Status = true;
            return;
            //if debug mode, avoid the advertisements and use pro features
        }
        try {
            PackageManager packageManager = getPackageManager();
            packageManager.getPackageInfo("com.softminds.matrixcalculator.pro.key", 0);
            //Key is Installed
            //Checking the Authenticity of the Key
            if (packageManager.checkSignatures(getPackageName(),
                    "com.softminds.matrixcalculator.pro.key")
                    == PackageManager.SIGNATURE_MATCH) {
                Log.d(TAG, "The Signature of Key Matched with Application");
                String manager = packageManager.getInstallerPackageName("com.softminds.matrixcalculator.pro.key");
                if (manager != null) {
                    //Status = true;
                    Log.d(TAG, manager);
                    if (Objects.equals(manager, "com.android.vending")) {
                        Status = true;
                    } else {
                        Status = false;
                        Toast.makeText(this, R.string.clear_warn_invalid_install, Toast.LENGTH_LONG).show();
                    }
                }
                //the Key is Genuine and was Installed from Play
            }
        } catch (Exception e) {
            Status = false;
        }
    }
 
开发者ID:coder3101,项目名称:Matrix-Calculator-for-Android,代码行数:34,代码来源:GlobalValues.java

示例4: isBreventFramework

import android.content.pm.PackageManager; //导入方法依赖的package包/类
private boolean isBreventFramework() {
    PackageManager packageManager = getPackageManager();
    return packageManager.checkSignatures(PACKAGE_FRAMEWORK, BuildConfig.APPLICATION_ID) ==
            PackageManager.SIGNATURE_MATCH;
}
 
开发者ID:brevent,项目名称:Brevent,代码行数:6,代码来源:BreventActivity.java

示例5: isSystemSignaturePackage

import android.content.pm.PackageManager; //导入方法依赖的package包/类
public static boolean isSystemSignaturePackage(PackageManager pm, String packageName) {
    return pm.checkSignatures("android", packageName) != PackageManager.SIGNATURE_NO_MATCH;
}
 
开发者ID:brevent,项目名称:prevent,代码行数:4,代码来源:PackageUtils.java


注:本文中的android.content.pm.PackageManager.checkSignatures方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。