|
|
@@ -10,12 +10,11 @@ import com.android.volleyplus.ParseError;
|
|
|
import com.android.volleyplus.Request;
|
|
|
import com.android.volleyplus.Response;
|
|
|
import com.android.volleyplus.toolbox.HttpHeaderParser;
|
|
|
-import com.kfzs.appstore.utils.string.HexUtils;
|
|
|
import com.kfzs.duanduan.KFZSApp;
|
|
|
+import com.kfzs.duanduan.bean.BaseMsg;
|
|
|
import com.kfzs.duanduan.bll.UrlBll;
|
|
|
import com.kfzs.duanduan.datashare.DDProviderHelper;
|
|
|
import com.kfzs.duanduan.db.DataSave;
|
|
|
-import com.kfzs.duanduan.bean.BaseMsg;
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.util.HashMap;
|
|
|
@@ -23,6 +22,7 @@ import java.util.Map;
|
|
|
|
|
|
import go.kfzssafe.Kfzssafe;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* <pre>
|
|
|
* sinlov
|
|
|
@@ -65,8 +65,7 @@ public class APIRequestV2 extends Request<BaseMsg> {
|
|
|
@Override
|
|
|
public byte[] getBody() throws AuthFailureError {
|
|
|
if (null != bodyByte) {
|
|
|
- String hexStr = HexUtils.bytes2HexStr(Kfzssafe.XByteEncode(bodyByte));
|
|
|
- return hexStr.getBytes();
|
|
|
+ return Kfzssafe.xByteEncode(bodyByte);
|
|
|
} else {
|
|
|
return super.getBody();
|
|
|
}
|
|
|
@@ -77,10 +76,7 @@ public class APIRequestV2 extends Request<BaseMsg> {
|
|
|
try {
|
|
|
String hexString = new String(networkResponse.data,
|
|
|
HttpHeaderParser.parseCharset(networkResponse.headers));
|
|
|
- byte[] bytes = HexUtils.hexStr2Bytes(hexString);
|
|
|
- byte[] byteDecode = Kfzssafe.XByteDecode(bytes);
|
|
|
-
|
|
|
- BaseMsg apiResponse = JSON.parseObject(new String(byteDecode, "utf8"), BaseMsg.class);
|
|
|
+ BaseMsg apiResponse = JSON.parseObject(Kfzssafe.xDecodeS2B(hexString), BaseMsg.class);
|
|
|
return Response.success(apiResponse, HttpHeaderParser.parseCacheHeaders(networkResponse));
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
return Response.error(new ParseError(e));
|
|
|
@@ -88,6 +84,8 @@ public class APIRequestV2 extends Request<BaseMsg> {
|
|
|
return Response.error(new ParseError(e));
|
|
|
} catch (NumberFormatException e) {
|
|
|
return Response.error(new ParseError(e));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return Response.error(new ParseError(e));
|
|
|
}
|
|
|
}
|
|
|
|