if (MainLoginActivity.this.safeEditCipher == null) {
MainLoginActivity.this.safeEditCipher = ((Cipher)Encrypt.getRsaCipher());
}
str5 = RSA.encrypt(MainLoginActivity.this.mLoginPassword.getEncryptStr(), MainLoginActivity.this.safeEditCipher, Encrypt.getRsaKeyLen());
if (str5 == null) {
str5 = "";
}
字符串str5,RSA加密传递的三个参数,第一个是密码,第二个是一个Cipher的rsa对象,单独去调用这个getRsaCipher();没有返回值。
最后一个参数的对象调用的Encrypt.getRsaKeyLen()这个方法也是没有返回值。。起了怪。。求大神解答...用易虚拟机来实现的..
附上:Encrypt类..里面的一些的方法参数都是空的,就是调用时候的没有返回值。
package com.microsoft;
import android.content.Context;
import android.util.Log;
import java.io.File;
public class Encrypt
{
private static int g_iLoad = -1;
private static final String g_sName = "Encrypt";
public static String getCRuleAndVersion()
{
return getChangeRule() + "#" + "1";
}
public static native String getChangeRule();
public static native int getCodeLenByPos(int paramInt);
public static native String getDeviceName();
public static native byte[] getHardId(Context paramContext);
public static native Object getKeys();
public static native Object getLoadLibrary();
public static native String getMapping(int paramInt, String paramString);
public static native Object getRsaCipher();
public static native int getRsaKeyLen();
public static native String getRule();
public static native boolean initDefaultRules(String paramString);
public static native boolean initEncrypt(String paramString);
public static boolean initialize(String paramString)
{
boolean bool = true;
if (g_iLoad >= 0) {
if (g_iLoad == 0) {}
}
for (;;)
{
return bool;
bool = false;
continue;
try
{
String str = paramString + "/lib" + "Encrypt" + ".so";
if (new File(str).exists()) {
System.load(str);
}
for (;;)
{
g_iLoad = 1;
if (g_iLoad != 0) {
break;
}
bool = false;
break;
System.loadLibrary("Encrypt");
}
}
catch (UnsatisfiedLinkError localUnsatisfiedLinkError)
{
for (;;)
{
g_iLoad = 0;
Log.d("Encrypt", "link:" + localUnsatisfiedLinkError.getMessage());
}
}
}
}
public static native boolean isDebug();
public static String safe_Decrypt(String paramString1, String paramString2, int paramInt)
{
try
{
decodeSoftKeyBoardRule localdecodeSoftKeyBoardRule = new decodeSoftKeyBoardRule();
String str2 = getRule();
String str3 = getChangeRule();
localdecodeSoftKeyBoardRule.initRules(str2);
localdecodeSoftKeyBoardRule.initChangeKeyCode(str3);
str1 = localdecodeSoftKeyBoardRule.decodeByRule(paramString1);
localdecodeSoftKeyBoardRule.cleanMemory();
return str1;
}
catch (Exception localException)
{
for (;;)
{
String str1 = null;
}
}
}
public static native String safe_Encrypt(String paramString1, String paramString2);
}