Lines Matching refs:DexFile
50 const byte DexFile::kDexMagic[] = { 'd', 'e', 'x', '\n' };
51 const byte DexFile::kDexMagicVersion[] = { '0', '3', '5', '\0' };
73 bool DexFile::GetChecksum(const char* filename, uint32_t* checksum, std::string* error_msg) {
82 if (DexFile::IsMultiDexLocation(filename)) {
110 std::unique_ptr<const DexFile> dex_file(DexFile::OpenFile(fd.release(), filename, false, error_msg));
121 bool DexFile::Open(const char* filename, const char* location, std::string* error_msg,
122 std::vector<const DexFile*>* dex_files) {
130 return DexFile::OpenZip(fd.release(), location, error_msg, dex_files);
133 std::unique_ptr<const DexFile> dex_file(DexFile::OpenFile(fd.release(), location, true,
146 int DexFile::GetPermissions() const {
154 bool DexFile::IsReadOnly() const {
158 bool DexFile::EnableWrite() const {
167 bool DexFile::DisableWrite() const {
176 const DexFile* DexFile::OpenFile(int fd, const char* location, bool verify,
185 *error_msg = StringPrintf("DexFile: fstat '%s' failed: %s", location, strerror(errno));
200 if (map->Size() < sizeof(DexFile::Header)) {
202 "DexFile: failed to open dex file '%s' that is too short to have a header", location);
208 const DexFile* dex_file = OpenMemory(location, dex_header->checksum_, map.release(), error_msg);
223 const char* DexFile::kClassesDex = "classes.dex";
225 bool DexFile::OpenZip(int fd, const std::string& location, std::string* error_msg,
226 std::vector<const DexFile*>* dex_files) {
232 return DexFile::OpenFromZip(*zip_archive, location, error_msg, dex_files);
235 const DexFile* DexFile::OpenMemory(const std::string& location,
248 const DexFile* DexFile::Open(const ZipArchive& zip_archive, const char* entry_name,
264 std::unique_ptr<const DexFile> dex_file(OpenMemory(location, zip_entry->GetCrc32(), map.release(),
287 bool DexFile::OpenFromZip(const ZipArchive& zip_archive, const std::string& location,
288 std::string* error_msg, std::vector<const DexFile*>* dex_files) {
290 std::unique_ptr<const DexFile> dex_file(Open(zip_archive, kClassesDex, location, error_msg,
307 std::unique_ptr<const DexFile> next_dex_file(Open(zip_archive, name.c_str(), fake_location,
326 const DexFile* DexFile::OpenMemory(const byte* base,
334 std::unique_ptr<DexFile> dex_file(
335 new DexFile(base, size, location, location_checksum, mem_map, oat_file));
343 DexFile::DexFile(const byte* base, size_t size,
362 build_class_def_index_mutex_("DexFile index creation mutex"),
368 DexFile::~DexFile() {
377 bool DexFile::Init(std::string* error_msg) {
384 bool DexFile::CheckMagicAndVersion(std::string* error_msg) const {
408 bool DexFile::IsMagicValid(const byte* magic) {
412 bool DexFile::IsVersionValid(const byte* magic) {
417 uint32_t DexFile::GetVersion() const {
422 const DexFile::ClassDef* DexFile::FindClassDef(const char* descriptor, size_t hash) const {
471 const DexFile::ClassDef* DexFile::FindClassDef(uint16_t type_idx) const {
482 const DexFile::FieldId* DexFile::FindFieldId(const DexFile::TypeId& declaring_klass,
483 const DexFile::StringId& name,
484 const DexFile::TypeId& type) const {
493 const DexFile::FieldId& field = GetFieldId(mid);
517 const DexFile::MethodId* DexFile::FindMethodId(const DexFile::TypeId& declaring_klass,
518 const DexFile::StringId& name,
519 const DexFile::ProtoId& signature) const {
528 const DexFile::MethodId& method = GetMethodId(mid);
552 const DexFile::StringId* DexFile::FindStringId(const char* string) const {
557 const DexFile::StringId& str_id = GetStringId(mid);
571 const DexFile::StringId* DexFile::FindStringId(const uint16_t* string) const {
576 const DexFile::StringId& str_id = GetStringId(mid);
590 const DexFile::TypeId* DexFile::FindTypeId(uint32_t string_idx) const {
607 const DexFile::ProtoId* DexFile::FindProtoId(uint16_t return_type_idx,
614 const DexFile::ProtoId& proto = GetProtoId(mid);
644 bool DexFile::CreateTypeList(const StringPiece& signature, uint16_t* return_type_idx,
678 const DexFile::StringId* string_id = FindStringId(descriptor.c_str());
682 const DexFile::TypeId* type_id = FindTypeId(GetIndexForStringId(*string_id));
697 const Signature DexFile::CreateSignature(const StringPiece& signature) const {
711 int32_t DexFile::GetLineNumFromPC(mirror::ArtMethod* method, uint32_t rel_pc) const {
728 int32_t DexFile::FindTryItem(const CodeItem &code_item, uint32_t address) {
736 const art::DexFile::TryItem* ti = GetTryItems(code_item, mid);
752 int32_t DexFile::FindCatchHandlerOffset(const CodeItem &code_item, uint32_t address) {
757 return DexFile::GetTryItems(code_item, try_item)->handler_off_;
761 void DexFile::DecodeDebugInfo0(const CodeItem* code_item, bool is_static, uint32_t method_idx,
924 void DexFile::DecodeDebugInfo(const CodeItem* code_item, bool is_static, uint32_t method_idx,
940 bool DexFile::LineNumForPcCb(void* raw_context, uint32_t address, uint32_t line_num) {
956 bool DexFile::IsMultiDexLocation(const char* location) {
960 DexFile::GetMultiDexClassesDexName(size_t number, const char* dex_location) {
968 std::string DexFile::GetDexCanonicalLocation(const char* dex_location) {
983 std::ostream& operator<<(std::ostream& os, const DexFile& dex_file) {
984 os << StringPrintf("[DexFile: %s dex-checksum=%08x location-checksum=%08x %p-%p]",
996 const DexFile::TypeList* params = dex_file_->GetProtoParameters(*proto_id_);
1020 const DexFile::TypeList* params = dex_file_->GetProtoParameters(*proto_id_);
1121 EncodedStaticFieldValueIterator::EncodedStaticFieldValueIterator(const DexFile& dex_file,
1125 const DexFile::ClassDef& class_def)
1231 CatchHandlerIterator::CatchHandlerIterator(const DexFile::CodeItem& code_item, uint32_t address) {
1240 const DexFile::TryItem* tries = DexFile::GetTryItems(code_item, 0);
1251 offset = DexFile::FindCatchHandlerOffset(code_item, address);
1256 CatchHandlerIterator::CatchHandlerIterator(const DexFile::CodeItem& code_item,
1257 const DexFile::TryItem& try_item) {
1262 void CatchHandlerIterator::Init(const DexFile::CodeItem& code_item,
1265 Init(DexFile::GetCatchHandlerData(code_item, offset));
1300 handler_.type_idx_ = DexFile::kDexNoIndex16;