49 Commits

Author SHA1 Message Date
Xavier Ducrohet
f14fafdb7d am fa888784: am 89fef418: Merge "Avoid pre-processing images when they won\'t be used"
Merge commit 'fa8887848e2877dd96e853dfcd52086f1b66c26b'

* commit 'fa8887848e2877dd96e853dfcd52086f1b66c26b':
  Avoid pre-processing images when they won't be used
2010-09-10 15:01:56 -07:00
Xavier Ducrohet
fa8887848e am 89fef418: Merge "Avoid pre-processing images when they won\'t be used"
Merge commit '89fef4183a3c58aebbbf66e894bbdc1ae9f634e9' into gingerbread-plus-aosp

* commit '89fef4183a3c58aebbbf66e894bbdc1ae9f634e9':
  Avoid pre-processing images when they won't be used
2010-09-10 13:03:43 -07:00
Anthony Newnam
578a57fc6b Avoid pre-processing images when they won't be used
Change-Id: Iffa31228ca95a2e29ccc0aa81bda0fc66922d577
2010-09-03 15:17:09 -05:00
Xavier Ducrohet
8e9bfab2a3 Add a --debug-mode option to aapt.
When passed (with no needed parameters) to the aapt command line,
aapt will insert debuggable=true in the application node of the manifest
automatically.

This is to be used by the SDK tools to make true "debug" builds
that require no code/file change.

Change-Id: I909759caef499a91d10cc9a0902c6448c87e75ef
2010-08-31 15:46:59 -07:00
Xavier Ducrohet
d092f38002 am b4649ec7: am 23827557: Merge "Add a --debug-mode option to aapt." into gingerbread
Merge commit 'b4649ec720fa959b700a7a03c089bfdc61321d16'

* commit 'b4649ec720fa959b700a7a03c089bfdc61321d16':
  Add a --debug-mode option to aapt.
2010-08-31 14:35:28 -07:00
Xavier Ducrohet
6487b09923 Add a --debug-mode option to aapt.
When passed (with no needed parameters) to the aapt command line,
aapt will insert debuggable=true in the application node of the manifest
automatically.

This is to be used by the SDK tools to make true "debug" builds
that require no code/file change.

Change-Id: I6f0a7af7b7d51f26bb0ec012e6f142a6060b8618
2010-08-31 11:07:56 -07:00
Dianne Hackborn
8a44bb23c1 Update aapt to find fragment references.
Add knowledge about <fragment class="..."> for layout files
and update to reflect the change of the header tag from Header.

Change-Id: I91e2a5f204a8e222367985383c1721030c7954d8
2010-08-20 12:56:42 -07:00
Ying Wang
af4798d9c3 am 8cfd3c01: am e05184f2: Merge "Output proguard keep flags for fragment classes." into gingerbread
Merge commit '8cfd3c01e4582a587765588c02234527e7808ca0'

* commit '8cfd3c01e4582a587765588c02234527e7808ca0':
  Output proguard keep flags for fragment classes.
2010-08-16 15:16:52 -07:00
Ying Wang
561a91824f Output proguard keep flags for fragment classes.
Change-Id: I28c10fbf18b91f8ba3dfc2575cd41215f65f11ec
Bug: 2916847
2010-08-13 14:06:58 -07:00
Steve Block
f1ff21ac62 Fixes a few minor problems with AAPT
- Fixes casting problems with stricter compilers
- Adds a couple of missing ifdef guards

This is a first step toward being able to generate APKs on the fly on the device.

Bug: 2766918
Change-Id: Icaaee5a4032afa313256add321b447443861dd85
2010-06-25 11:02:15 +01:00
Kenny Root
c9f3088036 Use correct API version for UTF-8 checking
Use the constant for checking the API version in aapt instead of a bare
number.

Bug: 2541326
Change-Id: Ice7af7b393363a00f1832dd84753b8138d057fb4
2010-03-24 12:05:24 -07:00
Kenny Root
ed9830999a Make aapt warning concise
The previous warning made it seem like it could be using the value
specified on the command line, but, in fact, it would ignore the command
line value if it were already specified in the AndroidManifest.xml

Change-Id: I15e8161e094f17412680d25d3b7b810474eb4a31
2010-03-18 14:14:52 -07:00
Kenny Root
1741cd4904 Fix minSdkVersion scanning to not throw warnings
For the UTF8/UTF16 switch code, we needed to know what was the
minSdkVersion specified as early as possible. Unfortunately, this threw
warnings when the SDK was compiling since we always set this field in
the Bundle.

This splits out the field used by the initial AndroidManifest.xml scan
to a separate one that we won't attempt to re-insert into the
AndroidManifest.xml  This also switches the logic to better reflect the
preference of UTF-8 over UTF-16; previously UTF-16 was the default.

