react-native-gizwits-sdk-v5 1.5.5-thirdbluetooth → 1.5.6-thirdbluetooth
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/android/libs/sdk-bluetooth-release.aar +0 -0
- package/ios/GizwitsiOSSDK.framework/GizwitsiOSSDK +0 -0
- package/ios/GizwitsiOSSDK.framework/Headers/CocoaAsyncSocket.h +18 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDASLLogger.h +41 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDAbstractDatabaseLogger.h +102 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDContextFilterLogFormatter.h +63 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDDispatchQueueLogFormatter.h +128 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDFileLogger.h +340 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDLog+LOGV.h +99 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDLog.h +632 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDMultiFormatter.h +30 -0
- package/ios/GizwitsiOSSDK.framework/Headers/DDTTYLogger.h +171 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPAES.h +19 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPDataCode.h +44 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPDatumCode.h +38 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPGuideCode.h +15 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPTools.h +22 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPTouch.h +36 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPTouchDelegate.h +24 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPTouchGenerator.h +46 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPTouchResult.h +36 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPTouchTask.h +124 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPTouchTaskParameter.h +173 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPUDPSocketClient.h +50 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESPUDPSocketServer.h +49 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESP_ByteUtil.h +128 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESP_CRC8.h +61 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESP_NetUtil.h +82 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ESP_WifiUtil.h +33 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ForegroundReconnection.h +23 -0
- package/ios/GizwitsiOSSDK.framework/Headers/GCDTimer.h +19 -0
- package/ios/GizwitsiOSSDK.framework/Headers/GizwitsiOSSDK-Swift.h +338 -0
- package/ios/GizwitsiOSSDK.framework/Headers/GizwitsiOSSDK.h +24 -0
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTClient.h +39 -0
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTInMemoryPersistence.h +16 -0
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTSSLSecurityPolicyDecoder.h +19 -0
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTSSLSecurityPolicyEncoder.h +18 -0
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTSessionLegacy.h +112 -0
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTSessionSynchron.h +194 -0
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTStrict.h +33 -0
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTUntil.h +14 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ReconnectTimer.h +21 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_GCDAsyncSocket.h +1226 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_GCDAsyncUdpSocket.h +1036 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_GizwitsParser.h +61 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketDecoder.h +39 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketEncoder.h +38 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketTransport.h +79 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCoreDataPersistence.h +21 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTDecoder.h +66 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTLog.h +123 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTMessage.h +233 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTPersistence.h +124 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTProperties.h +76 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSSLSecurityPolicy.h +158 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSSLSecurityPolicyTransport.h +30 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSession.h +886 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSessionManager.h +237 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTTransport.h +114 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_SSZipArchive.h +178 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_SSZipCommon.h +71 -0
- package/ios/GizwitsiOSSDK.framework/Headers/_ZipArchive.h +26 -0
- package/ios/GizwitsiOSSDK.framework/Headers/a_weighting.h +88 -0
- package/ios/GizwitsiOSSDK.framework/Headers/aubio.h +231 -0
- package/ios/GizwitsiOSSDK.framework/Headers/audio_unit.h +61 -0
- package/ios/GizwitsiOSSDK.framework/Headers/awhitening.h +125 -0
- package/ios/GizwitsiOSSDK.framework/Headers/beattracking.h +121 -0
- package/ios/GizwitsiOSSDK.framework/Headers/biquad.h +75 -0
- package/ios/GizwitsiOSSDK.framework/Headers/c_weighting.h +88 -0
- package/ios/GizwitsiOSSDK.framework/Headers/common.h +104 -0
- package/ios/GizwitsiOSSDK.framework/Headers/cvec.h +247 -0
- package/ios/GizwitsiOSSDK.framework/Headers/dct.h +85 -0
- package/ios/GizwitsiOSSDK.framework/Headers/fft.h +144 -0
- package/ios/GizwitsiOSSDK.framework/Headers/filter.h +176 -0
- package/ios/GizwitsiOSSDK.framework/Headers/filterbank.h +90 -0
- package/ios/GizwitsiOSSDK.framework/Headers/filterbank_mel.h +72 -0
- package/ios/GizwitsiOSSDK.framework/Headers/fmat.h +172 -0
- package/ios/GizwitsiOSSDK.framework/Headers/fvec.h +178 -0
- package/ios/GizwitsiOSSDK.framework/Headers/hist.h +63 -0
- package/ios/GizwitsiOSSDK.framework/Headers/ioutils.h +60 -0
- package/ios/GizwitsiOSSDK.framework/Headers/log.h +99 -0
- package/ios/GizwitsiOSSDK.framework/Headers/lvec.h +118 -0
- package/ios/GizwitsiOSSDK.framework/Headers/mathutils.h +330 -0
- package/ios/GizwitsiOSSDK.framework/Headers/mfcc.h +79 -0
- package/ios/GizwitsiOSSDK.framework/Headers/musicutils.h +171 -0
- package/ios/GizwitsiOSSDK.framework/Headers/notes.h +113 -0
- package/ios/GizwitsiOSSDK.framework/Headers/onset.h +347 -0
- package/ios/GizwitsiOSSDK.framework/Headers/parameter.h +159 -0
- package/ios/GizwitsiOSSDK.framework/Headers/peakpicker.h +57 -0
- package/ios/GizwitsiOSSDK.framework/Headers/phasevoc.h +112 -0
- package/ios/GizwitsiOSSDK.framework/Headers/pitch.h +197 -0
- package/ios/GizwitsiOSSDK.framework/Headers/pitchfcomb.h +76 -0
- package/ios/GizwitsiOSSDK.framework/Headers/pitchmcomb.h +77 -0
- package/ios/GizwitsiOSSDK.framework/Headers/pitchschmitt.h +75 -0
- package/ios/GizwitsiOSSDK.framework/Headers/pitchspecacf.h +103 -0
- package/ios/GizwitsiOSSDK.framework/Headers/pitchyin.h +100 -0
- package/ios/GizwitsiOSSDK.framework/Headers/pitchyinfast.h +102 -0
- package/ios/GizwitsiOSSDK.framework/Headers/pitchyinfft.h +99 -0
- package/ios/GizwitsiOSSDK.framework/Headers/resampler.h +65 -0
- package/ios/GizwitsiOSSDK.framework/Headers/sampler.h +140 -0
- package/ios/GizwitsiOSSDK.framework/Headers/scale.h +80 -0
- package/ios/GizwitsiOSSDK.framework/Headers/sink.h +181 -0
- package/ios/GizwitsiOSSDK.framework/Headers/sink_apple_audio.h +163 -0
- package/ios/GizwitsiOSSDK.framework/Headers/sink_sndfile.h +162 -0
- package/ios/GizwitsiOSSDK.framework/Headers/sink_wavwrite.h +162 -0
- package/ios/GizwitsiOSSDK.framework/Headers/source.h +184 -0
- package/ios/GizwitsiOSSDK.framework/Headers/source_apple_audio.h +156 -0
- package/ios/GizwitsiOSSDK.framework/Headers/source_avcodec.h +155 -0
- package/ios/GizwitsiOSSDK.framework/Headers/source_sndfile.h +155 -0
- package/ios/GizwitsiOSSDK.framework/Headers/source_wavread.h +160 -0
- package/ios/GizwitsiOSSDK.framework/Headers/specdesc.h +204 -0
- package/ios/GizwitsiOSSDK.framework/Headers/tempo.h +255 -0
- package/ios/GizwitsiOSSDK.framework/Headers/tss.h +103 -0
- package/ios/GizwitsiOSSDK.framework/Headers/types.h +70 -0
- package/ios/GizwitsiOSSDK.framework/Headers/vecutils.h +116 -0
- package/ios/GizwitsiOSSDK.framework/Headers/wavetable.h +178 -0
- package/ios/GizwitsiOSSDK.framework/Info.plist +0 -0
- package/ios/GizwitsiOSSDK.framework/LICENSE +17 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.abi.json +57489 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +1752 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftinterface +1752 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/module.modulemap +11 -0
- package/ios/GizwitsiOSSDK.framework/PrivacyInfo.xcprivacy +23 -0
- package/ios/GizwitsiOSSDK.framework/README.md +31 -0
- package/package.json +1 -1
- package/react-native-gizwits-sdk-v5.podspec +2 -2
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
//
|
|
2
|
+
// MQTTSessionManager.h
|
|
3
|
+
// MQTTClient
|
|
4
|
+
//
|
|
5
|
+
// Created by Christoph Krey on 09.07.14.
|
|
6
|
+
// Copyright © 2013-2017 Christoph Krey. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#if TARGET_OS_IPHONE == 1
|
|
11
|
+
#import <UIKit/UIKit.h>
|
|
12
|
+
#endif
|
|
13
|
+
#import "_MQTTSession.h"
|
|
14
|
+
#import "MQTTSessionLegacy.h"
|
|
15
|
+
#import "_MQTTSSLSecurityPolicy.h"
|
|
16
|
+
|
|
17
|
+
@class _MQTTSessionManager;
|
|
18
|
+
|
|
19
|
+
/** delegate gives your application access to received messages
|
|
20
|
+
*/
|
|
21
|
+
@protocol _MQTTSessionManagerDelegate <NSObject>
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
Enumeration of MQTTSessionManagerState values
|
|
25
|
+
*/
|
|
26
|
+
typedef NS_ENUM(int, _MQTTSessionManagerState) {
|
|
27
|
+
MQTTSessionManagerStateStarting,
|
|
28
|
+
MQTTSessionManagerStateConnecting,
|
|
29
|
+
MQTTSessionManagerStateError,
|
|
30
|
+
MQTTSessionManagerStateConnected,
|
|
31
|
+
MQTTSessionManagerStateClosing,
|
|
32
|
+
MQTTSessionManagerStateClosed
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
@optional
|
|
36
|
+
|
|
37
|
+
/** gets called when a new message was received
|
|
38
|
+
|
|
39
|
+
@param data the data received, might be zero length
|
|
40
|
+
@param topic the topic the data was published to
|
|
41
|
+
@param retained indicates if the data retransmitted from server storage
|
|
42
|
+
*/
|
|
43
|
+
- (void)handleMessage:(NSData *)data onTopic:(NSString *)topic retained:(BOOL)retained;
|
|
44
|
+
|
|
45
|
+
/** gets called when a new message was received
|
|
46
|
+
@param sessionManager the instance of MQTTSessionManager whose state changed
|
|
47
|
+
@param data the data received, might be zero length
|
|
48
|
+
@param topic the topic the data was published to
|
|
49
|
+
@param retained indicates if the data retransmitted from server storage
|
|
50
|
+
*/
|
|
51
|
+
- (void)sessionManager:(_MQTTSessionManager *)sessionManager
|
|
52
|
+
didReceiveMessage:(NSData *)data
|
|
53
|
+
onTopic:(NSString *)topic
|
|
54
|
+
retained:(BOOL)retained;
|
|
55
|
+
|
|
56
|
+
/** gets called when a published message was actually delivered
|
|
57
|
+
@param msgID the Message Identifier of the delivered message
|
|
58
|
+
@note this method is called after a publish with qos 1 or 2 only
|
|
59
|
+
*/
|
|
60
|
+
- (void)messageDelivered:(UInt16)msgID;
|
|
61
|
+
|
|
62
|
+
/** gets called when a published message was actually delivered
|
|
63
|
+
@param sessionManager the instance of MQTTSessionManager whose state changed
|
|
64
|
+
@param msgID the Message Identifier of the delivered message
|
|
65
|
+
@note this method is called after a publish with qos 1 or 2 only
|
|
66
|
+
*/
|
|
67
|
+
- (void)sessionManager:(_MQTTSessionManager *)sessionManager didDeliverMessage:(UInt16)msgID;
|
|
68
|
+
|
|
69
|
+
/** gets called when the connection status changes
|
|
70
|
+
@param sessionManager the instance of MQTTSessionManager whose state changed
|
|
71
|
+
@param newState the new connection state of the sessionManager. This will be identical to `sessionManager.state`.
|
|
72
|
+
*/
|
|
73
|
+
- (void)sessionManager:(_MQTTSessionManager *)sessionManager didChangeState:(_MQTTSessionManagerState)newState;
|
|
74
|
+
|
|
75
|
+
@end
|
|
76
|
+
|
|
77
|
+
/** SessionManager handles the MQTT session for your application
|
|
78
|
+
*/
|
|
79
|
+
@interface _MQTTSessionManager : NSObject <_MQTTSessionDelegate>
|
|
80
|
+
|
|
81
|
+
/** Underlying MQTTSession currently in use.
|
|
82
|
+
*/
|
|
83
|
+
@property (strong, nonatomic, readonly) _MQTTSession *session;
|
|
84
|
+
|
|
85
|
+
/** host an NSString containing the hostName or IP address of the Server
|
|
86
|
+
*/
|
|
87
|
+
@property (readonly) NSString *host;
|
|
88
|
+
|
|
89
|
+
/** port an unsigned 32 bit integer containing the IP port number of the Server
|
|
90
|
+
*/
|
|
91
|
+
@property (readonly) UInt32 port;
|
|
92
|
+
|
|
93
|
+
/** the delegate receiving incoming messages
|
|
94
|
+
*/
|
|
95
|
+
@property (weak, nonatomic) id<_MQTTSessionManagerDelegate> delegate;
|
|
96
|
+
|
|
97
|
+
/** indicates if manager requires tear down
|
|
98
|
+
*/
|
|
99
|
+
@property (readonly) BOOL requiresTearDown;
|
|
100
|
+
|
|
101
|
+
/** subscriptions is a dictionary of NSNumber instances indicating the MQTTQoSLevel.
|
|
102
|
+
* The keys are topic filters.
|
|
103
|
+
* The SessionManager subscribes to the given subscriptions after successfull (re-)connect
|
|
104
|
+
* according to the cleansession parameter and the state of the session as indicated by the broker.
|
|
105
|
+
* Setting a new subscriptions dictionary initiates SUBSCRIBE or UNSUBSCRIBE messages by SessionManager
|
|
106
|
+
* by comparing the old and new subscriptions.
|
|
107
|
+
*/
|
|
108
|
+
@property (strong, nonatomic) NSDictionary<NSString *, NSNumber *> *subscriptions;
|
|
109
|
+
|
|
110
|
+
/** effectiveSubscriptions s a dictionary of NSNumber instances indicating the granted MQTTQoSLevel, or 0x80 for subscription failure.
|
|
111
|
+
* The keys are topic filters.
|
|
112
|
+
* effectiveSubscriptions is observable and is updated everytime subscriptions change
|
|
113
|
+
* @code
|
|
114
|
+
...
|
|
115
|
+
MQTTSessionManager *manager = [[MQTTSessionManager alloc] init];
|
|
116
|
+
manager.delegate = self;
|
|
117
|
+
|
|
118
|
+
[manager addObserver:self
|
|
119
|
+
forKeyPath:@"effectiveSubscriptions"
|
|
120
|
+
options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew
|
|
121
|
+
context:nil];
|
|
122
|
+
manager.subscriptions = [@{@"#": @(0)} mutableCopy];
|
|
123
|
+
[manager connectTo: ...
|
|
124
|
+
...
|
|
125
|
+
[manager removeObserver:self forKeyPath:@"effectiveSubscriptions"];
|
|
126
|
+
...
|
|
127
|
+
|
|
128
|
+
- (void)observeValueForKeyPath:(NSString *)keyPath
|
|
129
|
+
ofObject:(id)object
|
|
130
|
+
change:(NSDictionary<NSString *,id> *)change
|
|
131
|
+
context:(void *)context {
|
|
132
|
+
if ([keyPath isEqualToString:@"effectiveSubscriptions"]) {
|
|
133
|
+
MQTTSessionManager *manager = (MQTTSessionManager *)object;
|
|
134
|
+
DDLogVerbose(@"effectiveSubscriptions changed: %@", manager.effectiveSubscriptions);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
* @endcode
|
|
138
|
+
*/
|
|
139
|
+
@property (readonly, strong, nonatomic) NSDictionary<NSString *, NSNumber *> *effectiveSubscriptions;
|
|
140
|
+
|
|
141
|
+
/** SessionManager status
|
|
142
|
+
*/
|
|
143
|
+
@property (nonatomic, readonly) _MQTTSessionManagerState state;
|
|
144
|
+
|
|
145
|
+
/** SessionManager last error code when state equals MQTTSessionManagerStateError
|
|
146
|
+
*/
|
|
147
|
+
@property (nonatomic, readonly) NSError *lastErrorCode;
|
|
148
|
+
|
|
149
|
+
/** initWithPersistence sets the MQTTPersistence properties other than default
|
|
150
|
+
* @param persistent YES or NO (default) to establish file or in memory persistence.
|
|
151
|
+
* @param maxWindowSize (a positive number, default is 16) to control the number of messages sent before waiting for acknowledgement in Qos 1 or 2. Additional messages are stored and transmitted later.
|
|
152
|
+
* @param maxSize (a positive number of bytes, default is 64 MB) to limit the size of the persistence file. Messages published after the limit is reached are dropped.
|
|
153
|
+
* @param maxMessages (a positive number, default is 1024) to limit the number of messages stored. Additional messages published are dropped.
|
|
154
|
+
* @param maxRetryInterval The duration at which the connection-retry timer should be capped. When MQTTSessionManager receives a ClosedByBroker or an Error
|
|
155
|
+
event, it will attempt to reconnect to the broker. The time in between connection attempts is doubled each time, until it remains at maxRetryInterval.
|
|
156
|
+
Defaults to 64 seconds.
|
|
157
|
+
* @param connectInForeground Whether or not to connect the MQTTSession when the app enters the foreground, and disconnect when it becomes inactive. When NO, the caller is responsible for calling -connectTo: and -disconnect. Defaults to YES.
|
|
158
|
+
* @param streamSSLLevel an NSString containing the security level for read and write streams
|
|
159
|
+
* For list of possible values see:
|
|
160
|
+
* https://developer.apple.com/documentation/corefoundation/cfstream/cfstream_socket_security_level_constants
|
|
161
|
+
* Please also note that kCFStreamSocketSecurityLevelTLSv1_2 is not in a list
|
|
162
|
+
* and cannot be used as constant, but you can use it as a string value
|
|
163
|
+
* defaults to kCFStreamSocketSecurityLevelNegotiatedSSL
|
|
164
|
+
* @param queue Queue for MQTTSession.
|
|
165
|
+
* @return the initialized MQTTSessionManager object
|
|
166
|
+
*/
|
|
167
|
+
|
|
168
|
+
- (_MQTTSessionManager *)initWithPersistence:(BOOL)persistent
|
|
169
|
+
maxWindowSize:(NSUInteger)maxWindowSize
|
|
170
|
+
maxMessages:(NSUInteger)maxMessages
|
|
171
|
+
maxSize:(NSUInteger)maxSize
|
|
172
|
+
maxConnectionRetryInterval:(NSTimeInterval)maxRetryInterval
|
|
173
|
+
connectInForeground:(BOOL)connectInForeground
|
|
174
|
+
streamSSLLevel:(NSString *)streamSSLLevel
|
|
175
|
+
queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
|
|
176
|
+
|
|
177
|
+
/** Connects to the MQTT broker and stores the parameters for subsequent reconnects
|
|
178
|
+
* @param host specifies the hostname or ip address to connect to. Defaults to @"localhost".
|
|
179
|
+
* @param port specifies the port to connect to
|
|
180
|
+
* @param tls specifies whether to use SSL or not
|
|
181
|
+
* @param keepalive The Keep Alive is a time interval measured in seconds. The MQTTClient ensures that the interval between Control Packets being sent does not exceed the Keep Alive value. In the absence of sending any other Control Packets, the Client sends a PINGREQ Packet.
|
|
182
|
+
* @param clean specifies if the server should discard previous session information.
|
|
183
|
+
* @param auth specifies the user and pass parameters should be used for authenthication
|
|
184
|
+
* @param user an NSString object containing the user's name (or ID) for authentication. May be nil.
|
|
185
|
+
* @param pass an NSString object containing the user's password. If userName is nil, password must be nil as well.
|
|
186
|
+
* @param will indicates whether a will shall be sent
|
|
187
|
+
* @param willTopic the Will Topic is a string, may be nil
|
|
188
|
+
* @param willMsg the Will Message, might be zero length or nil
|
|
189
|
+
* @param willQos specifies the QoS level to be used when publishing the Will Message.
|
|
190
|
+
* @param willRetainFlag indicates if the server should publish the Will Messages with retainFlag.
|
|
191
|
+
* @param clientId The Client Identifier identifies the Client to the Server. If nil, a random clientId is generated.
|
|
192
|
+
* @param securityPolicy A custom SSL security policy or nil.
|
|
193
|
+
* @param certificates An NSArray of the pinned certificates to use or nil.
|
|
194
|
+
* @param protocolLevel Protocol version of the connection.
|
|
195
|
+
* @param connectHandler Called when first connected or if error occurred. It is not called on subsequent internal reconnects.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
- (void)connectTo:(NSString *)host
|
|
199
|
+
port:(NSInteger)port
|
|
200
|
+
tls:(BOOL)tls
|
|
201
|
+
keepalive:(NSInteger)keepalive
|
|
202
|
+
clean:(BOOL)clean
|
|
203
|
+
auth:(BOOL)auth
|
|
204
|
+
user:(NSString *)user
|
|
205
|
+
pass:(NSString *)pass
|
|
206
|
+
will:(BOOL)will
|
|
207
|
+
willTopic:(NSString *)willTopic
|
|
208
|
+
willMsg:(NSData *)willMsg
|
|
209
|
+
willQos:(_MQTTQosLevel)willQos
|
|
210
|
+
willRetainFlag:(BOOL)willRetainFlag
|
|
211
|
+
withClientId:(NSString *)clientId
|
|
212
|
+
securityPolicy:(_MQTTSSLSecurityPolicy *)securityPolicy
|
|
213
|
+
certificates:(NSArray *)certificates
|
|
214
|
+
protocolLevel:(_MQTTProtocolVersion)protocolLevel
|
|
215
|
+
connectHandler:(_MQTTConnectHandler)connectHandler;
|
|
216
|
+
|
|
217
|
+
/** Re-Connects to the MQTT broker using the parameters for given in the connectTo method
|
|
218
|
+
*/
|
|
219
|
+
- (void)connectToLast:(_MQTTConnectHandler)connectHandler;
|
|
220
|
+
|
|
221
|
+
/** publishes data on a given topic at a specified QoS level and retain flag
|
|
222
|
+
|
|
223
|
+
@param data the data to be sent. length may range from 0 to 268,435,455 - 4 - _lengthof-topic_ bytes. Defaults to length 0.
|
|
224
|
+
@param topic the Topic to identify the data
|
|
225
|
+
@param retainFlag if YES, data is stored on the MQTT broker until overwritten by the next publish with retainFlag = YES
|
|
226
|
+
@param qos specifies the Quality of Service for the publish
|
|
227
|
+
qos can be 0, 1, or 2.
|
|
228
|
+
@return the Message Identifier of the PUBLISH message. Zero if qos 0. If qos 1 or 2, zero if message was dropped
|
|
229
|
+
@note returns immediately.
|
|
230
|
+
*/
|
|
231
|
+
- (UInt16)sendData:(NSData *)data topic:(NSString *)topic qos:(_MQTTQosLevel)qos retain:(BOOL)retainFlag;
|
|
232
|
+
|
|
233
|
+
/** Disconnects gracefully from the MQTT broker
|
|
234
|
+
*/
|
|
235
|
+
- (void)disconnectWithDisconnectHandler:(_MQTTDisconnectHandler)disconnectHandler;
|
|
236
|
+
|
|
237
|
+
@end
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//
|
|
2
|
+
// MQTTTransport.h
|
|
3
|
+
// MQTTClient
|
|
4
|
+
//
|
|
5
|
+
// Created by Christoph Krey on 06.12.15.
|
|
6
|
+
// Copyright © 2015-2017 Christoph Krey. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
@protocol _MQTTTransportDelegate;
|
|
12
|
+
|
|
13
|
+
/** MQTTTransport is a protocol abstracting the underlying transport level for MQTTClient
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
@protocol _MQTTTransport <NSObject>
|
|
17
|
+
|
|
18
|
+
/** MQTTTransport state defines the possible state of an abstract transport
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
typedef NS_ENUM(NSInteger, _MQTTTransportState) {
|
|
22
|
+
|
|
23
|
+
/** MQTTTransportCreated indicates an initialized transport */
|
|
24
|
+
MQTTTransportCreated = 0,
|
|
25
|
+
|
|
26
|
+
/** MQTTTransportOpening indicates a transport in the process of opening a connection */
|
|
27
|
+
MQTTTransportOpening,
|
|
28
|
+
|
|
29
|
+
/** MQTTTransportCreated indicates a transport opened ready for communication */
|
|
30
|
+
MQTTTransportOpen,
|
|
31
|
+
|
|
32
|
+
/** MQTTTransportCreated indicates a transport in the process of closing */
|
|
33
|
+
MQTTTransportClosing,
|
|
34
|
+
|
|
35
|
+
/** MQTTTransportCreated indicates a closed transport */
|
|
36
|
+
MQTTTransportClosed
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** queue The queue where the streams are scheduled. */
|
|
40
|
+
@property (strong, nonatomic, nonnull) dispatch_queue_t queue;
|
|
41
|
+
|
|
42
|
+
/** streamSSLLevel an NSString containing the security level for read and write streams
|
|
43
|
+
* For list of possible values see:
|
|
44
|
+
* https://developer.apple.com/documentation/corefoundation/cfstream/cfstream_socket_security_level_constants
|
|
45
|
+
* Please also note that kCFStreamSocketSecurityLevelTLSv1_2 is not in a list
|
|
46
|
+
* and cannot be used as constant, but you can use it as a string value
|
|
47
|
+
* defaults to kCFStreamSocketSecurityLevelNegotiatedSSL
|
|
48
|
+
*/
|
|
49
|
+
@property (strong, nonatomic, nonnull) NSString *streamSSLLevel;
|
|
50
|
+
|
|
51
|
+
/** host an NSString containing the hostName or IP address of the host to connect to */
|
|
52
|
+
@property (strong, nonatomic, nonnull) NSString *host;
|
|
53
|
+
|
|
54
|
+
/** port an unsigned 32 bit integer containing the IP port number to connect to */
|
|
55
|
+
@property (nonatomic) UInt32 port;
|
|
56
|
+
|
|
57
|
+
/** MQTTTransportDelegate needs to be set to a class implementing th MQTTTransportDelegate protocol
|
|
58
|
+
* to receive delegate messages.
|
|
59
|
+
*/
|
|
60
|
+
@property (weak, nonatomic) _Nullable id<_MQTTTransportDelegate> delegate;
|
|
61
|
+
|
|
62
|
+
/** state contains the current MQTTTransportState of the transport */
|
|
63
|
+
@property (nonatomic) _MQTTTransportState state;
|
|
64
|
+
|
|
65
|
+
/** open opens the transport and prepares it for communication
|
|
66
|
+
* actual transports may require additional parameters to be set before opening
|
|
67
|
+
*/
|
|
68
|
+
- (void)open;
|
|
69
|
+
|
|
70
|
+
/** send transmits a data message
|
|
71
|
+
* @param data data to be send, might be zero length
|
|
72
|
+
* @result a boolean indicating if the data could be send or not
|
|
73
|
+
*/
|
|
74
|
+
- (BOOL)send:(nonnull NSData *)data;
|
|
75
|
+
|
|
76
|
+
/** close closes the transport */
|
|
77
|
+
- (void)close;
|
|
78
|
+
|
|
79
|
+
@end
|
|
80
|
+
|
|
81
|
+
/** MQTTTransportDelegate protocol
|
|
82
|
+
* Note: the implementation of the didReceiveMessage method is mandatory, the others are optional
|
|
83
|
+
*/
|
|
84
|
+
@protocol _MQTTTransportDelegate <NSObject>
|
|
85
|
+
|
|
86
|
+
/** didReceiveMessage gets called when a message was received
|
|
87
|
+
* @param mqttTransport the transport on which the message was received
|
|
88
|
+
* @param message the data received which may be zero length
|
|
89
|
+
*/
|
|
90
|
+
- (void)mqttTransport:(nonnull id<_MQTTTransport>)mqttTransport didReceiveMessage:(nonnull NSData *)message;
|
|
91
|
+
|
|
92
|
+
@optional
|
|
93
|
+
|
|
94
|
+
/** mqttTransportDidOpen gets called when a transport is successfully opened
|
|
95
|
+
* @param mqttTransport the transport which was successfully opened
|
|
96
|
+
*/
|
|
97
|
+
- (void)mqttTransportDidOpen:(_Nonnull id<_MQTTTransport>)mqttTransport;
|
|
98
|
+
|
|
99
|
+
/** didFailWithError gets called when an error was detected on the transport
|
|
100
|
+
* @param mqttTransport the transport which detected the error
|
|
101
|
+
* @param error available error information, might be nil
|
|
102
|
+
*/
|
|
103
|
+
- (void)mqttTransport:(_Nonnull id<_MQTTTransport>)mqttTransport didFailWithError:(nullable NSError *)error;
|
|
104
|
+
|
|
105
|
+
/** mqttTransportDidClose gets called when the transport closed
|
|
106
|
+
* @param mqttTransport the transport which was closed
|
|
107
|
+
*/
|
|
108
|
+
- (void)mqttTransportDidClose:(_Nonnull id<_MQTTTransport>)mqttTransport;
|
|
109
|
+
|
|
110
|
+
@end
|
|
111
|
+
|
|
112
|
+
@interface _MQTTTransport : NSObject <_MQTTTransport>
|
|
113
|
+
@end
|
|
114
|
+
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SSZipArchive.h
|
|
3
|
+
// SSZipArchive
|
|
4
|
+
//
|
|
5
|
+
// Created by Sam Soffes on 7/21/10.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#ifndef _SSZIPARCHIVE_H
|
|
9
|
+
#define _SSZIPARCHIVE_H
|
|
10
|
+
|
|
11
|
+
#import <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
#import "_SSZipCommon.h"
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
16
|
+
|
|
17
|
+
extern NSString *const SSZipArchiveErrorDomain;
|
|
18
|
+
typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) {
|
|
19
|
+
SSZipArchiveErrorCodeFailedOpenZipFile = -1,
|
|
20
|
+
SSZipArchiveErrorCodeFailedOpenFileInZip = -2,
|
|
21
|
+
SSZipArchiveErrorCodeFileInfoNotLoadable = -3,
|
|
22
|
+
SSZipArchiveErrorCodeFileContentNotReadable = -4,
|
|
23
|
+
SSZipArchiveErrorCodeFailedToWriteFile = -5,
|
|
24
|
+
SSZipArchiveErrorCodeInvalidArguments = -6,
|
|
25
|
+
SSZipArchiveErrorCodeSymlinkEscapesTargetDirectory = -7,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
@protocol SSZipArchiveDelegate;
|
|
29
|
+
|
|
30
|
+
@interface SSZipArchive : NSObject
|
|
31
|
+
|
|
32
|
+
// Password check
|
|
33
|
+
+ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path;
|
|
34
|
+
+ (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NOTHROW;
|
|
35
|
+
|
|
36
|
+
// Total payload size
|
|
37
|
+
+ (NSNumber *)payloadSizeForArchiveAtPath:(NSString *)path error:(NSError **)error;
|
|
38
|
+
|
|
39
|
+
// Unzip
|
|
40
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination;
|
|
41
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id<SSZipArchiveDelegate>)delegate;
|
|
42
|
+
|
|
43
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path
|
|
44
|
+
toDestination:(NSString *)destination
|
|
45
|
+
overwrite:(BOOL)overwrite
|
|
46
|
+
password:(nullable NSString *)password
|
|
47
|
+
error:(NSError * *)error;
|
|
48
|
+
|
|
49
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path
|
|
50
|
+
toDestination:(NSString *)destination
|
|
51
|
+
overwrite:(BOOL)overwrite
|
|
52
|
+
password:(nullable NSString *)password
|
|
53
|
+
error:(NSError * *)error
|
|
54
|
+
delegate:(nullable id<SSZipArchiveDelegate>)delegate NS_REFINED_FOR_SWIFT;
|
|
55
|
+
|
|
56
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path
|
|
57
|
+
toDestination:(NSString *)destination
|
|
58
|
+
preserveAttributes:(BOOL)preserveAttributes
|
|
59
|
+
overwrite:(BOOL)overwrite
|
|
60
|
+
password:(nullable NSString *)password
|
|
61
|
+
error:(NSError * *)error
|
|
62
|
+
delegate:(nullable id<SSZipArchiveDelegate>)delegate;
|
|
63
|
+
|
|
64
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path
|
|
65
|
+
toDestination:(NSString *)destination
|
|
66
|
+
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
|
67
|
+
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
|
|
68
|
+
|
|
69
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path
|
|
70
|
+
toDestination:(NSString *)destination
|
|
71
|
+
overwrite:(BOOL)overwrite
|
|
72
|
+
password:(nullable NSString *)password
|
|
73
|
+
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
|
74
|
+
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
|
|
75
|
+
|
|
76
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path
|
|
77
|
+
toDestination:(NSString *)destination
|
|
78
|
+
preserveAttributes:(BOOL)preserveAttributes
|
|
79
|
+
overwrite:(BOOL)overwrite
|
|
80
|
+
nestedZipLevel:(NSInteger)nestedZipLevel
|
|
81
|
+
password:(nullable NSString *)password
|
|
82
|
+
error:(NSError **)error
|
|
83
|
+
delegate:(nullable id<SSZipArchiveDelegate>)delegate
|
|
84
|
+
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
|
85
|
+
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
|
|
86
|
+
|
|
87
|
+
+ (BOOL)unzipFileAtPath:(NSString *)path
|
|
88
|
+
toDestination:(NSString *)destination
|
|
89
|
+
preserveAttributes:(BOOL)preserveAttributes
|
|
90
|
+
overwrite:(BOOL)overwrite
|
|
91
|
+
symlinksValidWithin:(nullable NSString *)symlinksValidWithin
|
|
92
|
+
nestedZipLevel:(NSInteger)nestedZipLevel
|
|
93
|
+
password:(nullable NSString *)password
|
|
94
|
+
error:(NSError **)error
|
|
95
|
+
delegate:(nullable id<SSZipArchiveDelegate>)delegate
|
|
96
|
+
progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler
|
|
97
|
+
completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler;
|
|
98
|
+
|
|
99
|
+
// Zip
|
|
100
|
+
// default compression level is Z_DEFAULT_COMPRESSION (from "zlib.h")
|
|
101
|
+
// keepParentDirectory: if YES, then unzipping will give `directoryName/fileName`. If NO, then unzipping will just give `fileName`. Default is NO.
|
|
102
|
+
|
|
103
|
+
// without password
|
|
104
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths;
|
|
105
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath;
|
|
106
|
+
|
|
107
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory;
|
|
108
|
+
|
|
109
|
+
// with optional password, default encryption is AES
|
|
110
|
+
// don't use AES if you need compatibility with native macOS unzip and Archive Utility
|
|
111
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(nullable NSString *)password;
|
|
112
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(nullable NSString *)password progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
|
|
113
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password;
|
|
114
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password;
|
|
115
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path
|
|
116
|
+
withContentsOfDirectory:(NSString *)directoryPath
|
|
117
|
+
keepParentDirectory:(BOOL)keepParentDirectory
|
|
118
|
+
withPassword:(nullable NSString *)password
|
|
119
|
+
andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
|
|
120
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path
|
|
121
|
+
withContentsOfDirectory:(NSString *)directoryPath
|
|
122
|
+
keepParentDirectory:(BOOL)keepParentDirectory
|
|
123
|
+
compressionLevel:(int)compressionLevel
|
|
124
|
+
password:(nullable NSString *)password
|
|
125
|
+
AES:(BOOL)aes
|
|
126
|
+
progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler;
|
|
127
|
+
//suport symlink compress --file
|
|
128
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray<NSString *> *)paths withPassword:(nullable NSString *)password keepSymlinks:(BOOL)keeplinks;
|
|
129
|
+
//suport symlink compress --directory
|
|
130
|
+
+ (BOOL)createZipFileAtPath:(NSString *)path
|
|
131
|
+
withContentsOfDirectory:(NSString *)directoryPath
|
|
132
|
+
keepParentDirectory:(BOOL)keepParentDirectory
|
|
133
|
+
compressionLevel:(int)compressionLevel
|
|
134
|
+
password:(nullable NSString *)password
|
|
135
|
+
AES:(BOOL)aes
|
|
136
|
+
progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler
|
|
137
|
+
keepSymlinks:(BOOL)keeplinks;
|
|
138
|
+
|
|
139
|
+
- (instancetype)init NS_UNAVAILABLE;
|
|
140
|
+
- (instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER;
|
|
141
|
+
- (BOOL)open;
|
|
142
|
+
- (BOOL)openForAppending;
|
|
143
|
+
|
|
144
|
+
/// write empty folder
|
|
145
|
+
- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password;
|
|
146
|
+
/// write file
|
|
147
|
+
- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password;
|
|
148
|
+
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password;
|
|
149
|
+
- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes;
|
|
150
|
+
///write symlink files
|
|
151
|
+
- (BOOL)writeSymlinkFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes;
|
|
152
|
+
/// write data
|
|
153
|
+
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password;
|
|
154
|
+
- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes;
|
|
155
|
+
|
|
156
|
+
- (BOOL)close;
|
|
157
|
+
|
|
158
|
+
@end
|
|
159
|
+
|
|
160
|
+
@protocol SSZipArchiveDelegate <NSObject>
|
|
161
|
+
|
|
162
|
+
@optional
|
|
163
|
+
|
|
164
|
+
- (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo;
|
|
165
|
+
- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath;
|
|
166
|
+
|
|
167
|
+
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
|
|
168
|
+
- (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
|
|
169
|
+
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;
|
|
170
|
+
- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath;
|
|
171
|
+
|
|
172
|
+
- (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total;
|
|
173
|
+
|
|
174
|
+
@end
|
|
175
|
+
|
|
176
|
+
NS_ASSUME_NONNULL_END
|
|
177
|
+
|
|
178
|
+
#endif /* _SSZIPARCHIVE_H */
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#ifndef SSZipCommon
|
|
2
|
+
#define SSZipCommon
|
|
3
|
+
|
|
4
|
+
// typedefs moved from mz_compat.h to here for public access
|
|
5
|
+
|
|
6
|
+
/* unz_global_info structure contain global data about the ZIPfile
|
|
7
|
+
These data comes from the end of central dir */
|
|
8
|
+
typedef struct unz_global_info64_s
|
|
9
|
+
{
|
|
10
|
+
uint64_t number_entry; /* total number of entries in the central dir on this disk */
|
|
11
|
+
uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */
|
|
12
|
+
uint16_t size_comment; /* size of the global comment of the zipfile */
|
|
13
|
+
} unz_global_info64;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
typedef struct unz_global_info_s
|
|
17
|
+
{
|
|
18
|
+
uint32_t number_entry; /* total number of entries in the central dir on this disk */
|
|
19
|
+
uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */
|
|
20
|
+
uint16_t size_comment; /* size of the global comment of the zipfile */
|
|
21
|
+
} unz_global_info;
|
|
22
|
+
|
|
23
|
+
/* unz_file_info contain information about a file in the zipfile */
|
|
24
|
+
/* https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT */
|
|
25
|
+
typedef struct unz_file_info64_s
|
|
26
|
+
{
|
|
27
|
+
uint16_t version; /* version made by 2 bytes */
|
|
28
|
+
uint16_t version_needed; /* version needed to extract 2 bytes */
|
|
29
|
+
uint16_t flag; /* general purpose bit flag 2 bytes */
|
|
30
|
+
uint16_t compression_method; /* compression method 2 bytes */
|
|
31
|
+
uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */
|
|
32
|
+
struct tm tmu_date;
|
|
33
|
+
uint32_t crc; /* crc-32 4 bytes */
|
|
34
|
+
uint64_t compressed_size; /* compressed size 8 bytes */
|
|
35
|
+
uint64_t uncompressed_size; /* uncompressed size 8 bytes */
|
|
36
|
+
uint16_t size_filename; /* filename length 2 bytes */
|
|
37
|
+
uint16_t size_file_extra; /* extra field length 2 bytes */
|
|
38
|
+
uint16_t size_file_comment; /* file comment length 2 bytes */
|
|
39
|
+
|
|
40
|
+
uint32_t disk_num_start; /* disk number start 4 bytes */
|
|
41
|
+
uint16_t internal_fa; /* internal file attributes 2 bytes */
|
|
42
|
+
uint32_t external_fa; /* external file attributes 4 bytes */
|
|
43
|
+
|
|
44
|
+
uint64_t disk_offset;
|
|
45
|
+
|
|
46
|
+
uint16_t size_file_extra_internal;
|
|
47
|
+
} unz_file_info64;
|
|
48
|
+
|
|
49
|
+
typedef struct unz_file_info_s
|
|
50
|
+
{
|
|
51
|
+
uint16_t version; /* version made by 2 bytes */
|
|
52
|
+
uint16_t version_needed; /* version needed to extract 2 bytes */
|
|
53
|
+
uint16_t flag; /* general purpose bit flag 2 bytes */
|
|
54
|
+
uint16_t compression_method; /* compression method 2 bytes */
|
|
55
|
+
uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */
|
|
56
|
+
struct tm tmu_date;
|
|
57
|
+
uint32_t crc; /* crc-32 4 bytes */
|
|
58
|
+
uint32_t compressed_size; /* compressed size 4 bytes */
|
|
59
|
+
uint32_t uncompressed_size; /* uncompressed size 4 bytes */
|
|
60
|
+
uint16_t size_filename; /* filename length 2 bytes */
|
|
61
|
+
uint16_t size_file_extra; /* extra field length 2 bytes */
|
|
62
|
+
uint16_t size_file_comment; /* file comment length 2 bytes */
|
|
63
|
+
|
|
64
|
+
uint16_t disk_num_start; /* disk number start 2 bytes */
|
|
65
|
+
uint16_t internal_fa; /* internal file attributes 2 bytes */
|
|
66
|
+
uint32_t external_fa; /* external file attributes 4 bytes */
|
|
67
|
+
|
|
68
|
+
uint64_t disk_offset;
|
|
69
|
+
} unz_file_info;
|
|
70
|
+
|
|
71
|
+
#endif
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ZipArchive.h
|
|
3
|
+
// ZipArchive
|
|
4
|
+
//
|
|
5
|
+
// Created by Serhii Mumriak on 12/1/15.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
//! Project version number for ZipArchive.
|
|
11
|
+
FOUNDATION_EXPORT double ZipArchiveVersionNumber;
|
|
12
|
+
|
|
13
|
+
//! Project version string for ZipArchive.
|
|
14
|
+
FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[];
|
|
15
|
+
|
|
16
|
+
// In this header, you should import all the public headers of your framework using statements like #import <SSZipArchive.h>
|
|
17
|
+
|
|
18
|
+
// This is to account for the many different ways this library gets imported.
|
|
19
|
+
//#if __has_include(<SSZipArchive/SSZipArchive.h>)
|
|
20
|
+
//#import <SSZipArchive/SSZipArchive.h>
|
|
21
|
+
//#elif __has_include("../_SSZipArchive.h")
|
|
22
|
+
//#import "../_SSZipArchive.h"
|
|
23
|
+
//#else
|
|
24
|
+
//#import "_SSZipArchive.h"
|
|
25
|
+
//#endif
|
|
26
|
+
#import "_SSZipArchive.h"
|