orhanobut / hawk

✔️ Secure, simple key-value storage for Android
Apache License 2.0
3.98k stars 388 forks source link

can't get data when overriding apps #244

Open jynd opened 2 years ago

jynd commented 2 years ago

Please try to fill all questions below before submitting an issue.

i am using Hawk in a project (A), it's publishing in google play. Now, i created another project (B), I let the appId of 2 projects overlap, I increased the version code and version name on B, B can override A but B can't get data in A.

in project A, i saved String by Hawk, when B override A, B can read this data, but when i save object in A, B can't read it. What have i do?

Thanks

MS0054 commented 2 years ago

I have exactly the same problem when i try to update app to new version، that's how it was

On which android versions do you have this issue? : every version On which phones do you have this issue? : every phones Which hawk version are you using? : 2.0.1 Does this issue happen always or is it flaky? : in latest update of app happend Can you write failing test? : no If it is Hawk.put and Hawk.get issue, can you write down which data you were trying to save and get it back? simple pojo Is the data you are trying to save it huge or small? small


this is my pojo

public class TokenRes {

@SerializedName("token_type")
@Expose
public String tokenType;
@SerializedName("expires_in")
@Expose
public String expiresIn;
@SerializedName("access_token")
@Expose
public String accessToken;
@SerializedName("refresh_token")
@Expose
public String refreshToken;

}

When will this problem be solved? Or is there at least one solution right now? I encountered this strange problem just when the new version was delivered, and I have very little time

jynd commented 2 years ago

I have exactly the same problem when i try to update app to new version، that's how it was

On which android versions do you have this issue? : every version On which phones do you have this issue? : every phones Which hawk version are you using? : 2.0.1 Does this issue happen always or is it flaky? : in latest update of app happend Can you write failing test? : no If it is Hawk.put and Hawk.get issue, can you write down which data you were trying to save and get it back? simple pojo Is the data you are trying to save it huge or small? small

this is my pojo

public class TokenRes {

@SerializedName("token_type")
@Expose
public String tokenType;
@SerializedName("expires_in")
@Expose
public String expiresIn;
@SerializedName("access_token")
@Expose
public String accessToken;
@SerializedName("refresh_token")
@Expose
public String refreshToken;

}

When will this problem be solved? Or is there at least one solution right now? I encountered this strange problem just when the new version was delivered, and I have very little time

I fixed this problem. my solution was to clone the hawk project and copy all the code into my project then i edited the code in it. I found the problem where the hawk library decryption key, I skipped the encryption and decryption step.