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


Java PackageManager.SIGNATURE_MATCH属性代码示例

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


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

示例1: getStubProcessByTarget

public String getStubProcessByTarget(ComponentInfo targetInfo) {
    for (ProcessItem processItem : items.values()) {
        if (processItem.pkgs.contains(targetInfo.packageName) && TextUtils.equals(processItem.targetProcessName, targetInfo.processName)) {
            return processItem.stubProcessName;
        } else {
            try {
                boolean signed = false;
                for (String pkg : processItem.pkgs) {
                    if (PluginManager.getInstance().checkSignatures(targetInfo.packageName, pkg) == PackageManager.SIGNATURE_MATCH) {
                        signed = true;
                        break;
                    }
                }
                if (signed && TextUtils.equals(processItem.targetProcessName, targetInfo.processName)) {
                    return processItem.stubProcessName;
                }
            } catch (Exception e) {
                Log.e(TAG, "getStubProcessByTarget:error", e);
            }
        }
    }
    return null;
}
 
开发者ID:amikey,项目名称:DroidPlugin,代码行数:23,代码来源:RunningProcesList.java

示例2: isPkgCanRunInProcess

boolean isPkgCanRunInProcess(String packageName, String stubProcessName, String targetProcessName) throws RemoteException {
    for (ProcessItem item : items.values()) {
        if (TextUtils.equals(stubProcessName, item.stubProcessName)) {

            if (!TextUtils.isEmpty(item.targetProcessName) && !TextUtils.equals(item.targetProcessName, targetProcessName)) {
                continue;
            }

            if (item.pkgs.contains(packageName)) {
                return true;
            }

            boolean signed = false;
            for (String pkg : item.pkgs) {
                if (PluginManager.getInstance().checkSignatures(packageName, pkg) == PackageManager.SIGNATURE_MATCH) {
                    signed = true;
                    break;
                }
            }
            if (signed) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:amikey,项目名称:DroidPlugin,代码行数:26,代码来源:RunningProcesList.java

示例3: call

@Override
public Object call(Object who, Method method, Object... args) throws Throwable {

    if (args.length == 2 && args[0] instanceof String && args[1] instanceof String) {

        PackageManager pm = VirtualCore.getPM();

        String pkgNameOne = (String) args[0], pkgNameTwo = (String) args[1];
        try {
            PackageInfo pkgOne = pm.getPackageInfo(pkgNameOne, PackageManager.GET_SIGNATURES);
            PackageInfo pkgTwo = pm.getPackageInfo(pkgNameTwo, PackageManager.GET_SIGNATURES);

            Signature[] one = pkgOne.signatures;
            Signature[] two = pkgTwo.signatures;

            if (ArrayUtils.isEmpty(one)) {
                if (!ArrayUtils.isEmpty(two)) {
                    return PackageManager.SIGNATURE_FIRST_NOT_SIGNED;
                } else {
                    return PackageManager.SIGNATURE_NEITHER_SIGNED;
                }
            } else {
                if (ArrayUtils.isEmpty(two)) {
                    return PackageManager.SIGNATURE_SECOND_NOT_SIGNED;
                } else {
                    // 走到了这里说明两个包的签名都在
                    if (Arrays.equals(one, two)) {
                        return PackageManager.SIGNATURE_MATCH;
                    } else {
                        return PackageManager.SIGNATURE_NO_MATCH;
                    }
                }
            }
        } catch (Throwable e) {
            // Ignore
        }
    }

    return method.invoke(who, args);
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:40,代码来源:MethodProxies.java

示例4: isFrameworkPackage

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,代码行数:14,代码来源:BreventActivity.java

示例5: SetDonationKeyStatus

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,代码行数:33,代码来源:GlobalValues.java

示例6: call

@Override
public Object call(Object who, Method method, Object... args) throws Throwable {

    if (args.length == 2 && args[0] instanceof String && args[1] instanceof String) {

        PackageManager pm = VirtualCore.getPM();

        String pkgNameOne = (String) args[0], pkgNameTwo = (String) args[1];
        try {
            PackageInfo pkgOne = pm.getPackageInfo(pkgNameOne, PackageManager.GET_SIGNATURES);
            PackageInfo pkgTwo = pm.getPackageInfo(pkgNameTwo, PackageManager.GET_SIGNATURES);

            Signature[] one = pkgOne.signatures;
            Signature[] two = pkgTwo.signatures;

            if (ArrayUtils.isEmpty(one)) {
                if (!ArrayUtils.isEmpty(two)) {
                    return PackageManager.SIGNATURE_FIRST_NOT_SIGNED;
                } else {
                    return PackageManager.SIGNATURE_NEITHER_SIGNED;
                }
            } else {
                if (ArrayUtils.isEmpty(two)) {
                    return PackageManager.SIGNATURE_SECOND_NOT_SIGNED;
                } else {
                    if (Arrays.equals(one, two)) {
                        return PackageManager.SIGNATURE_MATCH;
                    } else {
                        return PackageManager.SIGNATURE_NO_MATCH;
                    }
                }
            }
        } catch (Throwable e) {
            // Ignore
        }
    }

    return method.invoke(who, args);
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:39,代码来源:MethodProxies.java

示例7: signaturesMatch

boolean signaturesMatch(int uid1, int uid2) {
    try {
        IPackageManager pm = AppGlobals.getPackageManager();
        return pm.checkUidSignatures(uid1, uid2) == PackageManager.SIGNATURE_MATCH;
    } catch (RemoteException ex) {
        Slog.e(TAG, "Remote exception while checking signatures", ex);
        return false;
    }
}
 
开发者ID:TaRGroup,项目名称:IFWManager,代码行数:9,代码来源:IntentFirewall.java

示例8: call

@Override
public Object call(Object who, Method method, Object... args) throws Throwable {

	if (args.length == 2 && args[0] instanceof String && args[1] instanceof String) {

		PackageManager pm = VirtualCore.getPM();

		String pkgNameOne = (String) args[0], pkgNameTwo = (String) args[1];
		try {
			PackageInfo pkgOne = pm.getPackageInfo(pkgNameOne, PackageManager.GET_SIGNATURES);
			PackageInfo pkgTwo = pm.getPackageInfo(pkgNameTwo, PackageManager.GET_SIGNATURES);

			Signature[] one = pkgOne.signatures;
			Signature[] two = pkgTwo.signatures;

			if (ArrayUtils.isEmpty(one)) {
				if (!ArrayUtils.isEmpty(two)) {
					return PackageManager.SIGNATURE_FIRST_NOT_SIGNED;
				} else {
					return PackageManager.SIGNATURE_NEITHER_SIGNED;
				}
			} else {
				if (ArrayUtils.isEmpty(two)) {
					return PackageManager.SIGNATURE_SECOND_NOT_SIGNED;
				} else {
					// 走到了这里说明两个包的签名都在
					if (Arrays.equals(one, two)) {
						return PackageManager.SIGNATURE_MATCH;
					} else {
						return PackageManager.SIGNATURE_NO_MATCH;
					}
				}
			}
		} catch (Throwable e) {
			// Ignore
		}
	}

	return method.invoke(who, args);
}
 
开发者ID:codehz,项目名称:container,代码行数:40,代码来源:CheckSignatures.java

示例9: isDonated

private boolean isDonated() {
    return getPackageManager().checkSignatures(getPackageName(), "ru.meefik.donate")
            == PackageManager.SIGNATURE_MATCH;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:RepositoryActivity.java

示例10: isBreventFramework

private boolean isBreventFramework() {
    PackageManager packageManager = getPackageManager();
    return packageManager.checkSignatures(PACKAGE_FRAMEWORK, BuildConfig.APPLICATION_ID) ==
            PackageManager.SIGNATURE_MATCH;
}
 
开发者ID:brevent,项目名称:Brevent,代码行数:5,代码来源:BreventActivity.java

示例11: checkProVersion

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,代码行数:4,代码来源:Utils.java

示例12: hasValidProEnablerSignature

private static boolean hasValidProEnablerSignature(Context context) {
	return (context.getPackageManager()
			.checkSignatures(context.getPackageName(), context.getPackageName() + ".pro") == PackageManager.SIGNATURE_MATCH);
}
 
开发者ID:ukanth,项目名称:XPrivacy,代码行数:4,代码来源:Util.java


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