Debug info: OpenKeychain permissions

This commit is contained in:
M66B 2023-11-11 15:46:40 +01:00
parent 81c1481dd5
commit 824d26b987
1 changed files with 14 additions and 3 deletions

View File

@ -3506,9 +3506,20 @@ public class Log {
size += write(os, String.format("%s\r\n", p)); size += write(os, String.format("%s\r\n", p));
size += write(os, "\r\n"); size += write(os, "\r\n");
size += write(os, String.format("%s=%b\r\n", String pgpPackage = PgpHelper.getPackageName(context);
PgpHelper.getPackageName(context), boolean pgpInstalled = PgpHelper.isOpenKeychainInstalled(context);
PgpHelper.isOpenKeychainInstalled(context))); size += write(os, String.format("%s=%b\r\n", pgpPackage, pgpInstalled));
if (pgpInstalled)
try {
PackageInfo pi = pm.getPackageInfo(pgpPackage, PackageManager.GET_PERMISSIONS);
for (int i = 0; i < pi.requestedPermissions.length; i++) {
boolean granted = ((pi.requestedPermissionsFlags[i] & PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0);
size += write(os, String.format("- %s=%b\r\n", pi.requestedPermissions[i], granted));
}
} catch (Throwable ex) {
size += write(os, String.format("%s\r\n", ex));
}
try { try {
int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES"); int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");