agora-appbuilder-core 4.0.0-beta.87 → 4.0.0-beta.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/android/app/src/main/java/com/helloworld/MainApplication.java +3 -0
- package/template/android/app/src/main/java/com/helloworld/SSLPinningFactory.java +30 -0
- package/template/android/app/src/main/res/values/strings.xml +3 -0
- package/template/ios/HelloWorld/AppDelegate.mm +22 -0
- package/template/ios/HelloWorld/Info.plist +8 -1
- package/template/ios/Podfile +1 -0
- package/template/ios/Podfile.lock +5 -1
- package/template/src/subComponents/ChatBubble.tsx +1 -1
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
|
9
9
|
import com.facebook.react.defaults.DefaultReactNativeHost;
|
|
10
10
|
import com.facebook.soloader.SoLoader;
|
|
11
11
|
import java.util.List;
|
|
12
|
+
import com.facebook.react.modules.network.OkHttpClientProvider;
|
|
12
13
|
|
|
13
14
|
public class MainApplication extends Application implements ReactApplication {
|
|
14
15
|
|
|
@@ -59,5 +60,7 @@ public class MainApplication extends Application implements ReactApplication {
|
|
|
59
60
|
DefaultNewArchitectureEntryPoint.load();
|
|
60
61
|
}
|
|
61
62
|
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
63
|
+
SSLPinningFactory sslPinningFactory = new SSLPinningFactory(getApplicationContext());
|
|
64
|
+
OkHttpClientProvider.setOkHttpClientFactory(sslPinningFactory);
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package com.helloworld;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.modules.network.OkHttpClientFactory;
|
|
4
|
+
import com.facebook.react.modules.network.OkHttpClientProvider;
|
|
5
|
+
import okhttp3.CertificatePinner;
|
|
6
|
+
import okhttp3.OkHttpClient;
|
|
7
|
+
import android.content.Context;
|
|
8
|
+
|
|
9
|
+
public class SSLPinningFactory implements OkHttpClientFactory {
|
|
10
|
+
private Context context;
|
|
11
|
+
|
|
12
|
+
public SSLPinningFactory(Context context) {
|
|
13
|
+
this.context = context;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public OkHttpClient createNewNetworkModuleClient() {
|
|
17
|
+
|
|
18
|
+
String hostname = context.getString(R.string.hostname);
|
|
19
|
+
String main_public_key = context.getString(R.string.main_public_key);
|
|
20
|
+
String backup_public_key = context.getString(R.string.backup_public_key);
|
|
21
|
+
|
|
22
|
+
CertificatePinner certificatePinner = new CertificatePinner.Builder()
|
|
23
|
+
.add(hostname, "sha256/"+ main_public_key)
|
|
24
|
+
.add(hostname, "sha256/"+ backup_public_key)
|
|
25
|
+
.build();
|
|
26
|
+
|
|
27
|
+
OkHttpClient.Builder clientBuilder = OkHttpClientProvider.createClientBuilder();
|
|
28
|
+
return clientBuilder.certificatePinner(certificatePinner).build();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
<resources>
|
|
2
2
|
<string name="app_name">Hello App Display Name</string>
|
|
3
|
+
<string name="hostname">managedservices-preprod.rteappbuilder.com</string>
|
|
4
|
+
<string name="main_public_key">pCL9CdYsDVWtkF3DktsMyfmuSGsnKNzAraubM/2JawQ=</string>
|
|
5
|
+
<string name="backup_public_key">18tkPyr2nckv4fgo0dhAkaUtJ2hu2831xlO2SKhq8dg=</string>
|
|
3
6
|
</resources>
|
|
@@ -2,11 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
#import <React/RCTBundleURLProvider.h>
|
|
4
4
|
#import <React/RCTLinkingManager.h>
|
|
5
|
+
#import <TrustKit/TrustKit.h>
|
|
5
6
|
|
|
6
7
|
@implementation AppDelegate
|
|
7
8
|
|
|
8
9
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
9
10
|
{
|
|
11
|
+
NSString *hostName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"HostName"];
|
|
12
|
+
NSString *mainPublicKey = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MainPublicKey"];
|
|
13
|
+
NSString *backupPublicKey = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"BackupPublicKey"];
|
|
14
|
+
// Initialize TrustKit for SSL pinning
|
|
15
|
+
NSDictionary *trustKitConfig =
|
|
16
|
+
@{
|
|
17
|
+
kTSKSwizzleNetworkDelegates: @YES,
|
|
18
|
+
kTSKPinnedDomains: @{
|
|
19
|
+
hostName : @{
|
|
20
|
+
kTSKIncludeSubdomains: @YES,
|
|
21
|
+
kTSKEnforcePinning: @YES,
|
|
22
|
+
kTSKDisableDefaultReportUri: @YES,
|
|
23
|
+
kTSKPublicKeyHashes : @[
|
|
24
|
+
mainPublicKey,
|
|
25
|
+
backupPublicKey,
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
[TrustKit initSharedInstanceWithConfiguration:trustKitConfig];
|
|
31
|
+
|
|
10
32
|
self.moduleName = @"HelloWorld";
|
|
11
33
|
// You can add your custom initial props in the dictionary below.
|
|
12
34
|
// They will be passed down to the ViewController used by React Native.
|
|
@@ -83,5 +83,12 @@
|
|
|
83
83
|
</array>
|
|
84
84
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
85
85
|
<false/>
|
|
86
|
+
|
|
87
|
+
<key>HostName</key>
|
|
88
|
+
<string>managedservices-preprod.rteappbuilder.com</string>
|
|
89
|
+
<key>MainPublicKey</key>
|
|
90
|
+
<string>pCL9CdYsDVWtkF3DktsMyfmuSGsnKNzAraubM/2JawQ=</string>
|
|
91
|
+
<key>BackupPublicKey</key>
|
|
92
|
+
<string>18tkPyr2nckv4fgo0dhAkaUtJ2hu2831xlO2SKhq8dg=</string>
|
|
86
93
|
</dict>
|
|
87
|
-
</plist>
|
|
94
|
+
</plist>
|
package/template/ios/Podfile
CHANGED
|
@@ -535,6 +535,7 @@ PODS:
|
|
|
535
535
|
- RNVectorIcons (9.2.0):
|
|
536
536
|
- React-Core
|
|
537
537
|
- SocketRocket (0.6.1)
|
|
538
|
+
- TrustKit (3.0.4)
|
|
538
539
|
- Yoga (1.14.0)
|
|
539
540
|
|
|
540
541
|
DEPENDENCIES:
|
|
@@ -598,6 +599,7 @@ DEPENDENCIES:
|
|
|
598
599
|
- RNShare (from `../node_modules/react-native-share`)
|
|
599
600
|
- RNSVG (from `../node_modules/react-native-svg`)
|
|
600
601
|
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
|
|
602
|
+
- TrustKit
|
|
601
603
|
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
|
|
602
604
|
|
|
603
605
|
SPEC REPOS:
|
|
@@ -611,6 +613,7 @@ SPEC REPOS:
|
|
|
611
613
|
- IQKeyboardManagerSwift
|
|
612
614
|
- libevent
|
|
613
615
|
- SocketRocket
|
|
616
|
+
- TrustKit
|
|
614
617
|
|
|
615
618
|
EXTERNAL SOURCES:
|
|
616
619
|
agora-react-native-rtm:
|
|
@@ -798,8 +801,9 @@ SPEC CHECKSUMS:
|
|
|
798
801
|
RNSVG: 3a79c0c4992213e4f06c08e62730c5e7b9e4dc17
|
|
799
802
|
RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
|
|
800
803
|
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
|
|
804
|
+
TrustKit: 403e8d2cfbff2abfc37cd41acc558dab8ec78e59
|
|
801
805
|
Yoga: 3efc43e0d48686ce2e8c60f99d4e6bd349aff981
|
|
802
806
|
|
|
803
|
-
PODFILE CHECKSUM:
|
|
807
|
+
PODFILE CHECKSUM: 1a042be2d7f2bdbb4f21393f3709284412a6e2df
|
|
804
808
|
|
|
805
809
|
COCOAPODS: 1.15.2
|
|
@@ -123,7 +123,7 @@ const ChatBubble = (props: ChatBubbleProps) => {
|
|
|
123
123
|
<View
|
|
124
124
|
style={[
|
|
125
125
|
isLocal ? style.chatBubbleLocalView : style.chatBubbleRemoteView,
|
|
126
|
-
isURL(message) ? {maxWidth: '88%'} : {},
|
|
126
|
+
//isURL(message) ? {maxWidth: '88%'} : {},
|
|
127
127
|
]}>
|
|
128
128
|
<View
|
|
129
129
|
style={
|