| | |
| | | package com.auto.lyric.retrofit.converter; |
| | | |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | |
| | | import com.auto.lyric.data.BaseApiResult; |
| | |
| | | response = decryptJsonStr(val);//解密 |
| | | } catch (NoSuchAlgorithmException | InvalidKeySpecException e) { |
| | | e.printStackTrace(); |
| | | BaseApiResult apiResult = new BaseApiResult<>(); |
| | | apiResult.code = 412; |
| | | apiResult.msg = "解密数据出错"+e.getMessage(); |
| | | BaseApiResult apiResult = new BaseApiResult(); |
| | | apiResult.result = "412"; |
| | | apiResult.reason = "解密数据出错"+e.getMessage(); |
| | | response = new Gson().toJson(apiResult); |
| | | } catch (JSONException e) { |
| | | e.printStackTrace(); |
| | | BaseApiResult apiResult = new BaseApiResult<>(); |
| | | apiResult.code = 414; |
| | | apiResult.msg = "非标准json"; |
| | | BaseApiResult apiResult = new BaseApiResult(); |
| | | apiResult.result = "414"; |
| | | apiResult.reason = "非标准json"; |
| | | response = new Gson().toJson(apiResult); |
| | | }catch (Exception e){ |
| | | JsonReader jsonReader = gson.newJsonReader(value.charStream()); |
| | |
| | | JSONObject json = new JSONObject(body); |
| | | body = json.toString(); |
| | | //body = RSAUtils.decrypt(json.getString(ENCRYPT), RSAUtils.getPublicKey(RSAUtils.PUBLIC_KEY));// |
| | | }else if(TextUtils.isEmpty(body)){ |
| | | return body; |
| | | } |
| | | return transHump? GsonUtils.toHumpJson(body):body; |
| | | } |