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

    1 answer 1

    And you see the following in the logs:

     W/PackageParser(65468): Skipping dir: /data/data/com.exemple/files/YourApp.apk 

    that is, the path to "data" is ignored - download your application to a publicly accessible directory.

    Strangely, this error just gives out this error (source code android.content.pm.PackageParser):

     mArchiveSourcePath = sourceFile.getPath(); if (!sourceFile.isFile()) { Slog.w(TAG, "Skipping dir: " + mArchiveSourcePath); mParseError = PackageManager.INSTALL_PARSE_FAILED_NOT_APK; return null; } 
    • Hmm, strange, because the installation is possible :) Since for that matter, tell such a publicly accessible directory, not on a flash drive, and getExternalStorageDirectory () will not work, as the flash drive in the device will not, and there 2.1 android - andreich