Good evening!
I use the following 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 have no idea why
The file absolute apk name exists, I checked it
Android 2.1
absolute_apk_name = "/data/data/ru.UseIT.SimpleFormsLauncher/files/SimpleFormsGeneral.apk" apk is created with Context.MODE_WORLD_READABLE|Context.MODE_WORLD_WRITEABLE flags Context.MODE_WORLD_READABLE|Context.MODE_WORLD_WRITEABLE
And if you execute 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); Then everything is set