优化加密功能

This commit is contained in:
TonyJiangWJ 2022-01-25 20:11:28 +08:00
parent 6f124ded16
commit 11dc904012

View File

@ -3,6 +3,7 @@ package com.tony.autojs.tool.encrypt;
import android.app.Activity;
import android.content.Context;
import android.util.Base64;
import com.stardust.autojs.execution.ExecutionConfig;
import com.stardust.autojs.runtime.api.Engines;
@ -100,4 +101,15 @@ public class DecryptRunner {
public void setSecretKey(SecretKey secretKey) {
this.secretKey = secretKey;
}
public void setSecretKeyByBase64(String base64Key) {
this.secretKey = AESEncrypt.loadKeyByBytes(Base64.decode(base64Key, Base64.NO_WRAP));
}
public String getSecretKeyBase64() {
if (this.secretKey == null) {
return null;
}
return Base64.encodeToString(this.secretKey.getEncoded(), Base64.NO_WRAP);
}
}