diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-05-16 21:56:55 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-05-16 21:56:55 (GMT) |
commit | 4691a434a34a19317156a761967f719e408b73bb (patch) | |
tree | 1daaf5be5d4a9f52d492380c2862580129d2ad12 /src/format/dex/class.c | |
parent | 1996274a43883aa58e8c565f7698bc7c338a9ce0 (diff) |
Merged routines into symbols.
Diffstat (limited to 'src/format/dex/class.c')
-rw-r--r-- | src/format/dex/class.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/format/dex/class.c b/src/format/dex/class.c index 897720a..eb2ba3f 100644 --- a/src/format/dex/class.c +++ b/src/format/dex/class.c @@ -196,11 +196,11 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def) vmpa2t addr; /* Tête de lecture générique */ class_data_item data; /* Contenu de la classe */ GDataType *ctype; /* Type créé par la classe */ + GBinFormat *base; /* Autre version du format */ uleb128_t index; /* Conservation du dernier id */ uleb128_t i; /* Boucle de parcours */ GDexMethod *method; /* Méthode chargée */ GBinRoutine *routine; /* Version interne de méthode */ - GBinSymbol *symbol; /* Nouveau symbole construit */ result = g_object_new(G_TYPE_DEX_CLASS, NULL); @@ -235,6 +235,8 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def) ctype = get_type_from_dex_pool(format, def->class_idx); assert(ctype != NULL); + base = G_BIN_FORMAT(format); + index = 0; result->dmethods_count = data.direct_methods_size; @@ -255,10 +257,7 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def) g_object_ref(G_OBJECT(ctype)); g_binary_routine_set_namespace(routine, ctype, "."); - symbol = g_binary_symbol_new(STP_ROUTINE); - g_binary_symbol_attach_routine(symbol, routine); - - g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol); + g_binary_format_add_symbol(base, G_BIN_SYMBOL(routine)); } @@ -284,10 +283,7 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def) g_object_ref(G_OBJECT(ctype)); g_binary_routine_set_namespace(routine, ctype, "."); - symbol = g_binary_symbol_new(STP_ROUTINE); - g_binary_symbol_attach_routine(symbol, routine); - - g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol); + g_binary_format_add_symbol(base, G_BIN_SYMBOL(routine)); } @@ -493,7 +489,7 @@ const char *g_dex_class_get_source_file(const GDexClass *class, const GDexFormat { const char *result; /* Trouvaille à renvoyer */ - result = get_string_from_dex_pool(format, class->definition.source_file_idx); + result = get_string_from_dex_pool(format, class->definition.source_file_idx, NULL); return result; |