[Q] Application could not be installed - error, help! - Android Q&A, Help & Troubleshooting

Hello all,
So I've made an application, for android but when I try to install it on my phone it gives an error, "Application could not be installed" or something like that.
I think it's a signing issue. If I sign it with apk manager it works great, but since I want to upload it on the market I had to sign it with jarsigner.
I used this tutorial:
http://www.simply-android.com/discu...an-app-inventor-app-on-the-android-market./p1
Any suggestions?
I also tried signing with eclpise/adt, same error.

So, I just used this command to verify the sign was ok:
Code:
jarsigner.exe -verify -verbose -certs apkname.apk
I get some files that have this:
Code:
[CertPath not validated: null]
Then on last lines:
Code:
jar verified
Warning:
This jar contains entries whose certificate chain is not validated
Any help appreciated!

Nobody knows? I really need some help with this, since I can't upload the app on the market because of this issue.
What am I doing wrong? I did use the correct commands to sign it, so I don't understand why there is an error when trying to install the apk from the SD card...

Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

It is very tricky to find info on the usage with 1.7, but once found it is reasonable simple:
For keytool include
-sigalg SHA1withDSA -keyalg DSA -keysize 1024​For jarsigner include
-sigalg SHA1withDSA -digestalg SHA1​
(1024 is the maximum and works, less might do the trick)

Related

[Q] Best way to compile Superuser.apk?

android-10 target
No resource found that matches the given name 'android:Theme.Holo.Light'.
This is apparently because It needs a Honeycomb target number.
android-15 target
AppDetailsActivity.java:20: package android.support.v4.app does not exist
I found this link with the same problem:
http://groups.google.com/group/android-building/browse_thread/thread/9ae77ba4b24407db
But after adding the three lines suggested to Android.mk I still get the same errors.
The thread references the library as android.support.v4 but the original Android.mk shows android-support-v4. Does this have anything to do with the error?
Naturally, Android Support Package has been installed.
What SDK version should I be targeting?
edit:
I think I got this working by copying ~/android-sdk-linux/extras/android/support/v4/android-support-v4.jar to the lib folder in the project directory.
Without this link I would not have been able to get it fixed in a timely manner:
http://myandroidnote.blogspot.com/2011/04/using-fragment-of-android-compatibility.html
edit:
Please see first post.

Compile help with classes not in android.jar

Trying to compile some samples from the Android SDK.
I just took the AccelerometerPlay example, ran the command:
Code:
android update project -p . -t 1
which creates the Ant build file, then
Code:
ant release
which builds release APK files.
The problem is, if I add something like:
Code:
import android.util.Slog;
to the .java file, the build fails, claiming that it can't find the file (even though it exists in {sdk_path}/sources/android-15
I'm guessing that it looks for .class files inside {sdk_path}/platforms/android-15/android.jar , where android/util/Slog.class doesn't exist.
How do I get this build to work?
I've tried adding
Code:
<src path="${sdk.dir}/sources/android-15" />
under the <javac> task in {sdk_dir}/tools/ant/build.xml, but it seems to throw out more errors, whilst also appearing to try to compile every single .java file there.
I'm new to Java so really don't know what I'm doing - can anyone please point me in the correct direction?
Thanks.
Anyone have any idea?
If you're new to Java, you may want to give Eclipse a try. You won't have to mess around with Ant too much and it will help you with your syntax/imports.
From your description, it looks like you'll want to add the .jar file you mentioned to the 'classpath' attribute of the <javac> element in your ant XML file.
- chris
Thanks for the reply cttttt.
What .jar file are you referring to? android.jar? Because that doesn't have the classes as far as I know.
Eclipse gets me even less further - I can't seem to install the ADT plugin at all. On Eclipse 3.7.2, it throws the WST error, and when I try the solutions "that work", I get thrown network errors.
(so at least I can get a build actually going with Ant)

[Q] Is APK signature verification extra fields bug patched in older API versions?

Hi guys,
Sorry in advance if I posted this to the wrong place as I am not allowed to post into Android devs-only forum.
I am currently investigating the extra fields flaw in apk signature verification discovered in juli 2013 by trying to replicate it on the AVD.
First of all...this is research only as I am trying to understand my system's internals and especially permissions handling.
What i try to achieve is to root the AVD by using the elevated permissions of a apk signed with the platform key.
1. I have an apk signed with the platform key from my cyanogenmod 10.2 device and a classes.dex with size under 65k that will try to install SuperSU on my AVD
2. When creating a new apk I put the original classes.dex into the extras field of the corresponding ZIP entry and pad it to have a size of 65533
3. The rooting classes.dex goes into the data field of the ZIP entry and extra lengh is set to 65533 or -3 as seen by the buggy verifier. This classes.dex is also padded to have the exact size of the original classes.dex
4. My MainActivity tries to install the just assembled apk
Expected result: As the verifier is validating the original classes by jumping 3 backwards instead of 65533 forward the apk should be installed having elevated system privileges.
Actual result: AVD refuses installation of the apk with error code -103 as the "digest of classes.dex does not match those in the apk".
My thoughts on what may cause this:
A) I know that google merged the fix for this bug into HEAD but it still should work on AVD 2.3 and 4.1.
Or are all versions of AVD patched agains extras field expliotation? As I update my APIs everyday the fix is likely to be in my AVD.
Correct me if i am wrong.
B) As I use a cyanogenmod 10.2 apk as the base the platform keys may not match those of the AVD.
If so the error should be different to -103 but something like "system user signature does not match"
Please would someone point me into the right direction?

