iOS Hacker 使用Theos开发tweak
生活随笔
收集整理的這篇文章主要介紹了
iOS Hacker 使用Theos开发tweak
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
iOS Hacker 使用Theos開發(fā)tweak
mkdir /optexport THEOS=/opt/theos
sudo git clone git://github.com/DHowett/theos.git $THEOS
http://joedj.net/ldid ? ?//訪問下載ldid
cp ~/Downloads/ldid /opt/theos/bin/ldid ? //復制到bin目錄
curl -o /opt/theos/bin/dpkg-deb https://raw.githubusercontent.com/DHowett/dm.pl/master/dm.pl ?下載dpkg-deb
sudo chmod 777 /opt/theos/bin/dpkg-deb ? //設備權限
cd ~/Desktop
/opt/theos/bin/nic.pl ?//創(chuàng)建工程
NIC 2.0 - New Instance Creator
------------------------------
? [1.] iphone/activator_event
? [2.] iphone/application_modern
? [3.] iphone/cydget
? [4.] iphone/flipswitch_switch
? [5.] iphone/framework
? [6.] iphone/ios7_notification_center_widget
? [7.] iphone/library
? [8.] iphone/notification_center_widget
? [9.] iphone/preference_bundle_modern
? [10.] iphone/tool
? [11.] iphone/tweak
? [12.] iphone/xpc_service
Choose a Template (required): 11
Project Name (required): IOSREProject
Package Name [com.yourcompany.iosreproject]: com.iosreproject
Author/Maintainer Name [System Administrator]: exchen
[iphone/tweak] MobileSubstrate Bundle filter [com.apple.springboard]: com.apple.springboard
[iphone/tweak] List of applications to terminate upon installation (space-separated, '-' for none) [SpringBoard]: SpringBoard
Instantiating iphone/tweak in iosreproject/...
Done.
------------------------------
vi ~/Desktop/iosreproject/Makefile ? ?//修改Makefile文件
include $(THEOS)/makefiles/common.mk
THEOS_DEVICE_IP = 192.168.4.143
ARCHS = armv7 arm64
TARGET = iphone:latest:8.0
TWEAK_NAME = iOSREGreetings
iOSREGreetings_FILES = Tweak.xm
iOSREGreetings_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
? ? ? ? install.exec "killall -9 SpringBoard"
--------------------------------------------
vi ~/Desktop/iosreproject/tweak.mk ? ? //編寫代碼hook SpringBoard,讓開機之后彈出對話框
%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)application
{
? ? ? ? %orig;
? ? ? ? UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hook" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
? ? ? ? [alert show];
? ? ? ? [alert release];
}
%end
--------------------------------------------
export THEOS_DEVICE_IP=192.168.4.143 ? ? ? ? ? //手機的IP地址環(huán)境變量
--------------------------------------------
make package Install ? ? ? ? ? ? ? ? ? ? ? ? ? //開始安裝
> Making all for tweak iOSREProject…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (armv7)…
==> Linking tweak iOSREProject (armv7)…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
==> Linking tweak iOSREProject (arm64)…
==> Merging tweak iOSREProject…
==> Signing iOSREProject…
> Making stage for tweak iOSREProject…
dm.pl: building package `com.iosre.iosreproject:iphoneos-arm' in `./packages/com.iosre.iosreproject_0.0.1-3+debug_iphoneos-arm.deb'
==> Installing…
root@192.168.4.143's password:?
需要輸入兩次密碼,安裝成功之后,手機會自動重啟后會彈出對話框
總結
以上是生活随笔為你收集整理的iOS Hacker 使用Theos开发tweak的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Xcode 真机调试 iOS 应用的各种
- 下一篇: iOS Hacker 使用Reveal分