mkndx: support v3 packages

cute-signatures
Timo Teräs 2021-07-30 17:54:30 +03:00
parent f61eba0627
commit d3e71bb406
1 changed files with 14 additions and 0 deletions

View File

@ -176,8 +176,22 @@ static int mkndx_parse_v2meta(struct apk_extract_ctx *ectx, struct apk_istream *
return 0;
}
static int mkndx_parse_v3meta(struct apk_extract_ctx *ectx, struct adb *db)
{
struct mkndx_ctx *ctx = container_of(ectx, struct mkndx_ctx, ectx);
struct adb_obj obj;
adb_r_rootobj(db, &obj, &schema_package);
adb_val_t o = adb_wa_append(&ctx->pkgs,
adb_w_copy(&ctx->db, db, adb_ro_val(&obj, ADBI_PKG_PKGINFO)));
if (ADB_IS_ERROR(o)) return -ADB_VAL_VALUE(o);
return 0;
}
static const struct apk_extract_ops extract_ndxinfo_ops = {
.v2meta = mkndx_parse_v2meta,
.v3meta = mkndx_parse_v3meta,
};
static int mkndx_main(void *pctx, struct apk_ctx *ac, struct apk_string_array *args)