mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
The salt and token are now calculated at each new access starting from the password saved in the database, based on the type of access
This commit is contained in:
parent
cc9afb8057
commit
d408b82503
4 changed files with 38 additions and 38 deletions
|
|
@ -50,12 +50,18 @@ public class App extends Application {
|
|||
String password = PreferenceUtil.getInstance(context).getPassword();
|
||||
String token = PreferenceUtil.getInstance(context).getToken();
|
||||
String salt = PreferenceUtil.getInstance(context).getSalt();
|
||||
boolean isLowSecurity = PreferenceUtil.getInstance(context).isLowScurity();
|
||||
|
||||
SubsonicPreferences preferences = new SubsonicPreferences();
|
||||
preferences.setServerUrl(server);
|
||||
preferences.setUsername(username);
|
||||
preferences.setPassword(password);
|
||||
preferences.setAuthentication(password, token, salt);
|
||||
preferences.setAuthentication(password, token, salt, isLowSecurity);
|
||||
|
||||
if (preferences.getAuthentication() != null) {
|
||||
if (preferences.getAuthentication().getPassword() != null) PreferenceUtil.getInstance(context).setPassword(preferences.getAuthentication().getPassword());
|
||||
if (preferences.getAuthentication().getToken() != null) PreferenceUtil.getInstance(context).setToken(preferences.getAuthentication().getToken());
|
||||
if (preferences.getAuthentication().getSalt() != null) PreferenceUtil.getInstance(context).setSalt(preferences.getAuthentication().getSalt());
|
||||
}
|
||||
|
||||
return new Subsonic(context, preferences);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue