Can't install .apk after decoding and rebuild (Apktool, Apkstudio)

12,497

Solution 1

Non-system apks need to be signed after recompiling. Try to sign your apk: Signing Your App Manually

Solution 2

I Know it was answered before but for more clarification , you can sign it by these commands.

First Generate the Key :

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

Second sign it :

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name

IF you Don't like to enter a password after previous command or do it in bash file, use this :

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore [Your Key Store] [Address/YourApk.apk] alias_name  -storepass [Your Password]
Share:
12,497
user3118109
Author by

user3118109

Updated on July 25, 2022

Comments

  • user3118109
    user3118109 almost 2 years

    I decoded an apk file with apktool and I didn't change anything. After that I just build it again and then I tried to install the apk but i got the below error even after some basic change.

    What I did using windows cmd:

    apktool d somename.apk -o testfolder
    

    then

    apktool b testfolder
    

    and:

    adb install somename.apk
            pkg: /data/local/tmp/somename.apk
    Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
    rm failed for -f, No such file or directory
    

    I did it with apkstudio and the result was the same.

    $ adb install -r "somename.apk"
        pkg: /data/local/tmp/somename.apk
    Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
    rm failed for -f, No such file or directory
    Process exited with code 0
    

    Was it a system app? No.

    Can someone help me about it?

    • GottZ
      GottZ over 8 years
      did you decompile an app that you made yourself?
    • user3118109
      user3118109 over 8 years
      yes. it was my old app and i don't have access to the source anymore.