preface
Recently, Apple has made the hot update and private library problem check more strict. If the application is rejected, Apple will use strings/otool/nm command to conduct self-check in the rejection letter. Therefore, some commands are summarized to facilitate the search and location of file content related information.
1, grep
-
Function: Checks whether a string is included
-
Example:
The grep -r "XXX" path
Check for (weixin) string:
matches
2, strings,
-
Find the printable strings in an object, or other binary, file
-
Example:
Strings a.out | grep hello/check/a.out file containing a sequence of bytes hello string
-
Check binary for libraries containing keywords (e.g. check private libraries) :
-
More instructions man Strings
3, otool
-
Using the object file displaying tool. This tool is used to discover which system libraries are used, which methods are called, and which objects and properties are used in the library.
-
Example use: otool -l path // to see which libraries are linked by executables
Otool -l path | grep “XXX” / / does the filter link XXX library
Otool -d path // View supported architectures
Otool -ov path //output the Objective-C class structures and their defined methods.
-
Check whether the application on shell: otool -l path | grep crypt / / cryptid 0 (hit shell) 1 (not hit a shell)
-
Man otool
4, nm
-
Display name list (symbol table).
-
Example: nm path // Get the program symbol table in Mach-O
Nm-nm path// All symbols of the target file
The symbol table is marked as undefined, which means that the object file refers to the class _XXX (XXX library), but this does not implement it.
-
Man nm
5, the file
-
Determine the file type.
-
Example: file path
A /framework is a static or dynamic library.
The dynamic library:
6, lipo
-
Function: create or operate on universal files
-
Example: lipo-info ‘file path’ // Check the platform supported by the static library. – i386 armv7 armv7s x86_64 arm64
Lipo -remove i386 origin_xxx.a -output op_xxx.a // Delete the i386 platform included in the static library
Lipo-thin I386 origin_XXx. a -output op_xxx.a // Split the static library, leaving only the I386 CPU architecture
Lipo-create device_xxx.a simulator_xxx.a -output universal_xxx.a // Print
Refer to the reading
- “nm tool” Xcode manual page
- Ios-private-api-scanner summary of iOS private API scanning · MRmign/ios-private-api-scanner
- Ios-private-api-checker Apple iOS private API check tool
- IOS development – How to determine whether the framework is a dynamic library or a static library and whether the Framework static library is a static library