summaryrefslogtreecommitdiff
path: root/plugins/readdex
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-05-04 17:56:33 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-05-04 17:57:10 (GMT)
commitb92a5e56de9198c08956ce486cd12712d7034731 (patch)
tree4ee902ed116b9988dfd284186c725f1bb1d20f22 /plugins/readdex
parentc9f7b4491b368f886b0852ba166cef969fd6d20f (diff)
Created a GLib object for the Dex pool.
Diffstat (limited to 'plugins/readdex')
-rw-r--r--plugins/readdex/class.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/readdex/class.c b/plugins/readdex/class.c
index c414821..4bfdbb5 100644
--- a/plugins/readdex/class.c
+++ b/plugins/readdex/class.c
@@ -25,7 +25,7 @@
#include <i18n.h>
-#include <plugins/dex/class.h>
+#include <plugins/dex/pool.h>
#include <plugins/dex/dex_def.h>
#include <plugins/fmtp/parser.h>
@@ -265,6 +265,8 @@ bool annotate_dex_class_defs(const GDexFormat *format, GPreloadInfo *info, GtkSt
bool result; /* Bilan à retourner */
const dex_header *header; /* En-tête principale */
vmpa2t pos; /* Tête de lecture des symboles*/
+ GDexPool *pool; /* Table de ressources */
+ uint32_t count; /* Nombre de classes présentes */
activity_id_t msg; /* Message de progression */
GBinFormat *bformat; /* Autre version du format */
uint32_t i; /* Boucle de parcours */
@@ -278,19 +280,22 @@ bool annotate_dex_class_defs(const GDexFormat *format, GPreloadInfo *info, GtkSt
if (!result)
goto adcd_exit;
- msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Dex classes..."),
- header->class_defs_size);
+ pool = g_dex_format_get_pool(format);
+
+ count = g_dex_pool_count_classes(pool);
+
+ msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Dex classes..."), count);
bformat = G_BIN_FORMAT(format);
- for (i = 0; i < header->class_defs_size && result; i++)
+ for (i = 0; i < count && result; i++)
{
result = parse_field_definitions(PARSING_DEFS(_dex_class_defs), bformat, info, &pos, NULL);
if (!result) break;
/* Annotations supplémentaires */
- class = g_dex_format_get_class(format, i);
+ class = g_dex_pool_get_class(pool, i);
def = g_dex_class_get_definition(class);
@@ -305,6 +310,8 @@ bool annotate_dex_class_defs(const GDexFormat *format, GPreloadInfo *info, GtkSt
gtk_status_stack_remove_activity(status, msg);
+ g_object_unref(G_OBJECT(pool));
+
adcd_exit:
return result;