react-native-instantpay-code-push 1.1.6 → 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.
@@ -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
- Log.i(fullTagName, value)
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(type == "WARNING_LOG"){
31
- Log.i(fullTagName, value)
32
- } else if(type == "ERROR_LOG") {
33
- Log.e(fullTagName, value)
34
- }
35
- else{
36
- Log.i(fullTagName, value)
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
- Log.e(CLASS_TAG, errorMessage)
66
+ CommonHelper.logPrint(CommonHelper.ERROR_LOG,CLASS_TAG, errorMessage)
68
67
  return false
69
68
  }
70
69
 
@@ -1,6 +1,5 @@
1
1
  package com.instantpaycodepush
2
2
 
3
- import android.util.Log
4
3
  import java.io.File
5
4
  import java.security.MessageDigest
6
5
 
@@ -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
 
@@ -1,6 +1,5 @@
1
1
  package com.instantpaycodepush
2
2
 
3
- import android.util.Log
4
3
  import kotlinx.coroutines.Dispatchers
5
4
  import kotlinx.coroutines.delay
6
5
  import kotlinx.coroutines.withContext
@@ -2,7 +2,6 @@ package com.instantpaycodepush
2
2
 
3
3
  import android.content.Context
4
4
  import android.util.Base64
5
- import android.util.Log
6
5
  import java.io.File
7
6
  import java.security.KeyFactory
8
7
  import java.security.PublicKey
@@ -1,6 +1,5 @@
1
1
  package com.instantpaycodepush
2
2
 
3
- import android.util.Log
4
3
  import java.io.BufferedInputStream
5
4
  import java.io.File
6
5
  import java.io.FileInputStream
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-instantpay-code-push",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",