本文整理匯總了Java中android.content.pm.PackageManager.SIGNATURE_SECOND_NOT_SIGNED屬性的典型用法代碼示例。如果您正苦於以下問題:Java PackageManager.SIGNATURE_SECOND_NOT_SIGNED屬性的具體用法?Java PackageManager.SIGNATURE_SECOND_NOT_SIGNED怎麽用?Java PackageManager.SIGNATURE_SECOND_NOT_SIGNED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.content.pm.PackageManager
的用法示例。
在下文中一共展示了PackageManager.SIGNATURE_SECOND_NOT_SIGNED屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: 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);
}
示例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);
}