Disable asset compression with Android aapt

http://www.otradny.org/?papers-on-education Papers On Education Trying to embed all the assets resources into my final apk was not so easy as I tought.. at least using the ADT Eclipse plugin for building project.
In fact, using AssetManager.openFd to return to the C++ code a FileDescriptor does not work with compressed sources.
When aapt compile the resources into the apk file it compress by default all the files which extensions are not recognized and those which recognize as text files.

These are the extensions not compressed:

1
2
3
4
5
6
7
8
9
<br />
static const char* kNoCompressExt[] = {<br />
".jpg", ".jpeg", ".png", ".gif",<br />
 ".wav", ".mp2", ".mp3", ".ogg", ".aac",<br />
 ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",<br />
 ".rtttl", ".imy", ".xmf", ".mp4", ".m4a",<br />
 ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",<br />
 ".amr", ".awb", ".wma", ".wmv"<br />
};<br />

Uk Dissertation Writing Service

I was looking into the .project file of my Eclipse project but it seems that changing things inside that file ( like values into the tag ) does not affect the builder.

The first thing I tried was to remap the aapt executable using a shell script ( and renaming the original aapt file into _aapt ):

Help With Homework Online

1
2
3
4
5
6
7
8
9
10
11
12
<br />
#!/bin/bash</p>
<p>strParams=""<br />
CWD=’dirname $0’</p>
<p>for i in $@; do<br />
   if [ $i = "-S" ]; then<br />
      strParams="$(echo $strParams) -v -0 \"\""<br />
   fi<br />
   strParams="$(echo $strParams) $i"<br />
done</p>
<p>tool="$CWD/_aapt $strParams"<br />
$tool 1>&2<br />

Dissertation Thesis Methodology Info

In fact, when building the project in eclipse I could see the whole output, but the files are still being compressed, even if I call the same command in a shell the assets aren’t compressed.
I haven’t yet find a solution so for the meantime I decided to use ant to build my project overriding the default “-package-resources” target in this way:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<br />
    <target name="-package-resources"><br />
        <echo>Packaging resources</echo><br />
      <echo>${asset.absolute.dir}</echo><br />
        <aapt executable="${aapt}"<br />
                command="package"<br />
            verbose="${verbose}"<br />
                versioncode="${version.code}"<br />
                manifest="AndroidManifest.xml"<br />
                assets="${asset.absolute.dir}"<br />
                androidjar="${android.jar}"<br />
                apkfolder="${out.absolute.dir}"<br />
                resourcefilename="${resource.package.file.name}"<br />
                resourcefilter="${aapt.resource.filter}"><br />
            <res path="${resource.absolute.dir}" /><br />
            <nocompress /></target></p>
<p>    <br />

In this way the project is being compiled correctly and all my assets are embedded not compressed!

P.S. my claim token is: 7C8AATS7Q5A3