kennylee26 / android-apktool

Automatically exported from code.google.com/p/android-apktool
0 stars 0 forks source link

Copy all unknown files to resulting apk. #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. dowload "Are you smarter than a 5th Grader.apk"
2. apktool decode "Are you smarter than a 5th Grader.apk" out

What is the expected output? What do you see instead?
In out folder there should be that /data folder, which is in the original pack. 
And of course, when you try to run built package, you get NullPointerException, 
because those required files are not found.

What version of the product are you using? On what operating system?
Tried with 1.3.1 and 1.2.0 versions. Windows XP.

Please provide any additional information below.
If I manually put those files into the out folder, 
apktool build out test.apk
just ignores them and won't put them into built package.

If I manually put those files into the built package, install it, I get this 
errors in LogCat:
...
06-23 06:08:01.410: ERROR/AndroidRuntime(308): Uncaught handler: thread main 
exiting due to uncaught exception
06-23 06:08:01.430: ERROR/AndroidRuntime(308): java.lang.RuntimeException: 
Unable to start activity 
ComponentInfo{com.capcomcanada.fifthGrader2009/com.capcomcanada.fifthGrader2009.
FifthGrader2009}: java.lang.NullPointerException
...

Original issue reported on code.google.com by liudas.s...@gmail.com on 23 Jun 2010 at 6:53

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 68 has been merged into this issue.

Original comment by Brut.alll on 27 Aug 2010 at 9:01

GoogleCodeExporter commented 9 years ago
I have tried to create similar app to "Are you (...).apk" and 
"Collapse_v1.0.apk", but Android SDK ignores unknown files as well. My guess is 
authors of these apps have altered apks after build, because I don't think you 
could build such an app in normal way :-/

I have to add a feature to apktool, so it will copy all unknown files to 
resulting apk.

Original comment by Brut.alll on 27 Aug 2010 at 9:07

GoogleCodeExporter commented 9 years ago

Original comment by Brut.alll on 27 Aug 2010 at 9:08

GoogleCodeExporter commented 9 years ago
It is actually quite common with proprietary build systems.  They include 
certain files in the apk and access them directly from the code.  Usually it's 
config files or other resources used by some library they're using.

A good example is apps published by Citrix.  For example 
https://market.android.com/details?id=com.citrix.labs.Receiver in which they 
include a whole tree of files with the ".properties" extension.  Rebuild the 
apk without them and the app will break in subtle ways not immediately visible. 
 See the attached apk.

The fix is simple.  I extract the files from the origin apk, rebuild with 
apktool and manually add all the missing files.  I think this should be the 
default behavior for apktool when encountering an unknown file.  Same way it 
handles shared objects in the lib directory.

Original comment by weiss.y...@gmail.com on 4 Apr 2011 at 11:45

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 107 has been merged into this issue.

Original comment by Brut.alll on 3 May 2011 at 8:43

GoogleCodeExporter commented 9 years ago
Note that things are trickier than just copying the files across.  In many 
cases you also need to pay attention to the compression used.  If the file is 
compressed in the zip then random access is eye wateringly slow.  Some apks 
have files deliberately stored and not compressed because they do random access 
to them.

I actually go to the trouble afterwards of copying missing files over, and also 
ensuring that the compress/store decision is exactly the same, repacking the 
apk if needed.

Original comment by rogerbinns on 3 Feb 2012 at 5:53

GoogleCodeExporter commented 9 years ago
Issue 331 has been merged into this issue.

Original comment by connor.tumbleson on 16 Nov 2012 at 1:02

GoogleCodeExporter commented 9 years ago
Issue 397 has been merged into this issue.

Original comment by connor.tumbleson on 19 Jan 2013 at 4:44

GoogleCodeExporter commented 9 years ago
I've been thinking of a way to do this, but it probably needs to be held off 
until v2.0

I don't want to dump any more information into apktool.yml, but I feel this 
feature might require a huge dump of information.

For example,

Apktool reads any unknown folder and recursively any file/folder inside of it. 
Recording the name and storage (compress/store) of it.

Then on rebuild (if extras_apktool.yml) or something exists. Then it can read 
that file to know what to include into the APK/JAR along w/ proper storage 
types.

Original comment by connor.tumbleson on 20 Jan 2013 at 6:37

GoogleCodeExporter commented 9 years ago

Original comment by connor.tumbleson on 11 Mar 2013 at 2:02

GoogleCodeExporter commented 9 years ago
Issue 434 has been merged into this issue.

Original comment by connor.tumbleson on 21 Mar 2013 at 10:37

GoogleCodeExporter commented 9 years ago

Original comment by connor.tumbleson on 30 Mar 2013 at 10:17

GoogleCodeExporter commented 9 years ago
Issue 418 has been merged into this issue.

Original comment by connor.tumbleson on 6 Apr 2013 at 6:33

GoogleCodeExporter commented 9 years ago
Fixed for Apktool 2.0

Original comment by connor.tumbleson on 4 May 2013 at 12:26

GoogleCodeExporter commented 9 years ago
Issue 475 has been merged into this issue.

Original comment by connor.tumbleson on 22 Jun 2013 at 2:11

GoogleCodeExporter commented 9 years ago
Issue 537 has been merged into this issue.

Original comment by connor.tumbleson on 24 Oct 2013 at 11:47

GoogleCodeExporter commented 9 years ago
I'm using apktool_2.0.0b7.jar but it still doesn't include all unknown files in 
the dist apk. There's a lot of apps with such files (TripAdvisor, Booking etc). 
Attached logs from building TripAdvisor apk (first with spaces in filename, 
second try without space).

Original comment by m...@rcel.cz on 10 Nov 2013 at 4:12

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 634 has been merged into this issue.

Original comment by connor.tumbleson on 21 May 2014 at 11:43