Change-Id: Ia81f6b21047043ebb711eb24c2c3718534979ef6
2010-03-18 12:12:11 -07:00
Dianne Hackborn
cf244ada58 Add ability for some manifest attributes to reference resources.
This loosens our restriction on many manifest attributes requiring
literal string values, to allow various ones to use values from
resources.  This is only allowed if the resource value does not change
from configuration changes, and the restriction is still in place
for attributes that are core to security (requesting permissions) or
market operation (used libraries and features etc).

Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
2010-03-09 17:18:05 -08:00
Xavier Ducrohet
83f4c0994f Fix potential aapt crash when processing overlay.
If an overlay has a type of resources that's not defined in
the main res pool, then aapt would crash.

This dynamically create new ResourceTypeSet when needed
when processing the overlays

Change-Id: I67bc3622281bde73cf42f37a0983798d3f658ce2
2010-03-05 11:11:28 -08:00
Dianne Hackborn
b0381efaf7 Fix issue #2485441: SettingsBackupAgent crashed system server
Need to take care of fixing up backupAdjust as well as reporting it
to ProGuard.
2010-03-03 13:36:35 -08:00
Dianne Hackborn
abd03658bc Fix issue #2482423: Settings is broken due to dead-code stripping
Take care of more custom classes in layouts, and also scan through
preference XMLs.
2010-03-02 14:56:51 -08:00
Dianne Hackborn
ef05e076ce Fix issue #2448075: aapt doesn't fix up activity-alias android:targetActivity links
And related:

- The aapt tool now sets a resource configurations sdk level to match any configs
  that have been set (for example if you specify density your sdk level will be
  at least 4).
- New option to modify the targetPackage attribute of instrumentation.
- Clean up of aapt options help.
- Fix of UI type values to leave 0 for "unspecified".
- Make the UI mode config APIs public.
2010-03-01 20:42:14 -08:00
Kenny Root
7ff20e30c5 Create own reference for minSdkVersion in aapt
Fix bug where applications defining a minSdkVersion were experiencing
transient errors from memory corruption in aapt.

Change-Id: I839d5eda7388baac6133e735fa59f9799ca2822d
2010-02-24 23:49:59 -08:00
Kenny Root
5a8ec76121 Scan for android namespace in manifest
android:minSdkVersion wasn't being correctly scanned because the
namespace was incorrect. This fixes that problem so packages aren't
generated as UTF-8 when minSdkVersion is less than 7.

Change-Id: I8f45d47ea886915da6a4770f6e111e6085d61bee
2010-02-24 20:03:17 -08:00
Tobias Haamel
27b28b3f62 Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.

The ui mode can be set, like it is done for the locale, as follows:

IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);

To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.

The automatic night mode switching will be added in a separate change.
2010-02-11 21:25:58 +01:00
Jeff Hamilton
2fee0ed6eb Add the --rename-manifest-package option to aapt.
It allows you to force override the manifest
package listed in the AndroidManifest.xml when
creating an APK file.

Change-Id: I7eac7943c4e56610b65728ae54773a273634fd9d
2010-02-01 18:47:01 -06:00
Ying Wang
1590077905 am 6efe03b1: am 6f9e2c64: Merge "Find layout classes in all "layout-*" dirs." into eclair
Merge commit '6efe03b19e0734361b262f9a0be4d225088d7f9e'

* commit '6efe03b19e0734361b262f9a0be4d225088d7f9e':
  Find layout classes in all "layout-*" dirs.
2010-01-27 15:53:20 -08:00
Ying Wang
b70efcbbb1 am 3c05f1fb: am b5fb50a1: Merge "Add instrumentation as a source tag for proguard keep options." into eclair
Merge commit '3c05f1fbac2ce35483f61dbd5d5bfb6341da6d9c'

* commit '3c05f1fbac2ce35483f61dbd5d5bfb6341da6d9c':
  Add instrumentation as a source tag for proguard keep options.
2010-01-22 09:45:31 -08:00
Ying Wang
c111296b97 Find layout classes in all "layout-*" dirs.
Before this CL, the generated keep flags for layout classes are incomplete,
such as layout classes in res/layout-port/ and res/layout-land and so on.
2010-01-20 22:12:46 -08:00
Ying Wang
46f4b9827e Add instrumentation as a source tag for proguard keep options. 2010-01-13 16:53:07 -08:00
Ying Wang
ffebd7c2cc am b4f41119: am a1d08886: Merge "Only output proguard keep for nonempty attribute name in the AndroidManifest.xml." into eclair
Merge commit 'b4f41119044e5ec7f7b76ed4ac02b5cfbaeb474d'

* commit 'b4f41119044e5ec7f7b76ed4ac02b5cfbaeb474d':
  Only output proguard keep for nonempty attribute name in the AndroidManifest.xml.
2010-01-12 16:37:31 -08:00
Ying Wang
4199528aab Only output proguard keep for nonempty attribute name in the AndroidManifest.xml.
Before this change, aapt generates proguard keep flags like
"-keep class com.android.somepackage.", which proguard doesn't recognize.
2010-01-12 16:08:23 -08:00
Kenny Root
b5ef7ee164 Default to UTF8 resources when packaging with aapt
This change makes it so with API level 7 and above all resources will be
packaged in UTF-8 format. Any minSdkVersion level that is named will also
have resources packaged in UTF-8, because it is assumed that previous
releases will only be rebuilt with their proper integer number and only
future releases will temporarily have names.

