Integration sn-rn helper, quit app for keychain iOS issue

This commit is contained in:
Mo Bitar
2019-10-10 16:20:53 -05:00
parent f620507dba
commit 335375d215
9 changed files with 50 additions and 8 deletions

3
.gitmodules vendored
View File

@@ -25,3 +25,6 @@
[submodule "vendor/react-native-alternate-icons"]
path = vendor/react-native-alternate-icons
url = git@github.com:mobitar/react-native-alternate-icons.git
[submodule "vendor/standard-notes-rn"]
path = vendor/standard-notes-rn
url = git@github.com:standardnotes/standard-notes-rn.git

View File

@@ -99,6 +99,7 @@ dependencies {
implementation project(':bugsnag-react-native')
implementation project(':RNMail')
implementation project(':SNTextView')
implementation project(':standard-notes-rn')
implementation project(':react-native-keychain')
implementation project(':react-native-vector-icons')
implementation project(':react-native-aes-crypto')

View File

@@ -30,4 +30,4 @@ public class MainActivity extends ReactActivity {
public void invokeDefaultOnBackPressed() {
moveTaskToBack(true);
}
}
}

View File

@@ -31,6 +31,7 @@ import com.tectiv3.aes.RCTAesPackage;
import com.hieuvp.fingerprint.ReactNativeFingerprintScannerPackage;
import com.kristiansorens.flagsecure.FlagSecurePackage;
import com.bugsnag.BugsnagReactNative;
import org.standardnotes.SNReactNative.SNReactNativePackage;
import java.util.Arrays;
import java.util.List;
@@ -60,7 +61,8 @@ public class MainApplication extends Application implements ReactApplication {
new RNMail(),
new ReactNativeFingerprintScannerPackage(),
new SNTextViewPackage(),
new FlagSecurePackage()
new FlagSecurePackage(),
new SNReactNativePackage()
);
}

View File

@@ -20,6 +20,9 @@ project(':react-native-gesture-handler').projectDir = new File(rootProject.proje
include ':SNTextView'
project(':SNTextView').projectDir = new File(rootProject.projectDir, '../vendor/sn-textview/android')
include ':standard-notes-rn'
project(':standard-notes-rn').projectDir = new File(rootProject.projectDir, '../vendor/standard-notes-rn/android')
include ':bugsnag-react-native'
project(':bugsnag-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/bugsnag-react-native/android')

View File

@@ -56,6 +56,7 @@
CD399CE321E181C7006106AE /* Red.png in Resources */ = {isa = PBXBuildFile; fileRef = CD399CE021E181C6006106AE /* Red.png */; };
CD399CE421E181C7006106AE /* Red@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = CD399CE121E181C7006106AE /* Red@3x.png */; };
CD399CE521E181C7006106AE /* Red@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CD399CE221E181C7006106AE /* Red@2x.png */; };
CD534871234FD44900FCD828 /* libSNReactNative.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CD534870234FD43200FCD828 /* libSNReactNative.a */; };
CD743C792342ACC700535CC9 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
CD743CCE2342AD3F00535CC9 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
CDB58A201F6C5193009EF868 /* libRNMail.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CDB58A161F6C5179009EF868 /* libRNMail.a */; };
@@ -311,6 +312,13 @@
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RNStoreReview;
};
CD53486F234FD43200FCD828 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CD534835234FD43200FCD828 /* SNReactNative.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 15209BEF1D250F63000D0F44;
remoteInfo = SNReactNative;
};
CD5AEDE322825CB8002439FB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = EC178A0479CE4154896293C3 /* RNCWebView.xcodeproj */;
@@ -532,6 +540,7 @@
CD399CE021E181C6006106AE /* Red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Red.png; sourceTree = "<group>"; };
CD399CE121E181C7006106AE /* Red@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Red@3x.png"; sourceTree = "<group>"; };
CD399CE221E181C7006106AE /* Red@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Red@2x.png"; sourceTree = "<group>"; };
CD534835234FD43200FCD828 /* SNReactNative.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SNReactNative.xcodeproj; path = "../vendor/standard-notes-rn/ios/SNReactNative.xcodeproj"; sourceTree = "<group>"; };
CDB58A041F6C516B009EF868 /* RCTAes.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAes.xcodeproj; path = "../vendor/react-native-aes/ios/RCTAes.xcodeproj"; sourceTree = "<group>"; };
CDB58A0A1F6C5174009EF868 /* ReactNativeFingerprintScanner.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeFingerprintScanner.xcodeproj; path = "../vendor/react-native-fingerprint-scanner/ios/ReactNativeFingerprintScanner.xcodeproj"; sourceTree = "<group>"; };
CDB58A101F6C5178009EF868 /* RNMail.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNMail.xcodeproj; path = "../vendor/react-native-mail/RNMail.xcodeproj"; sourceTree = "<group>"; };
@@ -560,6 +569,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CD534871234FD44900FCD828 /* libSNReactNative.a in Frameworks */,
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */,
CD399CD021E16BD6006106AE /* libReactNativeAlternateIcons.a in Frameworks */,
CD17667C1F795DC100165C83 /* libSNTextView.a in Frameworks */,
@@ -781,6 +791,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
CD534835234FD43200FCD828 /* SNReactNative.xcodeproj */,
CD399C9921E16BCC006106AE /* ReactNativeAlternateIcons.xcodeproj */,
CD17664C1F795AE500165C83 /* SNTextView.xcodeproj */,
CDB58A101F6C5178009EF868 /* RNMail.xcodeproj */,
@@ -888,6 +899,14 @@
name = Products;
sourceTree = "<group>";
};
CD534836234FD43200FCD828 /* Products */ = {
isa = PBXGroup;
children = (
CD534870234FD43200FCD828 /* libSNReactNative.a */,
);
name = Products;
sourceTree = "<group>";
};
CD5AEDE022825CB8002439FB /* Products */ = {
isa = PBXGroup;
children = (
@@ -1223,6 +1242,10 @@
ProductGroup = CDB58A641F6C5294009EF868 /* Products */;
ProjectRef = 54ED130E749A46A3B15B27F2 /* RNVectorIcons.xcodeproj */;
},
{
ProductGroup = CD534836234FD43200FCD828 /* Products */;
ProjectRef = CD534835234FD43200FCD828 /* SNReactNative.xcodeproj */;
},
{
ProductGroup = CD17664D1F795AE500165C83 /* Products */;
ProjectRef = CD17664C1F795AE500165C83 /* SNTextView.xcodeproj */;
@@ -1470,6 +1493,13 @@
remoteRef = CD4D91841F7BE11800080678 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
CD534870234FD43200FCD828 /* libSNReactNative.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libSNReactNative.a;
remoteRef = CD53486F234FD43200FCD828 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
CD5AEDE422825CB8002439FB /* libRNCWebView.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;

View File

@@ -179,6 +179,7 @@ export default class App extends Component {
await KeysManager.get().loadInitialData();
let ready = () => {
KeysManager.get().markApplicationAsRan();
ApplicationState.get().receiveApplicationStartEvent();
this.setState({ready: true});
}

View File

@@ -7,6 +7,7 @@ import ModelManager from './sfjs/modelManager'
import Storage from './sfjs/storageManager'
import AlertManager from "@SFJS/alertManager"
import Keychain from "./keychain"
import SNReactNative from 'standard-notes-rn';
let OfflineParamsKey = "pc_params";
let BiometricsPrefs = "biometrics_prefs";
@@ -130,8 +131,6 @@ export default class KeysManager {
}
})
]).then(async () => {
await this.markApplicationAsRan();
// We only want to run migrations in unlocked app state. If account keys are present, run now,
// otherwise wait until offline keys have been set so that account keys are decrypted.
if(!this.encryptedAccountKeys) {
@@ -165,16 +164,18 @@ export default class KeysManager {
return AlertManager.get().confirm({
title: "Previous Installation",
text: `We've detected a previous installation of Standard Notes based on your keychain data. Would you like to wipe all data from previous installation? (If you're seeing this message in error, it might mean we're having issues loading your local database. Please restart the app and try again.)`,
confirmButtonText: "Delete Data",
cancelButtonText: "Keep Data",
text: `We've detected a previous installation of Standard Notes based on your keychain data. You must wipe all data from previous installation to continue.\n\nIf you're seeing this message in error, it might mean we're having issues loading your local database. Please restart the app and try again.`,
confirmButtonText: "Delete Local Data",
cancelButtonText: "Quit App",
onConfirm: async () => {
await Storage.get().clear();
await Keychain.clearKeys()
this.parseKeychainValue(null);
this.accountAuthParams = null;
this.user = null;
await this.markApplicationAsRan();
},
onCancel: () => {
SNReactNative.exitApp();
}
})
}

1
vendor/standard-notes-rn vendored Submodule