scottyab / secure-preferences

Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure.
1.53k stars 235 forks source link

Import secure-preferences v0.1.6 as module #77

Open rezastallone opened 6 years ago

rezastallone commented 6 years ago

I am trying to update the library from v0.1.4 to v0.1.6, but it seems the latest version on maven repository is v0.1.4, I am trying to add the library as module but have not succeeded, can anyone help me out ?

niqdev commented 6 years ago

@rezastallone as mentioned in #38 you should use jitpack

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}

implementation 'com.github.scottyab:secure-preferences:v0.1.6'
oseparovic commented 6 years ago

I tried using Jitpack and when I update my dependency to either version v0.1.5 or v0.1.6 I seem to lose my stored data to when installing overtop of 0.1.4. Is this expected @niqdev? I saw some commits that looks like the encryption was changed for 0.1.5

niqdev commented 6 years ago

@oseparovic this is how I fix it in my project, unfortunately I had to "keep" that bug to maintain compatibility

oseparovic commented 6 years ago

@niqdev thanks for the quick answer and explanation. I guess that means my secure prefs right now are stored in a file called \<obfuscatedKey> with passkey \<preferencesName.xml>

niqdev commented 6 years ago

I'm not sure, but what I remember when I figure out the issue in my case is that between 0.1.4 and 0.16 the obfuscated text was much shorter in the former and I think it was due to the way I invoked the constructor, just try to switch between the versions and look at the preferences in the emulator