@trentrand/react-native-app-clip 0.6.2-beta.4 → 0.6.2-beta.6
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/package.json
CHANGED
|
@@ -38,7 +38,7 @@ function addBuildPhases(xcodeProject, { targetUuid, groupName, productFile, enab
|
|
|
38
38
|
if (enableCompression) {
|
|
39
39
|
xcodeProject.addBuildPhase([], "PBXShellScriptBuildPhase", "Compress JS Bundle", targetUuid, {
|
|
40
40
|
shellPath: "/bin/sh",
|
|
41
|
-
shellScript: 'if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then\n source "$PODS_ROOT/../.xcode.env"\nfi\nif [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then\n source "$PODS_ROOT/../.xcode.env.local"\nfi\n\nif [[ "$CONFIGURATION" != "Release" ]]; then\n exit 0\nfi\n\nBUNDLE="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/main.jsbundle"\n\nif [ -f "$BUNDLE" ]; then\n "$NODE_BINARY" -e "const fs=require(\'fs\');const zlib=require(\'zlib\');fs.
|
|
41
|
+
shellScript: 'if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then\n source "$PODS_ROOT/../.xcode.env"\nfi\nif [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then\n source "$PODS_ROOT/../.xcode.env.local"\nfi\n\nif [[ "$CONFIGURATION" != "Release" ]]; then\n exit 0\nfi\n\nBUNDLE="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/main.jsbundle"\n\nif [ -f "$BUNDLE" ]; then\n "$NODE_BINARY" -e "const fs=require(\'fs\');const zlib=require(\'zlib\');const data=fs.readFileSync(\'${BUNDLE}\');const compressed=zlib.deflateSync(data);fs.writeFileSync(\'${BUNDLE}.zlib\', compressed);fs.unlinkSync(\'${BUNDLE}\');"\nfi\n',
|
|
42
42
|
}, buildPath);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -48,8 +48,11 @@ function modifyAppDelegate(appDelegatePath) {
|
|
|
48
48
|
let compressedData = try Data(contentsOf: compressedURL)
|
|
49
49
|
|
|
50
50
|
// Decompress using NSData decompression (available iOS 13+)
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
let decompressedData: Data
|
|
52
|
+
do {
|
|
53
|
+
decompressedData = try (compressedData as NSData).decompressed(using: .zlib) as Data
|
|
54
|
+
} catch {
|
|
55
|
+
print("❌ Decompression failed: \(error)")
|
|
53
56
|
return nil
|
|
54
57
|
}
|
|
55
58
|
|