We are still performing updates to our application so that we can add it to the MacOS app store. The review bot is posting that the app is using a deprecated or private API and it seems to be referencing the use of Framework libarchive.2 . This is a Darwin open source library. Not sure I understand why it is deprecated or private API, what is the alternative we should be using the conforms with the MacOS app store ?
Why is libarchive.2 a deprecated or private API
Could you be a little more specific about the error and the file you are using? You could be talking about virtually anything.
It's same issue for me. when I upload the file to the server, I try to archive the file.
#include "archive.h"
#include "archive_entry.h"
....
archive_entry_set_mtime(entry, st.st_mtime, st.st_mtime * 1000);
Error: Your app uses or references the following non-public or deprecated APIs:
archive_entry_set_mtime
• Contents/MacOS/Myapp/_archive_entry_set_mtime
• Contents/Resources/MyappExt.app/Contents/MacOS/MyappExt/_archive_entry_set_mtime
• Contents/XPCServices/MyService-xpc.xpc/Contents/MacOS/MyService-xpc/_archive_entry_set_mtime
...
If you look in the platform SDK path, you'll see two "tbd" files for libarchive. However, there are no header files. This means that libarchive is something that Apple uses internally for some other, supported API.
Obviously, Apple would prefer that you use the higher-level API instead. This is probably the Apple Archive Swift module.
It is always tricky trying to link to your own version of a dynamic library when the system includes a different version. App Store submission makes that even more difficult because it is directly checking for usage of those internal symbols. What you'll have to do is build a static version of libarchive and link to that. Make sure that your binary doesn't link to libarchive. You can use the "otool -L" tool for this. Also do a grep for the symbols that the App Review bot is complaining about and make sure those don't exist in the binary either. This may require some rather obscure linking commands, but I'm not sure.
And if you are using an XPC and/or other extensions, then you will probably have to link a separate static copy of libarchive into each executable artifact.