Change-Id: If5d1ee5e48fbaf31798816b068ac44b14a93121b
2009-12-10 20:17:33 -08:00
Kenny Root
19138468ca Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the
default of UTF-16 for Java. When strings are extracted from the
ResStringPool, they are converted to UTF-16 and the result is
cached for subsequent calls.

When using aapt to package, add in the "-8" switch to pack the
resources using UTF-8. This will result in the value, key, and
type strings as well as the compiled XML string values taking
significantly less space in the final application package in
most scenarios.

Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
2009-12-07 15:14:15 -08:00
Dirk Dougherty
59ad275e93 doc change: fix broken R.styleable formatting (caused by missing periods). Adjust table markup.
Bug: 2230588
Change-Id: I54545dfd9d26acef567e586cfc916f6b883a4de7
2009-11-03 15:33:37 -08:00
Robert Greenwalt
832528f92c Fix replacement-after-add of resource files in overlay.
Aapt was adding/removing elements from a list an continuing to use a stale copy for future indexes.
This could cause incorrect subsequent processing.  Add an en resource and modify an es, for example.
Adding the en would cause the base fileset's es version to be moved in the list.  Using the old index
we'd then attempt to remove the old es version with the wrong index and then add the new es version
generating a "duplicate file" error.

bug: 2090015
2009-08-31 14:56:28 -07:00
Joe Onorato
56d8eeae6f applications are at level 2 2009-08-30 16:54:12 -07:00
Joe Onorato
1553c82e08 Add a flag (-G) to aapt to have it output the classes that shouldn't be obfuscated by ProGuard. 2009-08-30 16:51:29 -07:00
Dianne Hackborn
4a51c20ce6 I am getting tired of the java doc warnings, so fix them.
Change-Id: I2205eebae419eaf4a0992c9f5b7cd807eb843fe1
2009-08-24 17:37:32 -07:00
Daniel Sandler
3547f859d4 aapt now attempts to process all assets even if some are malformed.
Previously aapt would bail out on the first broken image, making it difficult to compile a comprehensive list of broken images.  Now it will pre- and post-process all of them and report any and all errors (before exiting with an error code if any errors were encountered).

Bug: 2055485
2009-08-17 10:55:47 -04:00
Dianne Hackborn
64551b2e0e Fix aapt to be able to add configs from overlays.
Fixes a bug where any new configurations introduced in an overlay
would be half-way ignored (enough to result in a broken .apk).
2009-08-15 00:00:33 -07:00
Dianne Hackborn
58c27a0a03 Allow overlays to add resources. 2009-08-13 13:36:00 -07:00
Marco Nelissen
dd93186420 Format aapt warnings the same way as other compiler warnings
('warning: ' instead of 'WARNING: ' or 'WARNING ')
2009-07-13 14:14:01 -07:00
Robert Greenwalt
641fa6c602 am fa5c7e1d: Catch when a file resource (non values) added in an overlay.
Merge commit 'fa5c7e1dfede7e26260789dd2de5175497e9659b'

* commit 'fa5c7e1dfede7e26260789dd2de5175497e9659b':
  Catch when a file resource (non values) added in an overlay.
2009-06-08 11:06:48 -07:00
Robert Greenwalt
fa5c7e1dfe Catch when a file resource (non values) added in an overlay.
File resources are assigned resource id's and if an overlay adds one
it renumbers things and breaks compatability.  Used to segfault
if you tried before, but now catches it and lets you know what file
caused the problem.
2009-06-08 09:10:29 -07:00
Dianne Hackborn
62da8461ed Implement compatibility support for WRITE_SDCARD permission.
Now old applications will automatically be granted it.  Also renamed it from
SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions,
and re-arranged how we do targetSdkVersion to actually be usuable for this
kind of stuff.

Note that right now this results in basically all apps being given the
WRITE_SDCARD permission, because their targetSdkVersion is not set.  I will
be dealing with that in a future change.
2009-05-15 18:23:56 -07:00
Dianne Hackborn
a96cbb435d Implement compatibility support for WRITE_SDCARD permission.
Now old applications will automatically be granted it.  Also renamed it from
SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions,
and re-arranged how we do targetSdkVersion to actually be usuable for this
kind of stuff.

Note that right now this results in basically all apps being given the
WRITE_SDCARD permission, because their targetSdkVersion is not set.  I will
be dealing with that in a future change.
2009-05-15 18:02:47 -07:00
Marco Nelissen
6a1fadea85 AI 147028: Fix up aapt so it runs cleanly under the valgrind leak checker.
Automated import of CL 147028
2009-04-20 16:16:01 -07:00
The Android Open Source Project
9066cfe988 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d83a98f4ce auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
9266c558bf auto import from //branches/cupcake/...@126645 2009-01-15 16:12:10 -08:00
The Android Open Source Project
f013e1afd1 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:43 -08:00
The Android Open Source Project
54b6cfa9a9 Initial Contribution 2008-10-21 07:00:00 -07:00