1. Are you ready for the Galaxy S20? Here is everything we know so far!

Unzip/re-zip APK file

Discussion in 'Android Development' started by .haNk, Dec 6, 2009.

  1. .haNk

    .haNk Lurker
    Thread Starter

    I unzipped an APK file to make a few changes to a prog, but after re-zipping, i get an error when trying to install, "There is a problem parsing the package." Does anyone know how to correct this?

    I'm using the Linux zip command to zip the file:

    # zip -r blahblah.apk * (directory contains all of the orig APK files)

    Is there any special way to zip the file?

    1. Download the Forums for Android™ app!


  2. .haNk

    .haNk Lurker
    Thread Starter

    nevermind. turns out it was the way i was installing it. can't install directly from Gmail - have to download to SDcard.
  3. wige

    wige Newbie

    I noticed a similar problem trying to install through the Gmail app - however, using the browser and going to gmail.com, I was able to install apps without a problem.
  4. .haNk

    .haNk Lurker
    Thread Starter

    still having problems.

    i tried installing using 'adb', and i get the following error:

    hank@killj0y:~/Scripts/android/android-sdk-linux_86/tools$ ./adb install ../../workspace/keytools/patchtest.apk
    187 KB/s (10545 bytes in 0.054s)
    pkg: /data/local/tmp/patchtest.apk

    i tried disassembling the classes.dex file using JesusFreke's smali/baksmali and editing it before re-assembly. i then zip the file and sign it. no luck. any ideas? :thinking:
  5. wige

    wige Newbie

    If you are using Eclipse, did you try the export utility?
  6. .haNk

    .haNk Lurker
    Thread Starter

    i'm not sure that i can import a decompiled classes.dex file into Eclipse. i'll be happy to know if i'm mistaken though. :)

    i've tried everything i can think of here, but i still get the parse error when trying to install via 'adb'. i've tried decompiling/editing, using a hex editor to directly modify classes.dex (ensuring to change one single byte to not change file size), re-signing, not resigning, zipalign-ing the file after modification, etc., etc.

    does anyone know what this error means or how to correct it?

Share This Page