// Standard dex file. This is the format that is packaged in APKs and produced by tools. class StandardDexFile : public DexFile { public: class Header : public DexFile::Header { // Same for now.
};
uint16_t registers_size_; // the number of registers used by this code // (locals + parameters)
uint16_t ins_size_; // the number of words of incoming arguments to the method // that this code is for
uint16_t outs_size_; // the number of words of outgoing argument space required // by this code for method invocation
uint16_t tries_size_; // the number of try_items for this instance. If non-zero, // then these appear as the tries array just after the // insns in this instance.
uint32_t debug_info_off_; // Holds file offset to debug info stream.
uint32_t insns_size_in_code_units_; // size of the insns array, in 2 byte code units
uint16_t insns_[1]; // actual array of bytecode.
// Write the standard dex specific magic. staticvoid WriteMagic(uint8_t* magic);
// Write the current version, note that the input is the address of the magic. staticvoid WriteCurrentVersion(uint8_t* magic);
// Write the last version before default method support, // note that the input is the address of the magic. staticvoid WriteVersionBeforeDefaultMethods(uint8_t* magic);
// Returns true if the byte string points to the magic value. staticbool IsMagicValid(const uint8_t* magic); staticbool IsMagicValid(DexFile::Magic magic) { return IsMagicValid(magic.data()); } bool IsMagicValid() const override;
// Returns true if the byte string after the magic is the correct value. staticbool IsVersionValid(const uint8_t* magic); bool IsVersionValid() const override;
size_t GetDequickenedSize() const override { // JVMTI will run dex layout on standard dex files that have hidden API data, // in order to remove that data. As dexlayout may increase the size of the dex file, // be (very) conservative and add one MB to the size. return Size() + (HasHiddenapiClassData() ? 1 * MB : 0);
}
private:
StandardDexFile(const uint8_t* base, const std::string& location,
uint32_t location_checksum, const OatDexFile* oat_dex_file, // Shared since several dex files may be stored in the same logical container.
std::shared_ptr<DexFileContainer> container)
: DexFile(base,
location,
location_checksum,
oat_dex_file,
std::move(container)) {}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.