我正在按照本指南设置 trustkit SSL pinning:https : //github.com/datatheorem/TrustKit-Android
我在尝试安装信任工具包依赖项时遇到错误
我的 build.gradle 看起来像这样
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.datatheorem.truskit:trustkit-android:1.1.3'
if (enableHermes) {
def hermesPath = "../../node_modules/hermesvm/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
Run Code Online (Sandbox Code Playgroud)
错误:
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find com.datatheorem.truskit:trustkit-android:1.1.3.
Searched in the following locations:
- file:/Users/omar/.m2/repository/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
- file:/Users/omar/.m2/repository/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
- file:/Users/omar/workspace/js/contextful/node_modules/react-native/android/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
- file:/Users/omar/workspace/js/contextful/node_modules/react-native/android/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
- file:/Users/omar/workspace/js/contextful/node_modules/jsc-android/dist/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.pom
- file:/Users/omar/workspace/js/contextful/node_modules/jsc-android/dist/com/datatheorem/truskit/trustkit-android/1.1.3/trustkit-android-1.1.3.jar
- …Run Code Online (Sandbox Code Playgroud) 我正在尝试在react-native应用程序(RN 0.60)中实现SSL固定,并且我正在使用Trustkit。
按照https://github.com/datatheorem/TrustKit中发布的指南,这些是我所做的步骤:
1) 使用pod 'TrustKit'和安装 TrustKit podpod install
2)添加到我的AppDelegate.m这段代码:
#import <TrustKit/TrustKit.h>
//inside didFinishLaunchingWithOptions
NSDictionary *trustKitConfig =
@{
kTSKSwizzleNetworkDelegates: @YES,
kTSKPinnedDomains: @{
@"www.datatheorem.com" : @{
kTSKEnforcePinning:@YES,
kTSKIncludeSubdomains:@YES,
//Using wrong hashes so it fails
kTSKPublicKeyHashes : @[
@"Ca5gV6n7OVx4AxtEaIk8NI9qyKBTtKJjwqullb/v9hh=",
@"YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihh="
]
}}};
[TrustKit initSharedInstanceWithConfiguration:trustKitConfig];
Run Code Online (Sandbox Code Playgroud)
当我尝试做的时候
RNFetchBlob.fetch('GET', "https://www.datatheorem.com", {}) //tried using standard fetch() but gives same results
.then(async(res) => {
console.log('RES => ' ,res)
})
// Something went wrong:
.catch((err) => {
console.log('ERROR =>', err);
})
Run Code Online (Sandbox Code Playgroud)
它进入内部 …
Xcode 自动更新到版本 13.2.1 后,我无法使用 Carthage 依赖项管理器构建项目。使用从这里获取的一个框架: https: //gitlab.com/trust payments-public
/mobile-sdk/ios 我收到以下错误:
Module compiled with Swift 5.5 cannot be imported by the Swift 5.5.2 compiler
我尝试重建框架并Build libraries for distribution在项目设置中设置标志No,但它返回了不允许桥接标头的错误。
有任何想法吗 ?
PS:我成功地使用 CocoaPods 构建了该应用程序,但环境要求迫使我在我的 iOS 项目中继续使用 Carthage。