MuntashirAkon/AppManager · warning · java.io.IOException

Invalid SSAID size ${length}

Error message

Invalid SSAID size ${length}

What it means

IOException thrown when the entered SSAID's character count does not equal sizeByte * 2 (each byte is two hex characters). The dialog validates the length of the user-supplied SSAID before writing it, since Android requires the value to match the exact byte size of the original identifier.

Source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/ssaid/ChangeSsaidDialog.java:101

        TextInputEditText ssaidEditText = view.findViewById(android.R.id.text1);
        TextInputLayout ssaidInputLayout = view.findViewById(R.id.ssaid_layout);
        AtomicReference<Button> applyButton = new AtomicReference<>();
        AtomicReference<Button> resetButton = new AtomicReference<>();

        alertDialog.setOnShowListener(dialog -> {
            applyButton.set(alertDialog.getButton(AlertDialog.BUTTON_POSITIVE));
            resetButton.set(alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL));
            applyButton.get().setVisibility(View.GONE);
            applyButton.get().setOnClickListener(v -> {
                mSsaidChangedResult = ThreadUtils.postOnBackgroundThread(() -> {
                    try {
                        Editable editable = ssaidEditText.getText();
                        if (editable == null) {
                            throw new IOException("Empty SSAID field.");
                        }
                        mSsaid = editable.toString();
                        if (mSsaid.length() != sizeByte * 2) {
                            throw new IOException("Invalid SSAID size " + mSsaid.length());
                        }
                        if (!mSsaid.matches("[0-9A-Fa-f]+")) {
                            throw new IOException("Invalid SSAID " + mSsaid.length());
                        }
                        SsaidSettings ssaidSettings = new SsaidSettings(UserHandleHidden.getUserId(uid));
                        boolean isSuccess = ssaidSettings.setSsaid(packageName, uid, mSsaid);
                        if (isSuccess) {
                            alertDialog.dismiss();
                        }
                        if (mSsaidChangedInterface != null) {
                            ThreadUtils.postOnMainThread(() -> mSsaidChangedInterface.onSsaidChanged(mSsaid, isSuccess));
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                        if (mSsaidChangedInterface != null) {
                            ThreadUtils.postOnMainThread(() -> mSsaidChangedInterface.onSsaidChanged(mSsaid, false));
                        }
                    }

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Enter the full SSAID hex string — exactly sizeByte*2 characters (typically 16)
  2. Show the expected length in the dialog's helper text or input filter (set a LengthFilter of sizeByte*2)
  3. Trim whitespace before the length check so stray spaces don't cause a false failure
  4. Catch the IOException in the background task and display a message telling the user the required length

Example fix

// before
if (mSsaid.length() != sizeByte * 2) {
    throw new IOException("Invalid SSAID size " + mSsaid.length());
}
// after
mSsaid = mSsaid.trim();
if (mSsaid.length() != sizeByte * 2) {
    ssaidEditText.setError(getContext().getString(R.string.invalid_ssaid_size, sizeByte * 2));
    return null;
}
Defensive patterns

Strategy: validation

Validate before calling

String text = ssaidEditText.getText().toString().trim();
int expected = sizeByte * 2;
if (text.length() != expected) {
    ssaidEditText.setError("Expected " + expected + " hex chars, got " + text.length());
    return;
}

Type guard

boolean isValidSsaidLength(String s, int sizeByte) { return s.trim().length() == sizeByte * 2; }

Try / catch

try {
    applySsaid();
} catch (IOException e) {
    ssaidEditText.setError(context.getString(R.string.invalid_ssaid_size, sizeByte * 2));
}

Prevention

When it happens

Trigger: Typing or pasting a truncated/padded SSAID into ssaidEditText so that mSsaid.length() != sizeByte * 2, then pressing Apply; sizeByte is set per-package/user from the existing SSAID, so any copied value with missing or extra hex digits triggers this.

Common situations: Copy-paste cutting off part of the hex string; user manually typing the identifier and dropping digits; mismatched expectation for devices where SSAID is 8 bytes (16 hex chars) vs another length.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/1c9a1f16406fe5a3. Report an issue: GitHub.