@onekeyfe/react-native-bundle-update 1.1.21
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/LICENSE +21 -0
- package/README.md +36 -0
- package/ReactNativeBundleUpdate.podspec +34 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +139 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt +1409 -0
- package/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdatePackage.kt +24 -0
- package/ios/Frameworks/Gopenpgp.xcframework/Info.plist +52 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Gopenpgp +0 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Armor.objc.h +96 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Constants.objc.h +197 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Crypto.objc.h +1963 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Gopenpgp.h +23 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Mime.objc.h +59 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Mobile.objc.h +252 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Profile.objc.h +107 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/Universe.objc.h +29 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Headers/ref.h +35 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Info.plist +20 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64/Gopenpgp.framework/Modules/module.modulemap +13 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Gopenpgp +0 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Armor.objc.h +96 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Constants.objc.h +197 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Crypto.objc.h +1963 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Gopenpgp.h +23 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Mime.objc.h +59 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Mobile.objc.h +252 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Profile.objc.h +107 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/Universe.objc.h +29 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Headers/ref.h +35 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Info.plist +20 -0
- package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Modules/module.modulemap +13 -0
- package/ios/ReactNativeBundleUpdate.swift +1338 -0
- package/lib/module/ReactNativeBundleUpdate.nitro.js +4 -0
- package/lib/module/ReactNativeBundleUpdate.nitro.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/ReactNativeBundleUpdate.nitro.d.ts +101 -0
- package/lib/typescript/src/ReactNativeBundleUpdate.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/c++/JAscFileInfo.hpp +65 -0
- package/nitrogen/generated/android/c++/JBundleDownloadASCParams.hpp +77 -0
- package/nitrogen/generated/android/c++/JBundleDownloadEvent.hpp +65 -0
- package/nitrogen/generated/android/c++/JBundleDownloadParams.hpp +73 -0
- package/nitrogen/generated/android/c++/JBundleDownloadResult.hpp +73 -0
- package/nitrogen/generated/android/c++/JBundleInstallParams.hpp +69 -0
- package/nitrogen/generated/android/c++/JBundleSwitchParams.hpp +65 -0
- package/nitrogen/generated/android/c++/JBundleVerifyASCParams.hpp +73 -0
- package/nitrogen/generated/android/c++/JBundleVerifyParams.hpp +69 -0
- package/nitrogen/generated/android/c++/JFallbackBundleInfo.hpp +65 -0
- package/nitrogen/generated/android/c++/JFunc_void_BundleDownloadEvent.hpp +78 -0
- package/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp +486 -0
- package/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp +89 -0
- package/nitrogen/generated/android/c++/JLocalBundleInfo.hpp +61 -0
- package/nitrogen/generated/android/c++/JTestResult.hpp +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/AscFileInfo.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadASCParams.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadEvent.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadParams.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadResult.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleInstallParams.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleSwitchParams.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyASCParams.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyParams.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/FallbackBundleInfo.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt +159 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/LocalBundleInfo.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/TestResult.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/reactnativebundleupdateOnLoad.kt +35 -0
- package/nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake +81 -0
- package/nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle +27 -0
- package/nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp +46 -0
- package/nitrogen/generated/android/reactnativebundleupdateOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb +60 -0
- package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp +113 -0
- package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp +513 -0
- package/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp +83 -0
- package/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.mm +33 -0
- package/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp +304 -0
- package/nitrogen/generated/ios/swift/AscFileInfo.swift +58 -0
- package/nitrogen/generated/ios/swift/BundleDownloadASCParams.swift +91 -0
- package/nitrogen/generated/ios/swift/BundleDownloadEvent.swift +58 -0
- package/nitrogen/generated/ios/swift/BundleDownloadParams.swift +80 -0
- package/nitrogen/generated/ios/swift/BundleDownloadResult.swift +80 -0
- package/nitrogen/generated/ios/swift/BundleInstallParams.swift +69 -0
- package/nitrogen/generated/ios/swift/BundleSwitchParams.swift +58 -0
- package/nitrogen/generated/ios/swift/BundleVerifyASCParams.swift +80 -0
- package/nitrogen/generated/ios/swift/BundleVerifyParams.swift +69 -0
- package/nitrogen/generated/ios/swift/FallbackBundleInfo.swift +58 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_BundleDownloadEvent.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_BundleDownloadResult.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_TestResult.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_AscFileInfo_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_FallbackBundleInfo_.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_LocalBundleInfo_.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift +80 -0
- package/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift +595 -0
- package/nitrogen/generated/ios/swift/LocalBundleInfo.swift +47 -0
- package/nitrogen/generated/ios/swift/TestResult.swift +47 -0
- package/nitrogen/generated/shared/c++/AscFileInfo.hpp +83 -0
- package/nitrogen/generated/shared/c++/BundleDownloadASCParams.hpp +95 -0
- package/nitrogen/generated/shared/c++/BundleDownloadEvent.hpp +83 -0
- package/nitrogen/generated/shared/c++/BundleDownloadParams.hpp +91 -0
- package/nitrogen/generated/shared/c++/BundleDownloadResult.hpp +91 -0
- package/nitrogen/generated/shared/c++/BundleInstallParams.hpp +87 -0
- package/nitrogen/generated/shared/c++/BundleSwitchParams.hpp +83 -0
- package/nitrogen/generated/shared/c++/BundleVerifyASCParams.hpp +91 -0
- package/nitrogen/generated/shared/c++/BundleVerifyParams.hpp +87 -0
- package/nitrogen/generated/shared/c++/FallbackBundleInfo.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp +45 -0
- package/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp +124 -0
- package/nitrogen/generated/shared/c++/LocalBundleInfo.hpp +79 -0
- package/nitrogen/generated/shared/c++/TestResult.hpp +79 -0
- package/package.json +169 -0
- package/src/ReactNativeBundleUpdate.nitro.ts +143 -0
- package/src/index.tsx +8 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
// Objective-C API for talking to the following Go packages
|
|
3
|
+
//
|
|
4
|
+
// github.com/ProtonMail/gopenpgp/v3/crypto
|
|
5
|
+
// github.com/ProtonMail/gopenpgp/v3/armor
|
|
6
|
+
// github.com/ProtonMail/gopenpgp/v3/constants
|
|
7
|
+
// github.com/ProtonMail/gopenpgp/v3/mime
|
|
8
|
+
// github.com/ProtonMail/gopenpgp/v3/mobile
|
|
9
|
+
// github.com/ProtonMail/gopenpgp/v3/profile
|
|
10
|
+
//
|
|
11
|
+
// File is generated by gomobile bind. Do not edit.
|
|
12
|
+
#ifndef __Gopenpgp_FRAMEWORK_H__
|
|
13
|
+
#define __Gopenpgp_FRAMEWORK_H__
|
|
14
|
+
|
|
15
|
+
#include "Crypto.objc.h"
|
|
16
|
+
#include "Armor.objc.h"
|
|
17
|
+
#include "Constants.objc.h"
|
|
18
|
+
#include "Mime.objc.h"
|
|
19
|
+
#include "Mobile.objc.h"
|
|
20
|
+
#include "Profile.objc.h"
|
|
21
|
+
#include "Universe.objc.h"
|
|
22
|
+
|
|
23
|
+
#endif
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Objective-C API for talking to github.com/ProtonMail/gopenpgp/v3/mime Go package.
|
|
2
|
+
// gobind -lang=objc github.com/ProtonMail/gopenpgp/v3/mime
|
|
3
|
+
//
|
|
4
|
+
// File is generated by gobind. Do not edit.
|
|
5
|
+
|
|
6
|
+
#ifndef __Mime_H__
|
|
7
|
+
#define __Mime_H__
|
|
8
|
+
|
|
9
|
+
@import Foundation;
|
|
10
|
+
#include "ref.h"
|
|
11
|
+
#include "Universe.objc.h"
|
|
12
|
+
|
|
13
|
+
#include "Constants.objc.h"
|
|
14
|
+
#include "Crypto.objc.h"
|
|
15
|
+
|
|
16
|
+
@protocol MimeMIMECallbacks;
|
|
17
|
+
@class MimeMIMECallbacks;
|
|
18
|
+
|
|
19
|
+
@protocol MimeMIMECallbacks <NSObject>
|
|
20
|
+
- (void)onAttachment:(NSString* _Nullable)headers data:(NSData* _Nullable)data;
|
|
21
|
+
- (void)onBody:(NSString* _Nullable)body mimetype:(NSString* _Nullable)mimetype;
|
|
22
|
+
/**
|
|
23
|
+
* Encrypted headers can be in an attachment and thus be placed at the end of the mime structure.
|
|
24
|
+
*/
|
|
25
|
+
- (void)onEncryptedHeaders:(NSString* _Nullable)headers;
|
|
26
|
+
- (void)onError:(NSError* _Nullable)err;
|
|
27
|
+
- (void)onVerified:(long)verified;
|
|
28
|
+
@end
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Decrypt decrypts and verifies a MIME message.
|
|
32
|
+
messageEncoding provides the encoding of the encrypted MIME message, either crypto.Bytes or crypto.Armor.
|
|
33
|
+
The decryptionHandle is used to decrypt and verify the message, while
|
|
34
|
+
the verifyHandle is used to verify the signature contained in the decrypted mime message.
|
|
35
|
+
The verifyHandle can be nil.
|
|
36
|
+
*/
|
|
37
|
+
FOUNDATION_EXPORT void MimeDecrypt(NSData* _Nullable message, int8_t messageEncoding, id<CryptoPGPDecryption> _Nullable decryptionHandle, id<CryptoPGPVerify> _Nullable verifyHandle, id<MimeMIMECallbacks> _Nullable callbacks);
|
|
38
|
+
|
|
39
|
+
@class MimeMIMECallbacks;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* MIMECallbacks defines callback methods to process a MIME message.
|
|
43
|
+
*/
|
|
44
|
+
@interface MimeMIMECallbacks : NSObject <goSeqRefInterface, MimeMIMECallbacks> {
|
|
45
|
+
}
|
|
46
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
47
|
+
|
|
48
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
49
|
+
- (void)onAttachment:(NSString* _Nullable)headers data:(NSData* _Nullable)data;
|
|
50
|
+
- (void)onBody:(NSString* _Nullable)body mimetype:(NSString* _Nullable)mimetype;
|
|
51
|
+
/**
|
|
52
|
+
* Encrypted headers can be in an attachment and thus be placed at the end of the mime structure.
|
|
53
|
+
*/
|
|
54
|
+
- (void)onEncryptedHeaders:(NSString* _Nullable)headers;
|
|
55
|
+
- (void)onError:(NSError* _Nullable)err;
|
|
56
|
+
- (void)onVerified:(long)verified;
|
|
57
|
+
@end
|
|
58
|
+
|
|
59
|
+
#endif
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
// Objective-C API for talking to github.com/ProtonMail/gopenpgp/v3/mobile Go package.
|
|
2
|
+
// gobind -lang=objc github.com/ProtonMail/gopenpgp/v3/mobile
|
|
3
|
+
//
|
|
4
|
+
// File is generated by gobind. Do not edit.
|
|
5
|
+
|
|
6
|
+
#ifndef __Mobile_H__
|
|
7
|
+
#define __Mobile_H__
|
|
8
|
+
|
|
9
|
+
@import Foundation;
|
|
10
|
+
#include "ref.h"
|
|
11
|
+
#include "Universe.objc.h"
|
|
12
|
+
|
|
13
|
+
#include "Crypto.objc.h"
|
|
14
|
+
|
|
15
|
+
@class MobileDetachedSignaturePGPSplitReader;
|
|
16
|
+
@class MobileGo2AndroidReader;
|
|
17
|
+
@class MobileGo2IOSReader;
|
|
18
|
+
@class MobileKeyPacketSplitWriter;
|
|
19
|
+
@class MobileMobile2GoReader;
|
|
20
|
+
@class MobileMobile2GoWriter;
|
|
21
|
+
@class MobileMobile2GoWriterWithSHA256;
|
|
22
|
+
@class MobileMobileReadResult;
|
|
23
|
+
@protocol MobileMobileReader;
|
|
24
|
+
@class MobileMobileReader;
|
|
25
|
+
|
|
26
|
+
@protocol MobileMobileReader <NSObject>
|
|
27
|
+
- (MobileMobileReadResult* _Nullable)read:(long)max error:(NSError* _Nullable* _Nullable)error;
|
|
28
|
+
@end
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* DetachedSignaturePGPSplitReader implements the crypto.PGPSplitReader interface.
|
|
32
|
+
*/
|
|
33
|
+
@interface MobileDetachedSignaturePGPSplitReader : NSObject <goSeqRefInterface, CryptoPGPSplitReader, CryptoReader> {
|
|
34
|
+
}
|
|
35
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
36
|
+
|
|
37
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
38
|
+
- (nullable instancetype)init:(NSData* _Nullable)keyPacket dataReader:(id<CryptoReader> _Nullable)dataReader encSignature:(CryptoPGPMessage* _Nullable)encSignature;
|
|
39
|
+
- (BOOL)read:(NSData* _Nullable)b n:(long* _Nullable)n error:(NSError* _Nullable* _Nullable)error;
|
|
40
|
+
- (id<CryptoReader> _Nullable)signature;
|
|
41
|
+
@end
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Go2AndroidReader is used to wrap a native golang Reader in the golang runtime,
|
|
45
|
+
to be usable in the android app runtime (via gomobile).
|
|
46
|
+
*/
|
|
47
|
+
@interface MobileGo2AndroidReader : NSObject <goSeqRefInterface, CryptoReader> {
|
|
48
|
+
}
|
|
49
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
50
|
+
|
|
51
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
52
|
+
/**
|
|
53
|
+
* NewGo2AndroidReader wraps a native golang Reader to be usable in the mobile app runtime (via gomobile).
|
|
54
|
+
It doesn't follow the standard golang Reader behavior, and returns n = -1 on EOF.
|
|
55
|
+
*/
|
|
56
|
+
- (nullable instancetype)init:(id<CryptoReader> _Nullable)reader;
|
|
57
|
+
/**
|
|
58
|
+
* Read reads bytes into the provided buffer and returns the number of bytes read
|
|
59
|
+
It doesn't follow the standard golang Reader behavior, and returns n = -1 on EOF.
|
|
60
|
+
*/
|
|
61
|
+
- (BOOL)read:(NSData* _Nullable)b n:(long* _Nullable)n error:(NSError* _Nullable* _Nullable)error;
|
|
62
|
+
@end
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Go2IOSReader is used to wrap a native golang Reader in the golang runtime,
|
|
66
|
+
to be usable in the iOS app runtime (via gomobile) as a MobileReader.
|
|
67
|
+
*/
|
|
68
|
+
@interface MobileGo2IOSReader : NSObject <goSeqRefInterface, MobileMobileReader> {
|
|
69
|
+
}
|
|
70
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
71
|
+
|
|
72
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
73
|
+
/**
|
|
74
|
+
* NewGo2IOSReader wraps a native golang Reader to be usable in the ios app runtime (via gomobile).
|
|
75
|
+
*/
|
|
76
|
+
- (nullable instancetype)init:(id<CryptoReader> _Nullable)reader;
|
|
77
|
+
/**
|
|
78
|
+
* Read reads at most <max> bytes from the wrapped Reader and returns the read data as a MobileReadResult.
|
|
79
|
+
*/
|
|
80
|
+
- (MobileMobileReadResult* _Nullable)read:(long)max error:(NSError* _Nullable* _Nullable)error;
|
|
81
|
+
@end
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* KeyPacketSplitWriter implements the crypto.PGPSplitWriter interface
|
|
85
|
+
for splitting encryptions output into different packets.
|
|
86
|
+
Internally buffers the key packets and potential detached encrypted signatures.
|
|
87
|
+
*/
|
|
88
|
+
@interface MobileKeyPacketSplitWriter : NSObject <goSeqRefInterface, CryptoPGPSplitWriter, CryptoWriter> {
|
|
89
|
+
}
|
|
90
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
91
|
+
|
|
92
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
93
|
+
- (nullable instancetype)init:(id<CryptoWriter> _Nullable)dataWriter;
|
|
94
|
+
/**
|
|
95
|
+
* EncryptedDetachedSignature returns the internally buffered encrypted detached signature.
|
|
96
|
+
*/
|
|
97
|
+
- (CryptoPGPMessage* _Nullable)encryptedDetachedSignature;
|
|
98
|
+
/**
|
|
99
|
+
* KeyPackets returns the internally buffered key packets.
|
|
100
|
+
*/
|
|
101
|
+
- (NSData* _Nullable)keyPackets;
|
|
102
|
+
- (id<CryptoWriter> _Nullable)keys;
|
|
103
|
+
- (id<CryptoWriter> _Nullable)signature;
|
|
104
|
+
- (BOOL)write:(NSData* _Nullable)b n:(long* _Nullable)n error:(NSError* _Nullable* _Nullable)error;
|
|
105
|
+
@end
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Mobile2GoReader is used to wrap a MobileReader in the mobile app runtime,
|
|
109
|
+
to be usable in the golang runtime (via gomobile) as a native Reader.
|
|
110
|
+
*/
|
|
111
|
+
@interface MobileMobile2GoReader : NSObject <goSeqRefInterface, CryptoReader> {
|
|
112
|
+
}
|
|
113
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
114
|
+
|
|
115
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
116
|
+
/**
|
|
117
|
+
* NewMobile2GoReader wraps a MobileReader to be usable in the golang runtime (via gomobile).
|
|
118
|
+
*/
|
|
119
|
+
- (nullable instancetype)init:(id<MobileMobileReader> _Nullable)reader;
|
|
120
|
+
/**
|
|
121
|
+
* Read reads data from the wrapped MobileReader and copies the read data in the provided buffer.
|
|
122
|
+
It also handles the conversion of EOF to an error.
|
|
123
|
+
*/
|
|
124
|
+
- (BOOL)read:(NSData* _Nullable)b n:(long* _Nullable)n error:(NSError* _Nullable* _Nullable)error;
|
|
125
|
+
@end
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Mobile2GoWriter is used to wrap a writer in the mobile app runtime,
|
|
129
|
+
to be usable in the golang runtime (via gomobile).
|
|
130
|
+
*/
|
|
131
|
+
@interface MobileMobile2GoWriter : NSObject <goSeqRefInterface, CryptoWriter> {
|
|
132
|
+
}
|
|
133
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
134
|
+
|
|
135
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
136
|
+
/**
|
|
137
|
+
* NewMobile2GoWriter wraps a writer to be usable in the golang runtime (via gomobile).
|
|
138
|
+
*/
|
|
139
|
+
- (nullable instancetype)init:(id<CryptoWriter> _Nullable)writer;
|
|
140
|
+
/**
|
|
141
|
+
* Write writes the data in the provided buffer in the wrapped writer.
|
|
142
|
+
It clones the provided data to prevent errors with garbage collectors.
|
|
143
|
+
*/
|
|
144
|
+
- (BOOL)write:(NSData* _Nullable)b n:(long* _Nullable)n error:(NSError* _Nullable* _Nullable)error;
|
|
145
|
+
@end
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Mobile2GoWriterWithSHA256 is used to wrap a writer in the mobile app runtime,
|
|
149
|
+
to be usable in the golang runtime (via gomobile).
|
|
150
|
+
It also computes the SHA256 hash of the data being written on the fly.
|
|
151
|
+
*/
|
|
152
|
+
@interface MobileMobile2GoWriterWithSHA256 : NSObject <goSeqRefInterface, CryptoWriter> {
|
|
153
|
+
}
|
|
154
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
155
|
+
|
|
156
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
157
|
+
/**
|
|
158
|
+
* NewMobile2GoWriterWithSHA256 wraps a writer to be usable in the golang runtime (via gomobile).
|
|
159
|
+
The wrapper also computes the SHA256 hash of the data being written on the fly.
|
|
160
|
+
*/
|
|
161
|
+
- (nullable instancetype)init:(id<CryptoWriter> _Nullable)writer;
|
|
162
|
+
/**
|
|
163
|
+
* GetSHA256 returns the SHA256 hash of the data that's been written so far.
|
|
164
|
+
*/
|
|
165
|
+
- (NSData* _Nullable)getSHA256;
|
|
166
|
+
/**
|
|
167
|
+
* Write writes the data in the provided buffer in the wrapped writer.
|
|
168
|
+
It clones the provided data to prevent errors with garbage collectors.
|
|
169
|
+
It also computes the SHA256 hash of the data being written on the fly.
|
|
170
|
+
*/
|
|
171
|
+
- (BOOL)write:(NSData* _Nullable)b n:(long* _Nullable)n error:(NSError* _Nullable* _Nullable)error;
|
|
172
|
+
@end
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* MobileReadResult is what needs to be returned by MobileReader.Read.
|
|
176
|
+
The read data is passed as a return value rather than passed as an argument to the reader.
|
|
177
|
+
This avoids problems introduced by gomobile that prevent the use of native golang readers.
|
|
178
|
+
*/
|
|
179
|
+
@interface MobileMobileReadResult : NSObject <goSeqRefInterface> {
|
|
180
|
+
}
|
|
181
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
182
|
+
|
|
183
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
184
|
+
/**
|
|
185
|
+
* NewMobileReadResult initialize a MobileReadResult with the correct values.
|
|
186
|
+
It clones the data to avoid the garbage collector freeing the data too early.
|
|
187
|
+
*/
|
|
188
|
+
- (nullable instancetype)init:(long)n eof:(BOOL)eof data:(NSData* _Nullable)data;
|
|
189
|
+
@property (nonatomic) long n;
|
|
190
|
+
@property (nonatomic) BOOL isEOF;
|
|
191
|
+
@property (nonatomic) NSData* _Nullable data;
|
|
192
|
+
@end
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* FreeOSMemory can be used to explicitly
|
|
196
|
+
call the garbage collector and
|
|
197
|
+
return the unused memory to the OS.
|
|
198
|
+
*/
|
|
199
|
+
FOUNDATION_EXPORT void MobileFreeOSMemory(void);
|
|
200
|
+
|
|
201
|
+
FOUNDATION_EXPORT MobileDetachedSignaturePGPSplitReader* _Nullable MobileNewDetachedSignaturePGPSplitReader(NSData* _Nullable keyPacket, id<CryptoReader> _Nullable dataReader, CryptoPGPMessage* _Nullable encSignature);
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* NewGo2AndroidReader wraps a native golang Reader to be usable in the mobile app runtime (via gomobile).
|
|
205
|
+
It doesn't follow the standard golang Reader behavior, and returns n = -1 on EOF.
|
|
206
|
+
*/
|
|
207
|
+
FOUNDATION_EXPORT MobileGo2AndroidReader* _Nullable MobileNewGo2AndroidReader(id<CryptoReader> _Nullable reader);
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* NewGo2IOSReader wraps a native golang Reader to be usable in the ios app runtime (via gomobile).
|
|
211
|
+
*/
|
|
212
|
+
FOUNDATION_EXPORT MobileGo2IOSReader* _Nullable MobileNewGo2IOSReader(id<CryptoReader> _Nullable reader);
|
|
213
|
+
|
|
214
|
+
FOUNDATION_EXPORT MobileKeyPacketSplitWriter* _Nullable MobileNewKeyPacketSplitWriter(id<CryptoWriter> _Nullable dataWriter);
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* NewMobile2GoReader wraps a MobileReader to be usable in the golang runtime (via gomobile).
|
|
218
|
+
*/
|
|
219
|
+
FOUNDATION_EXPORT MobileMobile2GoReader* _Nullable MobileNewMobile2GoReader(id<MobileMobileReader> _Nullable reader);
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* NewMobile2GoWriter wraps a writer to be usable in the golang runtime (via gomobile).
|
|
223
|
+
*/
|
|
224
|
+
FOUNDATION_EXPORT MobileMobile2GoWriter* _Nullable MobileNewMobile2GoWriter(id<CryptoWriter> _Nullable writer);
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* NewMobile2GoWriterWithSHA256 wraps a writer to be usable in the golang runtime (via gomobile).
|
|
228
|
+
The wrapper also computes the SHA256 hash of the data being written on the fly.
|
|
229
|
+
*/
|
|
230
|
+
FOUNDATION_EXPORT MobileMobile2GoWriterWithSHA256* _Nullable MobileNewMobile2GoWriterWithSHA256(id<CryptoWriter> _Nullable writer);
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* NewMobileReadResult initialize a MobileReadResult with the correct values.
|
|
234
|
+
It clones the data to avoid the garbage collector freeing the data too early.
|
|
235
|
+
*/
|
|
236
|
+
FOUNDATION_EXPORT MobileMobileReadResult* _Nullable MobileNewMobileReadResult(long n, BOOL eof, NSData* _Nullable data);
|
|
237
|
+
|
|
238
|
+
@class MobileMobileReader;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* MobileReader is the interface that readers in the mobile runtime must use and implement.
|
|
242
|
+
This is a workaround to some of the gomobile limitations.
|
|
243
|
+
*/
|
|
244
|
+
@interface MobileMobileReader : NSObject <goSeqRefInterface, MobileMobileReader> {
|
|
245
|
+
}
|
|
246
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
247
|
+
|
|
248
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
249
|
+
- (MobileMobileReadResult* _Nullable)read:(long)max error:(NSError* _Nullable* _Nullable)error;
|
|
250
|
+
@end
|
|
251
|
+
|
|
252
|
+
#endif
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Objective-C API for talking to github.com/ProtonMail/gopenpgp/v3/profile Go package.
|
|
2
|
+
// gobind -lang=objc github.com/ProtonMail/gopenpgp/v3/profile
|
|
3
|
+
//
|
|
4
|
+
// File is generated by gobind. Do not edit.
|
|
5
|
+
|
|
6
|
+
#ifndef __Profile_H__
|
|
7
|
+
#define __Profile_H__
|
|
8
|
+
|
|
9
|
+
@import Foundation;
|
|
10
|
+
#include "ref.h"
|
|
11
|
+
#include "Universe.objc.h"
|
|
12
|
+
|
|
13
|
+
#include "Constants.objc.h"
|
|
14
|
+
|
|
15
|
+
@class ProfileCustom;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Custom type represents a profile for setting algorithm
|
|
19
|
+
parameters for generating keys, encrypting data, and
|
|
20
|
+
signing data.
|
|
21
|
+
Use one of the pre-defined profiles if possible.
|
|
22
|
+
i.e., profile.Default(), profile.RFC4880().
|
|
23
|
+
*/
|
|
24
|
+
@interface ProfileCustom : NSObject <goSeqRefInterface> {
|
|
25
|
+
}
|
|
26
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
27
|
+
|
|
28
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
29
|
+
- (nonnull instancetype)init;
|
|
30
|
+
// skipped field Custom.SetKeyAlgorithm with unsupported type: func(*github.com/ProtonMail/go-crypto/openpgp/packet.Config, int8)
|
|
31
|
+
|
|
32
|
+
// skipped field Custom.AeadKeyEncryption with unsupported type: *github.com/ProtonMail/go-crypto/openpgp/packet.AEADConfig
|
|
33
|
+
|
|
34
|
+
// skipped field Custom.S2kKeyEncryption with unsupported type: *github.com/ProtonMail/go-crypto/openpgp/s2k.Config
|
|
35
|
+
|
|
36
|
+
// skipped field Custom.AeadEncryption with unsupported type: *github.com/ProtonMail/go-crypto/openpgp/packet.AEADConfig
|
|
37
|
+
|
|
38
|
+
// skipped field Custom.S2kEncryption with unsupported type: *github.com/ProtonMail/go-crypto/openpgp/s2k.Config
|
|
39
|
+
|
|
40
|
+
// skipped field Custom.CompressionConfiguration with unsupported type: *github.com/ProtonMail/go-crypto/openpgp/packet.CompressionConfig
|
|
41
|
+
|
|
42
|
+
// skipped field Custom.Hash with unsupported type: crypto.Hash
|
|
43
|
+
|
|
44
|
+
// skipped field Custom.SignHash with unsupported type: *crypto.Hash
|
|
45
|
+
|
|
46
|
+
// skipped field Custom.CipherKeyEncryption with unsupported type: github.com/ProtonMail/go-crypto/openpgp/packet.CipherFunction
|
|
47
|
+
|
|
48
|
+
// skipped field Custom.CipherEncryption with unsupported type: github.com/ProtonMail/go-crypto/openpgp/packet.CipherFunction
|
|
49
|
+
|
|
50
|
+
// skipped field Custom.CompressionAlgorithm with unsupported type: github.com/ProtonMail/go-crypto/openpgp/packet.CompressionAlgo
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* V6 is a flag to indicate if v6 from the crypto-refresh should be used.
|
|
54
|
+
*/
|
|
55
|
+
@property (nonatomic) BOOL v6;
|
|
56
|
+
/**
|
|
57
|
+
* AllowAllPublicKeyAlgorithms is a flag to disable all checks for deprecated public key algorithms.
|
|
58
|
+
*/
|
|
59
|
+
@property (nonatomic) BOOL allowAllPublicKeyAlgorithms;
|
|
60
|
+
/**
|
|
61
|
+
* DisableIntendedRecipients is a flag to disable the intended recipients pgp feature from the crypto-refresh.
|
|
62
|
+
*/
|
|
63
|
+
@property (nonatomic) BOOL disableIntendedRecipients;
|
|
64
|
+
/**
|
|
65
|
+
* InsecureAllowWeakRSA is a flag to disable checks for weak rsa keys.
|
|
66
|
+
*/
|
|
67
|
+
@property (nonatomic) BOOL insecureAllowWeakRSA;
|
|
68
|
+
/**
|
|
69
|
+
* InsecureAllowDecryptionWithSigningKeys is a flag to enable to decrypt with signing keys for compatibility reasons.
|
|
70
|
+
*/
|
|
71
|
+
@property (nonatomic) BOOL insecureAllowDecryptionWithSigningKeys;
|
|
72
|
+
/**
|
|
73
|
+
* MaxDecompressedMessageSize sets the maximum decompressed messages size that can be read
|
|
74
|
+
before throwing an error.
|
|
75
|
+
*/
|
|
76
|
+
@property (nonatomic) int64_t maxDecompressedMessageSize;
|
|
77
|
+
// skipped method Custom.CompressionConfig with unsupported parameter or return types
|
|
78
|
+
|
|
79
|
+
// skipped method Custom.EncryptionConfig with unsupported parameter or return types
|
|
80
|
+
|
|
81
|
+
// skipped method Custom.KeyEncryptionConfig with unsupported parameter or return types
|
|
82
|
+
|
|
83
|
+
// skipped method Custom.KeyGenerationConfig with unsupported parameter or return types
|
|
84
|
+
|
|
85
|
+
// skipped method Custom.SignConfig with unsupported parameter or return types
|
|
86
|
+
|
|
87
|
+
@end
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Default returns a custom profile that support features
|
|
91
|
+
that are widely implemented.
|
|
92
|
+
*/
|
|
93
|
+
FOUNDATION_EXPORT ProfileCustom* _Nullable ProfileDefault(void);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* RFC4880 returns a custom profile for this library
|
|
97
|
+
that conforms with the algorithms in RFC4880.
|
|
98
|
+
*/
|
|
99
|
+
FOUNDATION_EXPORT ProfileCustom* _Nullable ProfileRFC4880(void);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* RFC9580 returns a custom profile for this library
|
|
103
|
+
that conforms with the algorithms in RFC9580.
|
|
104
|
+
*/
|
|
105
|
+
FOUNDATION_EXPORT ProfileCustom* _Nullable ProfileRFC9580(void);
|
|
106
|
+
|
|
107
|
+
#endif
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Objective-C API for talking to Go package.
|
|
2
|
+
// gobind -lang=objc
|
|
3
|
+
//
|
|
4
|
+
// File is generated by gobind. Do not edit.
|
|
5
|
+
|
|
6
|
+
#ifndef __Universe_H__
|
|
7
|
+
#define __Universe_H__
|
|
8
|
+
|
|
9
|
+
@import Foundation;
|
|
10
|
+
#include "ref.h"
|
|
11
|
+
|
|
12
|
+
@protocol Universeerror;
|
|
13
|
+
@class Universeerror;
|
|
14
|
+
|
|
15
|
+
@protocol Universeerror <NSObject>
|
|
16
|
+
- (NSString* _Nonnull)error;
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@class Universeerror;
|
|
20
|
+
|
|
21
|
+
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
|
|
22
|
+
}
|
|
23
|
+
@property(strong, readonly) _Nonnull id _ref;
|
|
24
|
+
|
|
25
|
+
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
|
|
26
|
+
- (NSString* _Nonnull)error;
|
|
27
|
+
@end
|
|
28
|
+
|
|
29
|
+
#endif
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2015 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
#ifndef __GO_REF_HDR__
|
|
6
|
+
#define __GO_REF_HDR__
|
|
7
|
+
|
|
8
|
+
#include <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
// GoSeqRef is an object tagged with an integer for passing back and
|
|
11
|
+
// forth across the language boundary. A GoSeqRef may represent either
|
|
12
|
+
// an instance of a Go object, or an Objective-C object passed to Go.
|
|
13
|
+
// The explicit allocation of a GoSeqRef is used to pin a Go object
|
|
14
|
+
// when it is passed to Objective-C. The Go seq package maintains a
|
|
15
|
+
// reference to the Go object in a map keyed by the refnum along with
|
|
16
|
+
// a reference count. When the reference count reaches zero, the Go
|
|
17
|
+
// seq package will clear the corresponding entry in the map.
|
|
18
|
+
@interface GoSeqRef : NSObject {
|
|
19
|
+
}
|
|
20
|
+
@property(readonly) int32_t refnum;
|
|
21
|
+
@property(strong) id obj; // NULL when representing a Go object.
|
|
22
|
+
|
|
23
|
+
// new GoSeqRef object to proxy a Go object. The refnum must be
|
|
24
|
+
// provided from Go side.
|
|
25
|
+
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
|
|
26
|
+
|
|
27
|
+
- (int32_t)incNum;
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
@protocol goSeqRefInterface
|
|
32
|
+
-(GoSeqRef*) _ref;
|
|
33
|
+
@end
|
|
34
|
+
|
|
35
|
+
#endif
|
package/ios/Frameworks/Gopenpgp.xcframework/ios-arm64_x86_64-simulator/Gopenpgp.framework/Info.plist
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleExecutable</key>
|
|
6
|
+
<string>Gopenpgp</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>Gopenpgp</string>
|
|
9
|
+
<key>CFBundlePackageType</key>
|
|
10
|
+
<string>FMWK</string>
|
|
11
|
+
<key>CFBundleShortVersionString</key>
|
|
12
|
+
<string>0.0.1758379400</string>
|
|
13
|
+
<key>CFBundleVersion</key>
|
|
14
|
+
<string>0.0.1758379400</string>
|
|
15
|
+
<key>MinimumOSVersion</key>
|
|
16
|
+
<string>15.5</string>
|
|
17
|
+
<key>RCTNewArchEnabled</key>
|
|
18
|
+
<true/>
|
|
19
|
+
</dict>
|
|
20
|
+
</plist>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
framework module "Gopenpgp" {
|
|
2
|
+
header "ref.h"
|
|
3
|
+
header "Crypto.objc.h"
|
|
4
|
+
header "Armor.objc.h"
|
|
5
|
+
header "Constants.objc.h"
|
|
6
|
+
header "Mime.objc.h"
|
|
7
|
+
header "Mobile.objc.h"
|
|
8
|
+
header "Profile.objc.h"
|
|
9
|
+
header "Universe.objc.h"
|
|
10
|
+
header "Gopenpgp.h"
|
|
11
|
+
|
|
12
|
+
export *
|
|
13
|
+
}
|