#define __AAPT_ASSETS_H
#include <stdlib.h>
-#include <utils/AssetManager.h>
+#include <androidfw/AssetManager.h>
+#include <androidfw/ResourceTypes.h>
#include <utils/KeyedVector.h>
-#include <utils/String8.h>
-#include <utils/ResourceTypes.h>
+#include <utils/RefBase.h>
#include <utils/SortedVector.h>
#include <utils/String8.h>
+#include <utils/String8.h>
#include <utils/Vector.h>
-#include <utils/RefBase.h>
#include "ZipFile.h"
#include "Bundle.h"
using namespace android;
+
+extern const char * const gDefaultIgnoreAssets;
+extern const char * gUserIgnoreAssets;
+
bool valid_symbol_name(const String8& str);
class AaptAssets;
AXIS_END = AXIS_VERSION,
};
-enum {
- SDK_CUPCAKE = 3,
- SDK_DONUT = 4,
- SDK_ECLAIR = 5,
- SDK_ECLAIR_0_1 = 6,
- SDK_MR1 = 7,
- SDK_FROYO = 8,
- SDK_HONEYCOMB_MR2 = 13,
- SDK_ICE_CREAM_SANDWICH = 14,
-};
-
/**
* This structure contains a specific variation of a single file out
* of all the variations it can have that we can have.
{
public:
AaptSymbolEntry()
- : isPublic(false), typeCode(TYPE_UNKNOWN)
+ : isPublic(false), isJavaSymbol(false), typeCode(TYPE_UNKNOWN)
{
}
AaptSymbolEntry(const String8& _name)
- : name(_name), isPublic(false), typeCode(TYPE_UNKNOWN)
+ : name(_name), isPublic(false), isJavaSymbol(false), typeCode(TYPE_UNKNOWN)
{
}
AaptSymbolEntry(const AaptSymbolEntry& o)
: name(o.name), sourcePos(o.sourcePos), isPublic(o.isPublic)
- , comment(o.comment), typeComment(o.typeComment)
+ , isJavaSymbol(o.isJavaSymbol), comment(o.comment), typeComment(o.typeComment)
, typeCode(o.typeCode), int32Val(o.int32Val), stringVal(o.stringVal)
{
}
{
sourcePos = o.sourcePos;
isPublic = o.isPublic;
+ isJavaSymbol = o.isJavaSymbol;
comment = o.comment;
typeComment = o.typeComment;
typeCode = o.typeCode;
SourcePos sourcePos;
bool isPublic;
+ bool isJavaSymbol;
String16 comment;
String16 typeComment;
return NO_ERROR;
}
+ status_t makeSymbolJavaSymbol(const String8& name, const SourcePos& pos) {
+ if (!check_valid_symbol_name(name, pos, "symbol")) {
+ return BAD_VALUE;
+ }
+ AaptSymbolEntry& sym = edit_symbol(name, &pos);
+ sym.isJavaSymbol = true;
+ return NO_ERROR;
+ }
+
void appendComment(const String8& name, const String16& comment, const SourcePos& pos) {
if (comment.size() <= 0) {
return;
return sym;
}
+ status_t applyJavaSymbols(const sp<AaptSymbols>& javaSymbols);
+
const KeyedVector<String8, AaptSymbolEntry>& getSymbols() const
{ return mSymbols; }
const DefaultKeyedVector<String8, sp<AaptSymbols> >& getNestedSymbols() const
virtual ~AaptAssets() { delete mRes; }
const String8& getPackage() const { return mPackage; }
- void setPackage(const String8& package) { mPackage = package; mSymbolsPrivatePackage = package; }
+ void setPackage(const String8& package) {
+ mPackage = package;
+ mSymbolsPrivatePackage = package;
+ mHavePrivateSymbols = false;
+ }
const SortedVector<AaptGroupEntry>& getGroupEntries() const;
sp<AaptSymbols> getSymbolsFor(const String8& name);
+ sp<AaptSymbols> getJavaSymbolsFor(const String8& name);
+
+ status_t applyJavaSymbols();
+
const DefaultKeyedVector<String8, sp<AaptSymbols> >& getSymbols() const { return mSymbols; }
String8 getSymbolsPrivatePackage() const { return mSymbolsPrivatePackage; }
- void setSymbolsPrivatePackage(const String8& pkg) { mSymbolsPrivatePackage = pkg; }
-
+ void setSymbolsPrivatePackage(const String8& pkg) {
+ mSymbolsPrivatePackage = pkg;
+ mHavePrivateSymbols = mSymbolsPrivatePackage != mPackage;
+ }
+
+ bool havePrivateSymbols() const { return mHavePrivateSymbols; }
+
+ bool isJavaSymbol(const AaptSymbolEntry& sym, bool includePrivate) const;
+
status_t buildIncludedResources(Bundle* bundle);
status_t addIncludedResources(const sp<AaptFile>& file);
const ResTable& getIncludedResources() const;
String8 mPackage;
SortedVector<AaptGroupEntry> mGroupEntries;
DefaultKeyedVector<String8, sp<AaptSymbols> > mSymbols;
+ DefaultKeyedVector<String8, sp<AaptSymbols> > mJavaSymbols;
String8 mSymbolsPrivatePackage;
+ bool mHavePrivateSymbols;
Vector<sp<AaptDir> > mResDirs;