Microsoft Word - iOSAppReverseEngineering.docx

(Romina) #1
export TARGET = iphone:clang:8.1:8.0

It specifies the base SDK version of this project to 8.1, as well deployment target to iOS 8.0.


We can also specify “Base SDK” to “latest” to indicate that the project will be compiled with the


latest SDK of Xcode, like:


export TARGET = iphone:clang:latest:8.0

² Import frameworks


iOSREProject_FRAMEWORKS = framework name

For example:


iOSREProject_FRAMEWORKS = UIKit CoreTelephony CoreAudio

There is nothing to explain. However, as tweak developers, how to import private


frameworks attracts us more for sure. It’s not much difference to importing documented


frameworks:


iOSREProject_PRIVATE_FRAMEWORKS = private framework name

For example:


iOSREProject_PRIVATE_FRAMEWORKS = AppSupport ChatKit IMCore

Although it seems to be only one inserted word “ PRIVATE “, there’s more to notice.


Importing private frameworks is not allowed in AppStore development, most of us are not


familiar with them. Private frameworks change a lot in each iOS version, so before importing


them, please make sure of the existence of the imported frameworks. For example, if you want


your tweak to be compatible with both iOS 7 and iOS 8, then Makefile could be written as


follows:


export ARCHS = armv7 arm64
export TARGET = iphone:clang:latest:7.0

include theos/makefiles/common.mk

TWEAK_NAME = iOSREProject
iOSREProject_FILES = Tweak.xm
iOSREProject_PRIVATE_FRAMEWORK = BaseBoard
include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec "killall - 9 SpringBoard"

This tweak can be compiled and linked successfully without any error. However,


BaseBoard.framework only exists in SDK of iOS 8 and above, so this tweak would fail to work


on iOS 7 because of the lack of specified frameworks. In this case, “weak linking” or dyld series


functions like dlopen(), dlsym() and dlclose() can solve this problem.

Free download pdf