Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the podspec compiler flags mandatory for versions before 6.1.0.? #317

Open
kptp opened this issue Sep 19, 2024 · 12 comments
Open

Are the podspec compiler flags mandatory for versions before 6.1.0.? #317

kptp opened this issue Sep 19, 2024 · 12 comments

Comments

@kptp
Copy link

kptp commented Sep 19, 2024

I am having issues building this library on XCode 16. I noticed that in the latest version the compiler_flag GCC_PREPROCESSOR_DEFINITIONS has been removed from the Podspec. This fixes the issue I am having. However, I cannot update this library to the latest version as it requires iOS 15.5 and I have many users who are using an older iOS versions. (The vulnerability that requires iOS 15.5 update should not affect my app as I only use this library for unzipping)

I was wondering if the compiler_flags in the Podspec are actually required for version 6.0.9 of this library, or can they be removed? I can remove them with an npm patch or a pod post install script, which seem to work.

Env:

  • Device: iPhone, iPad
  • OS: iOS
  • OS Version: < 15.5
  • Package Version: 6.0.9
@plrthink
Copy link
Collaborator

Interesting, the compiler flag was introduced since using cocoapods to manage iOS deps, and I never thought what it could if removing that.

So, it maybe useless since the ziparchive(the underlying module) already has that.

@plrthink
Copy link
Collaborator

Anyway, thanks for reporting this, and I think we should release a patch on the v6 for anyone can't upgrade the deployment to iOS 15 and above.

@Pingou
Copy link

Pingou commented Sep 25, 2024

Hi @plrthink any timeline on when the patch will be out? Thank you.

@plrthink
Copy link
Collaborator

plrthink commented Sep 26, 2024 via email

@plrthink
Copy link
Collaborator

@Pingou I recap the recent changes and I think you should do the update if you're dispatching your app by App Store. Otherwise, even if I make the patch for the compiler flags issue, you still release new changes to the end users.

Here is the full story:

Due to recent Apple Store privacy requirements, third-party SDKs and libraries must now declare the reasons for accessing certain APIs, including those used by underlying libraries like minizip.

To comply with these new guidelines, we’ve updated SSZipArchive to version 2.5.5, which implements the necessary changes.

However, this update represents a significant jump from 2.2.0 to 2.5.5, including version 2.5.0, which introduces a breaking change: it now requires a minimum iOS deployment target of iOS 15.5+. This has become a blocker for developers who still need to support older iOS versions.

The reason for this breaking change is that SSZipArchive 2.5.0 addresses a potential security vulnerability in the zipping process, making the update essential for maintaining security.


As you can see, we need the code changes in SSZipArchive 2.5.5 to make the App Store privacy happy, which forces iOS deployment to be 15.5 at least.

@Pingou
Copy link

Pingou commented Sep 28, 2024

@plrthink Thank you for the details. Personally I just removed the flag from the podspec as I need to support ios 13, I haven't released yet, not sure if that will pass when uploading to the App Store.
"third-party SDKs and libraries must now declare the reasons for accessing certain APIs, including those used by underlying libraries like minizip." That seems a bit odd to me, the app should be able to declare them, right?
If that is the case could there be another version that just removes the flag and mentions in the documentation those needed declarations?
It is a bit unclear for me if you're saying that it is the security vulnerability changes that requires 15.5 or just the App Store privacy.
Personally I am not impacted by the security issues as I control the zip.

@plrthink
Copy link
Collaborator

plrthink commented Sep 28, 2024

"third-party SDKs and libraries must now declare the reasons for accessing certain APIs, including those used by underlying libraries like minizip." That seems a bit odd to me, the app should be able to declare them, right?

You can't add the privacy manifest on your own, it should be done by the library itself if I understand correctly.

If that is the case could there be another version that just removes the flag and mentions in the documentation those needed declarations?

My point is, that I have to upgrade the SSZipArchive to make the app satisfy the App Store requirement, which requires the minimum deployment target of 15.5.

Removing the flag itself can't help with the App Store requirement.

@plrthink
Copy link
Collaborator

Oh, I think I'm wrong, the app developer could make the privacy manifest on their own. And here is content: https://github.com/ZipArchive/ZipArchive/blob/main/SSZipArchive/Supporting%20Files/PrivacyInfo.xcprivacy.

But for maintenance reasons, I would not make the patch version for this since I would only fix bugs for the latest one.

So you can stick with your forked repo until you can upgrade to the v7+.

@hengkx
Copy link
Contributor

hengkx commented Oct 11, 2024

How to resolve?

@hujiang1
Copy link

如何解决?

@plrthink
Copy link
Collaborator

@hengkx @hujiang1 can you update to the latest version of this package? this should solve the problem after running pod install

@hengkx
Copy link
Contributor

hengkx commented Nov 28, 2024

diff --git a/node_modules/react-native-zip-archive/RNZipArchive.podspec b/node_modules/react-native-zip-archive/RNZipArchive.podspec
index 8eebcdc..1eada4c 100644
--- a/node_modules/react-native-zip-archive/RNZipArchive.podspec
+++ b/node_modules/react-native-zip-archive/RNZipArchive.podspec
@@ -15,7 +15,6 @@ Pod::Spec.new do |s|
 
   s.dependency 'React-Core'
   s.dependency 'SSZipArchive', '~>2.2'
-  s.compiler_flags = '-GCC_PREPROCESSOR_DEFINITIONS="HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB MZ_ZIP_NO_SIGNING $(inherited)"'
 
   s.subspec 'Core' do |ss|
     ss.source_files = 'ios/*.{h,m}'

@plrthink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants