mzte-nv: use cfr as java decompiler

This commit is contained in:
LordMZTE 2023-10-28 18:42:41 +02:00
parent b9e8924ec1
commit 0c9da40b29
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -103,15 +103,15 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int {
// bundles
c.lua_newtable(l);
var has_procyon = false;
var has_cfr = false;
var iter = dir.iterate();
var idx: c_int = 1;
while (try iter.next()) |f| {
if (f.kind != .file or !std.mem.endsWith(u8, f.name, ".jar"))
continue;
if (!has_procyon and std.mem.containsAtLeast(u8, f.name, 1, "procyon"))
has_procyon = true;
if (!has_cfr and std.mem.containsAtLeast(u8, f.name, 1, "cfr"))
has_cfr = true;
const path = try std.fs.path.joinZ(std.heap.c_allocator, &.{ bundle_path, f.name });
defer std.heap.c_allocator.free(path);
@ -126,8 +126,8 @@ fn lGetBundleInfo(l: *c.lua_State) !c_int {
// content_provider
c.lua_newtable(l);
if (has_procyon) {
c.lua_pushstring(l, "procyon");
if (has_cfr) {
c.lua_pushstring(l, "cfr");
c.lua_setfield(l, -2, "preferred");
}