0

I have a simple in-app browser that displays html files from /assets in a fullscreen WebView.

The idea is that customer can change those scripts himself without need of recompiling the APK.

I read few articles but when I tried to simply:

  1. Rename .apk to .zip
  2. Extract .zip
  3. Zip the folder to .zip
  4. Rename to .apk

When I transfer the .apk to my phone it reads "Error during analysis of the package" (Not exact error - translation from czech).

The ultimate goal is to change the files in assets folder (edit, add, delete).

What am I doing wrong?

EDIT:

Reaction to MichaelCMS

I tried:

  1. Rename apk.apk to apk.zip
  2. Extract .zip
  3. Remove META-INF dir
  4. Zip the folder to apk2.zip
  5. Rename to apk2.apk

then I followed: http://developer.android.com/tools/publishing/app-signing.html

jarsigner.exe -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore release-key.keystore app2.apk alias

zipalign.exe 4 app2.apk app-aligned.apk

The problem persists. Same error as before

Vojtech B
  • 2,837
  • 7
  • 31
  • 59

3 Answers3

1

Apks need to be zip alligned, and also signed.

You can browse through an apk, but when repackaging him you need to remove the meta-inf , copress, zip align and sign (which will re-add the meta-inf folder).

Link to the documentation :

http://developer.android.com/tools/help/zipalign.html

MichaelCMS
  • 4,703
  • 2
  • 23
  • 29
0

It is not sufficient to produce a file with the correct extension using 7zip, you must ensure that you tell 7zip to use the standard zip compression using the -tzip parameter.

zmarties
  • 4,809
  • 22
  • 39
0

Basically, the trick is not to rename the app... Just go to 7zip, press Ctrl+o and open the apk!

If the problem persists, install the app on a phone and use apk extractor to create a new apk.

undo
  • 257
  • 3
  • 19