Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcinwasowicz/47964be1bd6aeaabc5504b3fa440f340 to your computer and use it in GitHub Desktop.
Save marcinwasowicz/47964be1bd6aeaabc5504b3fa440f340 to your computer and use it in GitHub Desktop.
Test notifs account in CommCoreModule
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
index 81680db56..301887be2 100644
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -667,19 +667,19 @@ bool create_schema(sqlite3 *db) {
void set_encryption_key(
sqlite3 *db,
const std::string &encryptionKey = SQLiteQueryExecutor::encryptionKey) {
- std::string set_encryption_key_query =
- "PRAGMA key = \"x'" + encryptionKey + "'\";";
-
- char *error_set_key;
- sqlite3_exec(
- db, set_encryption_key_query.c_str(), nullptr, nullptr, &error_set_key);
-
- if (error_set_key) {
- std::ostringstream error_message;
- error_message << "Failed to set encryption key: " << error_set_key;
- throw std::system_error(
- ECANCELED, std::generic_category(), error_message.str());
- }
+ // std::string set_encryption_key_query =
+ // "PRAGMA key = \"x'" + encryptionKey + "'\";";
+
+ // char *error_set_key;
+ // sqlite3_exec(
+ // db, set_encryption_key_query.c_str(), nullptr, nullptr, &error_set_key);
+
+ // if (error_set_key) {
+ // std::ostringstream error_message;
+ // error_message << "Failed to set encryption key: " << error_set_key;
+ // throw std::system_error(
+ // ECANCELED, std::generic_category(), error_message.str());
+ // }
}
int get_database_version(sqlite3 *db) {
diff --git a/native/profile/tunnelbroker-menu.react.js b/native/profile/tunnelbroker-menu.react.js
index 29ebdedc7..dc6a0863b 100644
--- a/native/profile/tunnelbroker-menu.react.js
+++ b/native/profile/tunnelbroker-menu.react.js
@@ -159,6 +159,42 @@ function TunnelbrokerMenu(props: Props): React.Node {
Send encrypted message to recipient
</Text>
</Button>
+ <Button
+ onPress={async () => {
+ const publicKeys = await commCoreModule.getUserPublicKey();
+ console.log('Public keys: ', publicKeys);
+ }}
+ style={styles.row}
+ iosFormat="highlight"
+ iosHighlightUnderlayColor={colors.panelIosHighlightUnderlay}
+ iosActiveOpacity={0.85}
+ >
+ <Text style={styles.submenuText}>Test getUserPublicKey</Text>
+ </Button>
+ <Button
+ onPress={async () => {
+ const oneTimeKeys = await commCoreModule.getOneTimeKeys(5);
+ console.log('One time keys: ', oneTimeKeys);
+ }}
+ style={styles.row}
+ iosFormat="highlight"
+ iosHighlightUnderlayColor={colors.panelIosHighlightUnderlay}
+ iosActiveOpacity={0.85}
+ >
+ <Text style={styles.submenuText}>Test getOneTimeKeys</Text>
+ </Button>
+ <Button
+ onPress={async () => {
+ const prekeys = await commCoreModule.validateAndGetPrekeys();
+ console.log('Prekeys: ', prekeys);
+ }}
+ style={styles.row}
+ iosFormat="highlight"
+ iosHighlightUnderlayColor={colors.panelIosHighlightUnderlay}
+ iosActiveOpacity={0.85}
+ >
+ <Text style={styles.submenuText}>Test validateAndGetPrekeys</Text>
+ </Button>
</View>
<Text style={styles.header}>MESSAGES</Text>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment