summaryrefslogtreecommitdiff
path: root/src/format/dex/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/dex/class.c')
-rw-r--r--src/format/dex/class.c16
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;