Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on android 7 and lower #508

Closed
laxuscullen opened this issue Apr 3, 2022 · 2 comments
Closed

Crash on android 7 and lower #508

laxuscullen opened this issue Apr 3, 2022 · 2 comments

Comments

@laxuscullen
Copy link

laxuscullen commented Apr 3, 2022

I have read the open and closed issues regarding this but I am still very lost. I am using java. I need to only decrypt the cipher in android.

Crash error:
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/util/Base64;

Code:

final Key keyEn = new Key(keyString);
final Token token = Token.fromString(encryptedString);
final Validator < String > validator = new StringValidator() {
    public TemporalAmount getTimeToLive() {
        return Duration.ofSeconds(Instant.MAX.getEpochSecond());
    }
};

mediaUrl = token.validateAndDecrypt(keyEn, validator);

It works fin above 7 but crashes instantly on first line in android 7 and lower. I could really use some help on this, if possible. Thank you so much!

@laxuscullen
Copy link
Author

@l0s sorry for bothering mate, I am in a pinch here and you are the only one who can help. So trying my luck for the last time by tagging you. Apologies once again.

@l0s
Copy link
Owner

l0s commented Apr 5, 2022

@laxuscullen you won't be able to use any of the methods that accept a base64-encoded String. Instead, you'll need to use the Android-native utility to convert the base64 String into a byte array, then use the corresponding byte array methods. See the example I provided here: #478 (comment) .

If you still have issues, can you share a minimal working project that reproduces the problem?

@l0s l0s closed this as completed Aug 27, 2022
@l0s l0s closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants