react-native-instantpay-code-push 1.1.5 → 1.1.7
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/build.gradle +3 -0
- package/android/src/main/java/com/instantpaycodepush/BundleFileStorageService.kt +0 -5
- package/android/src/main/java/com/instantpaycodepush/BundleMetadata.kt +4 -9
- package/android/src/main/java/com/instantpaycodepush/CommonHelper.kt +12 -8
- package/android/src/main/java/com/instantpaycodepush/DecompressService.kt +1 -2
- package/android/src/main/java/com/instantpaycodepush/HashUtils.kt +0 -1
- package/android/src/main/java/com/instantpaycodepush/IpayCodePushImpl.kt +1 -3
- package/android/src/main/java/com/instantpaycodepush/OkHttpDownloadService.kt +0 -1
- package/android/src/main/java/com/instantpaycodepush/SignatureVerifier.kt +0 -1
- package/android/src/main/java/com/instantpaycodepush/ZipDecompressionStrategy.kt +0 -1
- package/lib/module/fetchUpdateInfo.js +1 -1
- package/lib/module/fetchUpdateInfo.js.map +1 -1
- package/package.json +1 -1
- package/src/fetchUpdateInfo.ts +1 -1
package/android/build.gradle
CHANGED
|
@@ -40,6 +40,9 @@ android {
|
|
|
40
40
|
def minBundleId = project.hasProperty("MIN_BUNDLE_ID") ? project.properties["MIN_BUNDLE_ID"] : null
|
|
41
41
|
buildConfigField "String", "MIN_BUNDLE_ID", minBundleId == null ? "\"null\"" : "\"${minBundleId}\""
|
|
42
42
|
|
|
43
|
+
//For Debug Log
|
|
44
|
+
def ipayCodePushLogEnable = project.hasProperty("IpayCodePush_Log") ? project.properties["IpayCodePush_Log"] : null
|
|
45
|
+
buildConfigField "boolean", "IpayCodePush_Log", ipayCodePushLogEnable == null ? "false" : "${ipayCodePushLogEnable}"
|
|
43
46
|
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -2,7 +2,6 @@ package com.instantpaycodepush
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.os.StatFs
|
|
5
|
-
import android.util.Log
|
|
6
5
|
import kotlinx.coroutines.Dispatchers
|
|
7
6
|
import kotlinx.coroutines.withContext
|
|
8
7
|
import java.io.File
|
|
@@ -168,7 +167,6 @@ class BundleFileStorageService(
|
|
|
168
167
|
}
|
|
169
168
|
} catch (e: Exception) {
|
|
170
169
|
CommonHelper.logPrint(CLASS_TAG, "Error checking isolationKey: ${e.message}")
|
|
171
|
-
Log.e(CLASS_TAG, "Error checking isolationKey: ${e.message}")
|
|
172
170
|
}
|
|
173
171
|
}
|
|
174
172
|
|
|
@@ -194,7 +192,6 @@ class BundleFileStorageService(
|
|
|
194
192
|
}
|
|
195
193
|
} catch (e: Exception) {
|
|
196
194
|
CommonHelper.logPrint(CLASS_TAG,"Error removing bundle ${file.name}: ${e.message}")
|
|
197
|
-
Log.e(CLASS_TAG, "Error removing bundle ${file.name}: ${e.message}")
|
|
198
195
|
}
|
|
199
196
|
}
|
|
200
197
|
}
|
|
@@ -202,7 +199,6 @@ class BundleFileStorageService(
|
|
|
202
199
|
CommonHelper.logPrint(CLASS_TAG, "Migration cleanup complete: removed $cleanedCount bundles")
|
|
203
200
|
} catch (e: Exception) {
|
|
204
201
|
CommonHelper.logPrint(CLASS_TAG, "Error during migration cleanup: ${e.message}")
|
|
205
|
-
Log.e(CLASS_TAG, "Error during migration cleanup: ${e.message}")
|
|
206
202
|
}
|
|
207
203
|
}
|
|
208
204
|
|
|
@@ -828,7 +824,6 @@ class BundleFileStorageService(
|
|
|
828
824
|
""
|
|
829
825
|
} catch (e: Exception) {
|
|
830
826
|
CommonHelper.logPrint(CLASS_TAG, "Error getting base URL: ${e.message}")
|
|
831
|
-
Log.e(CLASS_TAG, "Error getting base URL: ${e.message}")
|
|
832
827
|
""
|
|
833
828
|
}
|
|
834
829
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
package com.instantpaycodepush
|
|
2
2
|
|
|
3
|
-
import android.util.Log
|
|
4
3
|
import org.json.JSONArray
|
|
5
4
|
import org.json.JSONObject
|
|
6
5
|
import java.io.File
|
|
@@ -92,8 +91,7 @@ data class BundleMetadata(
|
|
|
92
91
|
|
|
93
92
|
metadata
|
|
94
93
|
} catch (e: Exception) {
|
|
95
|
-
CommonHelper.logPrint(CLASS_TAG, "Failed to load metadata from file $e")
|
|
96
|
-
Log.e(CLASS_TAG, "Failed to load metadata from file", e)
|
|
94
|
+
CommonHelper.logPrint(CLASS_TAG, "Failed to load metadata from file and Error Message : ${e.message} and Raw Error : $e")
|
|
97
95
|
null
|
|
98
96
|
}
|
|
99
97
|
|
|
@@ -119,8 +117,7 @@ data class BundleMetadata(
|
|
|
119
117
|
CommonHelper.logPrint(CLASS_TAG, "Saved metadata to file: ${file.absolutePath}")
|
|
120
118
|
true
|
|
121
119
|
} catch (e: Exception) {
|
|
122
|
-
CommonHelper.logPrint(CLASS_TAG, "Failed to save metadata to file: $e")
|
|
123
|
-
Log.e(CLASS_TAG, "Failed to save metadata to file", e)
|
|
120
|
+
CommonHelper.logPrint(CLASS_TAG, "Failed to save metadata to file! and Error Message : ${e.message} and Raw Error : $e")
|
|
124
121
|
false
|
|
125
122
|
}
|
|
126
123
|
}
|
|
@@ -184,8 +181,7 @@ data class CrashedHistory(
|
|
|
184
181
|
val json = JSONObject(jsonString)
|
|
185
182
|
fromJson(json)
|
|
186
183
|
} catch (e: Exception) {
|
|
187
|
-
CommonHelper.logPrint(CLSSS_TAG, "Failed to load crashed history from file: $e")
|
|
188
|
-
Log.e(CLSSS_TAG, "Failed to load crashed history from file", e)
|
|
184
|
+
CommonHelper.logPrint(CLSSS_TAG, "Failed to load crashed history from file! and Error Message : ${e.message} and Raw Error: $e")
|
|
189
185
|
CrashedHistory()
|
|
190
186
|
}
|
|
191
187
|
}
|
|
@@ -206,8 +202,7 @@ data class CrashedHistory(
|
|
|
206
202
|
CommonHelper.logPrint(CLSSS_TAG, "Saved crashed history to file: ${file.absolutePath}")
|
|
207
203
|
true
|
|
208
204
|
} catch (e: Exception) {
|
|
209
|
-
CommonHelper.logPrint(CLSSS_TAG, "Failed to save crashed history to file: $e")
|
|
210
|
-
Log.e(CLSSS_TAG, "Failed to save crashed history to file", e)
|
|
205
|
+
CommonHelper.logPrint(CLSSS_TAG, "Failed to save crashed history to file and Error Message : ${e.message} and Raw Error: $e")
|
|
211
206
|
false
|
|
212
207
|
}
|
|
213
208
|
|
|
@@ -17,7 +17,9 @@ object CommonHelper {
|
|
|
17
17
|
|
|
18
18
|
val fullTagName = "$MAIN_LOG_TAG $classTag"
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
if(BuildConfig.IpayCodePush_Log){
|
|
21
|
+
Log.i(fullTagName, value)
|
|
22
|
+
}
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
fun logPrint(type:String,classTag:String, value: String?) {
|
|
@@ -27,13 +29,15 @@ object CommonHelper {
|
|
|
27
29
|
|
|
28
30
|
val fullTagName = "$MAIN_LOG_TAG $classTag"
|
|
29
31
|
|
|
30
|
-
if(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
if(BuildConfig.IpayCodePush_Log){
|
|
33
|
+
if(type == "WARNING_LOG"){
|
|
34
|
+
Log.i(fullTagName, value)
|
|
35
|
+
} else if(type == "ERROR_LOG") {
|
|
36
|
+
Log.e(fullTagName, value)
|
|
37
|
+
}
|
|
38
|
+
else{
|
|
39
|
+
Log.i(fullTagName, value)
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
package com.instantpaycodepush
|
|
2
2
|
|
|
3
|
-
import android.util.Log
|
|
4
3
|
import java.io.File
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -64,7 +63,7 @@ class DecompressService {
|
|
|
64
63
|
Please verify the file is not corrupted and matches one of the supported formats.
|
|
65
64
|
""".trimIndent()
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
CommonHelper.logPrint(CommonHelper.ERROR_LOG,CLASS_TAG, errorMessage)
|
|
68
67
|
return false
|
|
69
68
|
}
|
|
70
69
|
|
|
@@ -2,7 +2,6 @@ package com.instantpaycodepush
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Context
|
|
5
|
-
import android.util.Log
|
|
6
5
|
import kotlinx.coroutines.Dispatchers
|
|
7
6
|
import kotlinx.coroutines.withContext
|
|
8
7
|
|
|
@@ -294,8 +293,7 @@ class IpayCodePushImpl {
|
|
|
294
293
|
reactIntegrationManager.reload(reactApplication)
|
|
295
294
|
}
|
|
296
295
|
} catch (e: Exception) {
|
|
297
|
-
CommonHelper.logPrint(CLASS_TAG, "Failed to reload application $e")
|
|
298
|
-
Log.e(CLASS_TAG, "Failed to reload application", e)
|
|
296
|
+
CommonHelper.logPrint(CommonHelper.ERROR_LOG,CLASS_TAG, "Failed to reload application and Error Message : ${e.message} and Raw Error : $e")
|
|
299
297
|
}
|
|
300
298
|
}
|
|
301
299
|
|
|
@@ -26,7 +26,7 @@ export const fetchUpdateInfo = async ({
|
|
|
26
26
|
if (response.status !== 200) {
|
|
27
27
|
throw new Error(response.statusText);
|
|
28
28
|
}
|
|
29
|
-
let outputBundle = response.json();
|
|
29
|
+
let outputBundle = await response.json();
|
|
30
30
|
if (outputBundle.statuscode == 'TXN') {
|
|
31
31
|
return outputBundle.data;
|
|
32
32
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fetchUpdateInfo","url","requestHeaders","onError","requestTimeout","payload","controller","AbortController","timeoutId","setTimeout","abort","headers","response","fetch","signal","method","body","JSON","stringify","clearTimeout","status","Error","statusText","outputBundle","json","statuscode","data","error","name"],"sourceRoot":"../../src","sources":["fetchUpdateInfo.ts"],"mappings":";;AAEA,OAAO,MAAMA,eAAe,GAAG,MAAAA,CAAO;EAClCC,GAAG;EACHC,cAAc;EACdC,OAAO;EACPC,cAAc,GAAG,IAAI;EACrBC;AAOJ,CAAC,KAAoC;EACjC,IAAI;IACA,MAAMC,UAAU,GAAG,IAAIC,eAAe,CAAC,CAAC;IACxC,MAAMC,SAAS,GAAGC,UAAU,CAAC,MAAM;MAC/BH,UAAU,CAACI,KAAK,CAAC,CAAC;IACtB,CAAC,EAAEN,cAAc,CAAC;IAElB,MAAMO,OAAO,GAAG;MACZ,cAAc,EAAE,kBAAkB;MAClC,GAAGT;IACP,CAAC;IAED,MAAMU,QAAQ,GAAG,MAAMC,KAAK,CAACZ,GAAG,EAAE;MAC9Ba,MAAM,EAAER,UAAU,CAACQ,MAAM;MACzBH,OAAO;MACPI,MAAM,EAAE,MAAM;MACdC,IAAI,EAAGC,IAAI,CAACC,SAAS,CAACb,OAAO;IACjC,CAAC,CAAC;IAEFc,YAAY,CAACX,SAAS,CAAC;IAEvB,IAAII,QAAQ,CAACQ,MAAM,KAAK,GAAG,EAAE;MACzB,MAAM,IAAIC,KAAK,CAACT,QAAQ,CAACU,UAAU,CAAC;IACxC;IAEA,IAAIC,YAAgB,
|
|
1
|
+
{"version":3,"names":["fetchUpdateInfo","url","requestHeaders","onError","requestTimeout","payload","controller","AbortController","timeoutId","setTimeout","abort","headers","response","fetch","signal","method","body","JSON","stringify","clearTimeout","status","Error","statusText","outputBundle","json","statuscode","data","error","name"],"sourceRoot":"../../src","sources":["fetchUpdateInfo.ts"],"mappings":";;AAEA,OAAO,MAAMA,eAAe,GAAG,MAAAA,CAAO;EAClCC,GAAG;EACHC,cAAc;EACdC,OAAO;EACPC,cAAc,GAAG,IAAI;EACrBC;AAOJ,CAAC,KAAoC;EACjC,IAAI;IACA,MAAMC,UAAU,GAAG,IAAIC,eAAe,CAAC,CAAC;IACxC,MAAMC,SAAS,GAAGC,UAAU,CAAC,MAAM;MAC/BH,UAAU,CAACI,KAAK,CAAC,CAAC;IACtB,CAAC,EAAEN,cAAc,CAAC;IAElB,MAAMO,OAAO,GAAG;MACZ,cAAc,EAAE,kBAAkB;MAClC,GAAGT;IACP,CAAC;IAED,MAAMU,QAAQ,GAA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