小编Gag*_*yan的帖子

javax.crypto.BadPaddingException:填充块有时会损坏

我有以下加密代码

public static String encrypt(String value, char[] secret) {
        try {
            final byte[] bytes = value != null ? value.getBytes(StandardCharsets.UTF_8) : new byte[0];
            SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
            SecretKey key = keyFactory.generateSecret(new PBEKeySpec(secret));
            Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
            pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(IsoGame.$().crossPlatformManager.getCrossPlatformUtilsInstance().getDeviceUniqueIdentifier().getBytes(StandardCharsets.UTF_8), 20));
            return new String(Base64.encodeBase64(pbeCipher.doFinal(bytes)), StandardCharsets.UTF_8);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return value;

    }
Run Code Online (Sandbox Code Playgroud)

以及以下解密代码。

public static String decrypt(String value, char[] secret) {
        try {
            final byte[] bytes = value != null ? Base64.decodeBase64(value.getBytes(StandardCharsets.UTF_8)) : new byte[0];
            SecretKeyFactory keyFactory …
Run Code Online (Sandbox Code Playgroud)

java encryption cryptography sharedpreferences

7
推荐指数
1
解决办法
2万
查看次数

架构arm64的未定义符号:无法构建RoboVM/LibGDX项目

当我尝试在我的 ios 设备上构建 roboVM/libgdx 应用程序时,我看到以下错误。

[ERROR] 13:49:29.414 Undefined symbols for architecture arm64:
[ERROR] 13:49:29.414   "_OBJC_CLASS_$_GADInterstitial", referenced from:
[ERROR] 13:49:29.415       objc-class-ref in libGGLAdMob.a(GGLContext+AdMob.o)
[ERROR] 13:49:29.721   "_OBJC_CLASS_$_GADBannerView", referenced from:
[ERROR] 13:49:29.722       objc-class-ref in libGGLAdMob.a(GGLContext+AdMob.o)
[ERROR] 13:49:30.362 ld: symbol(s) not found for architecture arm64
[ERROR] 13:49:30.458 clang: error: linker command failed with exit code 1 (use -v to see invocation)
[ERROR] Couldn't compile app
org.apache.commons.exec.ExecuteException: Command '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o /Users/gag/StudioProjects/OlympusNew/ios/robovm-build/tmp/iOS/ios/arm64/IsoGameLauncher -arch arm64 -Wl,-filelist,/Users/gag/StudioProjects/OlympusNew/ios/robovm-build/tmp/iOS/ios/arm64/objects0 -w -L /Users/gag/.robovm-sdks/robovm-2.3.6/lib/vm/ios/arm64 -ObjC -Xlinker -alias_list -Xlinker /Users/gag/StudioProjects/OlympusNew/ios/robovm-build/tmp/iOS/ios/arm64/aliased_symbols -exported_symbols_list /Users/gag/StudioProjects/OlympusNew/ios/robovm-build/tmp/iOS/ios/arm64/exported_symbols -Wl,-no_implicit_dylibs …
Run Code Online (Sandbox Code Playgroud)

java ios libgdx robovm mobivm

5
推荐指数
1
解决办法
737
查看次数