How to perform baksmaling directly in an android device

Hello,
for the purpose of developing an antimalware for android, I need to have a baksamli representation of an APK.
the antimalware is itself an APK, that why I need the baksmaling operation to be performed in the device (i.e by the antimalware).
I asked the author of the baksmali tool (Issue #28)
he suggested me to use the dexlib2 library, but I don't think that I can get the smali representation of method calls (refer to the GitHub Issue).
After that I tried to execute the baksmali jar file directly in the device but I get a class not found error (sorry I can't provide the link to the stack overflow post, according to the policy of the forum I don't have the minimum post count)
Is there any other solution to get the smali of an APK ?(knowing that the solution will be executed in the Andriod device)
Thank you in advance
_Massy_ said:
Hello,
for the purpose of developing an antimalware for android, I need to have a baksamli representation of an APK.
the antimalware is itself an APK, that why I need the baksmaling operation to be performed in the device (i.e by the antimalware).
I asked the author of the baksmali tool (Issue #28)
he suggested me to use the dexlib2 library, but I don't think that I can get the smali representation of method calls (refer to the GitHub Issue).
After that I tried to execute the baksmali jar file directly in the device but I get a class not found error (sorry I can't provide the link to the stack overflow post, according to the policy of the forum I don't have the minimum post count)
Is there any other solution to get the smali of an APK ?(knowing that the solution will be executed in the Andriod device)
Thank you in advance
Click to expand...
Click to collapse
May be APK editor pro version help you..

how to force install an unsigned apk?

Given that I have root and custom ROM/recovery?
There is an apk from the different ROM thus different signatures, and the phone's package installer doesn't want to install this apk, same as "adb install" command.
adb: failed to install samsung_service_mode_10.apk: Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Reconcile failed: Package com.sec.android.app.servicemodeapp has no signatures that match those in shared user android.uid.system; ignoring!]
Click to expand...
Click to collapse
Will I brick my phone if I simply rename this .apk to .zip and flash it with TWRP?
Why not to sign the APK using the apksigner tool by yourself?
because it requires downloading thousands of megabytes of Android SDK and learning how to use it.
I would prefer a simpler way like "adb install --force", if possible.
The err msg " INSTALL_FAILED_SHARED_USER_INCOMPATIBLE" triggered by ADB really has NOTHING to with fact whether APK is signed or not.
> dat laughing smiley
I'm glad that you have an optic fibre with unlimited 1Gbps connection at home, however some people on our planet still reside on slow Internet connections with limited traffic, and downloading
android-studio-ide-202.7486908-linux.tar.gz 950 MiB
Click to expand...
Click to collapse
with
Google Maven dependencies 2724 MB
Click to expand...
Click to collapse
will take many hours and $$$s in traffic cost.
jwoegerbauer said:
The err msg " INSTALL_FAILED_SHARED_USER_INCOMPATIBLE" triggered by ADB really has NOTHING to with fact whether APK is signed or not.
Click to expand...
Click to collapse
thanks for pointing that out! I've googled for the second part of the error - "has no signatures that match those in shared user android.uid.system" instead of the first part, and that lead me to the wrong conclusions.
So the fix was relatively simple - download apktool.jar and signapk.jar (no need to download full 3 GBs of Studio stuff), decompile the app with apktool, delete the "android.uid.system" part from the manifest file, compile app back and sign it with signapk.jar using the stock AOSP platform keys.
However in my particular case that did not work because an app requires Samsung libs absent on my device:
adb: failed to install samsung_service_mode_10_EDIT_signed.apk: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY: Reconciliation failed...: Reconcile failed: Package com.sec.android.app.servicemodeapp requires unavailable shared library sec_platform_library; failing!]
Click to expand...
Click to collapse
P.S. few links for the future self:
apktool.jar:
Apktool - A tool for reverse engineering 3rd party, closed, binary Android apps.
Apktool - A tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications
ibotpeaches.github.io
signapk.jar: (NOTE: use Java 8!)
SignApk/signapk.jar at master · techexpertize/SignApk
SignApk is used to sign the apk file after repack. The easiest way ever. - SignApk/signapk.jar at master · techexpertize/SignApk
github.com
AOSP stock keys:
platform_build/shared.x509.pem at master · aosp-mirror/platform_build
Contribute to aosp-mirror/platform_build development by creating an account on GitHub.
github.com
platform_build/shared.pk8 at master · aosp-mirror/platform_build
Contribute to aosp-mirror/platform_build development by creating an account on GitHub.
github.com

Categories

Resources