Android Google playstore gson从gson序列化Differs从本地安装序列化
我有这门课Android Google playstore gson从gson序列化Differs从本地安装序列化,android,gson,Android,Gson,我有这门课 public class _CtV3 { private long _ct_id; private String _ct_eml; private int _ct_lst; private int _ct_til; private String _ct_gid; private int _ct_ntr; private int _ct_nle; private int _ct_nlm;
public class _CtV3 {
private long _ct_id;
private String _ct_eml;
private int _ct_lst;
private int _ct_til;
private String _ct_gid;
private int _ct_ntr;
private int _ct_nle;
private int _ct_nlm;
private String _ct_uui;
public _CtV3(long ct_id, String ct_eml, int ct_lst, int ct_til, String ct_gid, int ct_ntr, int ct_nle, int ct_nlm, String ct_uui) {
this._ct_id = ct_id;
this._ct_eml = ct_eml;
this._ct_lst = ct_lst;
this._ct_til = ct_til;
this._ct_gid = ct_gid;
this._ct_ntr = ct_ntr;
this._ct_nle = ct_nle;
this._ct_nlm = ct_nlm;
this._ct_uui = ct_uui;
}
...
}
在某种程度上,它是用Gson序列化的,带有
String uuid = UUID.randomUUID().toString();
ctV3 = new _CtV3(0, "", 0, 0, "", 0, -1, 0, uuid);
GsonBuilder builder = new GsonBuilder();
Gson gson = builder.create();
String dec = gson.toJson(ctV3);
Log.d(TAG, dec);
现在问题来了。如果我直接从android Studio安装到android手机上,一切正常,日志返回
{"_ct_eml":"","_ct_gid":"","_ct_id":0,"_ct_lst":0,"_ct_nle":-1,"_ct_nlm":0,"_ct_ntr":0,"_ct_til":0,"_ct_uui":"f0438604-a22b-44d3-bb4b-9303a828b0f9"}
{"a":0,"b":"","c":0,"d":0,"e":0,"f":-1,"g":0,"h":"19ff09be-07d1-411d-a625-bcf4b574abec"}
如果我从Google PlayStore在同一部手机上安装,会返回相同的日志
{"_ct_eml":"","_ct_gid":"","_ct_id":0,"_ct_lst":0,"_ct_nle":-1,"_ct_nlm":0,"_ct_ntr":0,"_ct_til":0,"_ct_uui":"f0438604-a22b-44d3-bb4b-9303a828b0f9"}
{"a":0,"b":"","c":0,"d":0,"e":0,"f":-1,"g":0,"h":"19ff09be-07d1-411d-a625-bcf4b574abec"}
上个月,我上次升级是在9月初。这个问题出现了。你的应用程序是否启用了proguard?@Swayangjit是的,是的。我想你明白了。不是proguard而是“minifyEnabled=true”;我几乎没有考虑后果就启用了它。请检查此项并将其应用到progurad-rules.pro文件中。