mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 18:28:59 +03:00
Push fix
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
05425c0444
commit
8b923ad8e7
2 changed files with 5 additions and 45 deletions
|
@ -76,7 +76,7 @@ public class PushUtils {
|
|||
|
||||
private static ArbitraryDataProvider arbitraryDataProvider;
|
||||
|
||||
private static String generateSHA512Hash(String pushToken) {
|
||||
public static String generateSHA512Hash(String pushToken) {
|
||||
MessageDigest messageDigest = null;
|
||||
try {
|
||||
messageDigest = MessageDigest.getInstance("SHA-512");
|
||||
|
@ -88,7 +88,7 @@ public class PushUtils {
|
|||
return "";
|
||||
}
|
||||
|
||||
private static String bytesToHex(byte[] bytes) {
|
||||
public static String bytesToHex(byte[] bytes) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (byte individualByte : bytes) {
|
||||
result.append(Integer.toString((individualByte & 0xff) + 0x100, 16)
|
||||
|
@ -96,7 +96,7 @@ public class PushUtils {
|
|||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
|
||||
private static int generateRsa2048KeyPair() {
|
||||
String keyPath = MainApp.getStoragePath() + File.separator + MainApp.getDataFolder() + File.separator
|
||||
+ KEYPAIR_FOLDER;
|
||||
|
@ -241,31 +241,11 @@ public class PushUtils {
|
|||
remoteOperationResult = registerAccountDeviceForProxyOperation.execute(mClient);
|
||||
|
||||
if (remoteOperationResult.isSuccess()) {
|
||||
<<<<<<< Updated upstream
|
||||
PushResponse pushResponse = remoteOperationResult.getPushResponseData();
|
||||
|
||||
RemoteOperation registerAccountDeviceForProxyOperation = new
|
||||
RegisterAccountDeviceForProxyOperation(
|
||||
context.getResources().getString(R.string.push_server_url),
|
||||
token, pushResponse.getDeviceIdentifier(), pushResponse.getSignature(),
|
||||
pushResponse.getPublicKey());
|
||||
|
||||
remoteOperationResult = registerAccountDeviceForProxyOperation.execute(mClient);
|
||||
|
||||
if (remoteOperationResult.isSuccess()) {
|
||||
PushConfigurationState pushArbitraryData = new PushConfigurationState(token,
|
||||
pushResponse.getDeviceIdentifier(), pushResponse.getSignature(),
|
||||
pushResponse.getPublicKey(), false);
|
||||
arbitraryDataProvider.storeOrUpdateKeyValue(account, KEY_PUSH,
|
||||
gson.toJson(pushArbitraryData));
|
||||
}
|
||||
=======
|
||||
PushConfigurationState pushArbitraryData = new PushConfigurationState(token,
|
||||
pushResponse.getDeviceIdentifier(), pushResponse.getSignature(),
|
||||
pushResponse.getPublicKey(), false);
|
||||
arbitraryDataProvider.storeOrUpdateKeyValue(account.name, KEY_PUSH,
|
||||
arbitraryDataProvider.storeOrUpdateKeyValue(account, KEY_PUSH,
|
||||
gson.toJson(pushArbitraryData));
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
}
|
||||
} catch (com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException e) {
|
||||
|
|
|
@ -241,31 +241,11 @@ public class PushUtils {
|
|||
remoteOperationResult = registerAccountDeviceForProxyOperation.execute(mClient);
|
||||
|
||||
if (remoteOperationResult.isSuccess()) {
|
||||
<<<<<<< Updated upstream
|
||||
PushResponse pushResponse = remoteOperationResult.getPushResponseData();
|
||||
|
||||
RemoteOperation registerAccountDeviceForProxyOperation = new
|
||||
RegisterAccountDeviceForProxyOperation(
|
||||
context.getResources().getString(R.string.push_server_url),
|
||||
token, pushResponse.getDeviceIdentifier(), pushResponse.getSignature(),
|
||||
pushResponse.getPublicKey());
|
||||
|
||||
remoteOperationResult = registerAccountDeviceForProxyOperation.execute(mClient);
|
||||
|
||||
if (remoteOperationResult.isSuccess()) {
|
||||
PushConfigurationState pushArbitraryData = new PushConfigurationState(token,
|
||||
pushResponse.getDeviceIdentifier(), pushResponse.getSignature(),
|
||||
pushResponse.getPublicKey(), false);
|
||||
arbitraryDataProvider.storeOrUpdateKeyValue(account, KEY_PUSH,
|
||||
gson.toJson(pushArbitraryData));
|
||||
}
|
||||
=======
|
||||
PushConfigurationState pushArbitraryData = new PushConfigurationState(token,
|
||||
pushResponse.getDeviceIdentifier(), pushResponse.getSignature(),
|
||||
pushResponse.getPublicKey(), false);
|
||||
arbitraryDataProvider.storeOrUpdateKeyValue(account.name, KEY_PUSH,
|
||||
arbitraryDataProvider.storeOrUpdateKeyValue(account, KEY_PUSH,
|
||||
gson.toJson(pushArbitraryData));
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
}
|
||||
} catch (com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException e) {
|
||||
|
|
Loading…
Reference in a new issue