Skip to content

Commit

Permalink
docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarBasem committed Jul 17, 2021
1 parent 0dd2cab commit 4db7e9e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 31 deletions.
Binary file modified android/.idea/caches/build_file_checksums.ser
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies {
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

api 'com.github.STiiiCK:sticky-signal-protocol-java:2.8.9'
api 'com.github.STiiiCK:sticky-signal-protocol-java:2.8.11'
api 'org.signal:argon2:13.1@aar'
api 'net.zetetic:android-database-sqlcipher:4.3.0'
implementation 'com.stiiick:encoding:1.0.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ public boolean containsSignedPreKey(int signedPreKeyId) {
}

@Override
public void removePreKey(int preKeyId) {
DatabaseFactory.getPreKeyDatabase(context).removePreKey(preKeyId);
}
public void removePreKey(int preKeyId) {}

@Override
public void removeSignedPreKey(int signedPreKeyId) {
Expand Down
16 changes: 2 additions & 14 deletions ios/StickProtocol/StickProtocol/Main/StickProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class SP {
progressEvent!(["progress": counter, "total": preKeys!.count])
}
}

var signedMap = [String: Any]()
signedMap["id"] = signedPreKey?.preKeyId
signedMap["public"] = signedPreKey?.keyPair?.publicKey.base64EncodedString()
Expand All @@ -93,16 +93,14 @@ public class SP {
signedMap["cipher"] = signedCipherMap["cipher"]!
signedMap["salt"] = signedCipherMap["salt"]!
signedMap["timestamp"] = signedPreKey?.unixTimestamp


var identityMap = [String: Any]()
identityMap["id"] = UserDefaults(suiteName: self.accessGroup!)!.integer(forKey: "activeIdentityKeyId")
identityMap["public"] = identityKey!.publicKey.base64EncodedString()
let identityCipherMap = pbEncrypt(text: identityKey!.privateKey, pass: password)
identityMap["cipher"] = identityCipherMap["cipher"]!
identityMap["salt"] = identityCipherMap["salt"]!
identityMap["timestamp"] = UserDefaults(suiteName: self.accessGroup!)!.integer(forKey: "activeIdentityKeyTimestamp")

let oneTimeId = UUID().uuidString.lowercased()
var map = [String: Any]()
map["identityKey"] = identityMap
Expand All @@ -112,16 +110,6 @@ public class SP {
map["localId"] = localId
map["passwordHash"] = passwordHash.base64EncodedString()
map["passwordSalt"] = passwordSalt?.base64EncodedString()

let signalProtocolAddress = SignalAddress(name: userId, deviceId: 0)
do {
let sessionBuilder = SessionBuilder(address: signalProtocolAddress, context: encryptionManager!.signalContext)
var preKeyBundle: PreKeyBundle?
preKeyBundle = try PreKeyBundle(registrationId: encryptionManager!.registrationId, deviceId: 0, preKeyId: Int32(preKeys![0].preKeyId), preKeyPublic: preKeys![0].keyPair!.publicKey, signedPreKeyId: signedPreKey!.preKeyId, signedPreKeyPublic: (signedPreKey?.keyPair!.publicKey)!, signature: signedPreKey!.signature, identityKey: identityKey!.publicKey)
try sessionBuilder.processPreKeyBundle(preKeyBundle!)
} catch {
print("Error info bundle: \(error)")
}
return map
}

Expand Down

0 comments on commit 4db7e9e

Please sign in to comment.