Konloch/bytecode-viewer · error · RuntimeException

Unknown implementation

Error message

Unknown implementation

What it means

This RuntimeException is thrown by Bytecode Viewer's Apk2Jar utility when the APK-to-JAR conversion routine cannot determine which converter implementation to use. The method checks the GUI radio buttons 'apkConversionDex' and 'apkConversionEnjarify' in the settings/viewer panel; if neither model is selected, no known converter matches and it fails. It effectively signals an inconsistent or uninitialized UI selection state rather than a conversion failure.

Source

Thrown at src/main/java/the/bytecode/club/bytecodeviewer/util/apk2Jar/Apk2Jar.java:94

        synchronized (workLock) {
            apk2JarImpl(input, output);
        }
        return output;
    }

    protected abstract void apk2JarImpl(File input, File output);
    protected abstract void apk2FolderImpl(File input, File output);

    public static Apk2Jar obtainImpl() {
        MainViewerGUI viewer = BytecodeViewer.viewer;
        ButtonGroup apkConversionGroup = viewer.apkConversionGroup;

        if (apkConversionGroup.isSelected(viewer.apkConversionDex.getModel()))
            return new Dex2Jar();
        else if (apkConversionGroup.isSelected(viewer.apkConversionEnjarify.getModel()))
            return new Enjarify();

        throw new RuntimeException("Unknown implementation");
    }
}

View on GitHub (pinned to 31430e0033)

Solutions

  1. Ensure a default conversion option is selected at startup, e.g. viewer.apkConversionDex.setSelected(true) inside the ButtonGroup before any conversion runs
  2. Inspect the viewer panel state at the time of the error and confirm apkConversionDex or apkConversionEnjarify is actually in apkConversionGroup and selected
  3. If driving Bytecode Viewer programmatically, explicitly select one conversion mode before invoking the Apk2Jar flow
  4. Reinstall/restore a clean Bytecode Viewer configuration (delete overridden settings like the saved config XML) if a stale config left no radio selected
  5. Update Bytecode Viewer to the latest version if a regression in the settings panel left the group uninitialized

Example fix

// before
Apk2Jar.convert(...); // assumes a radio button is already selected

// after
if (!viewer.apkConversionDex.isSelected() && !viewer.apkConversionEnjarify.isSelected()) {
    viewer.apkConversionDex.setSelected(true); // enforce a default
}
Apk2Jar.convert(...);
Defensive patterns

Strategy: validation

Validate before calling

if (!viewer.apkConversionDex.isSelected() && !viewer.apkConversionEnjarify.isSelected()) {
    viewer.apkConversionDex.setSelected(true);
}
// now safe to run the APK-to-JAR conversion

Try / catch

try {
    Apk2Jar.convert(apkFile);
} catch (RuntimeException e) {
    if ("Unknown implementation".equals(e.getMessage())) {
        viewer.apkConversionDex.setSelected(true); // restore a default
        Apk2Jar.convert(apkFile); // retry once with the default converter
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling Apk2Jar.obtainImpl() (e.g. via the APK conversion flow) while neither the DEX nor Enjarify radio button (viewer.apkConversionDex / viewer.apkConversionEnjarify) is selected in the apkConversionGroup ButtonGroup; or programmatically constructing/clearing the ButtonGroup so no toggle is active before conversion starts.

Common situations: Headless/CLI usage or automation where the GUI settings panel was never initialized or defaults were removed; custom themes/plugins that reset ButtonGroup selection; saving/loading a config that clears the radio selection; code changes that renamed or replaced one of the toggle buttons so isSelected() checks miss.

Related errors


AI-assisted analysis of Konloch/bytecode-viewer@31430e0033 (2026-09-05). Data as JSON: /api/errors/b1b6749d0ed1ffe7. Report an issue: GitHub.