Good day!
I tried this code :
PackageInfo info = mContext.getPackageManager().getPackageArchiveInfo(absolute_apk_name, PackageManager.GET_SIGNATURES);
if (info != null)
{
Signature[] sig = info.signatures;
if (sig != null)
sigstring = new String(sig[0].toChars());
}
But info.signatures == null
, and I do not have any idea "why?"
File in absolute_apk_name exists, I checked
Android 2.1
UPD:
absolute_apk_name = "/data/data/ru.UseIT.SimpleFormsLauncher/files/SimpleFormsGeneral.apk"
apk was created with flags Context.MODE_WORLD_READABLE|Context.MODE_WORLD_WRITEABLE
But if exec this code
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(Uri.fromFile(new File(absolute_apk_name )), "application/vnd.android.package-archive");
mContext.startActivity(intent);
It was installed.