《九阴真经: iOS黑客攻防秘籍》新书发布,干货满满,快来看看吧!

iOS 安全论坛 - 专注于研究 iOS 安全

 找回密码
 立即注册
查看: 7956|回复: 0

使用 Theos 开发 tweak

[复制链接]

119

主题

582

帖子

2626

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2626
发表于 2019-3-24 00:10:31 | 显示全部楼层 |阅读模式
mkdir /opt
export 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 //创建工程
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)applicationDidFinishLaunchingid)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地址环境变量
——————————————–
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:
需要输入两次密码,安装成功之后,手机会自动重启后会弹出对话框

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|iOSHacker

GMT+8, 2024-9-20 16:05 , Processed in 0.016753 second(s), 19 queries .

iOS安全论坛

© 2017-2020 iOS Hacker Inc. 京ICP备17074153号-2

快速回复 返回顶部 返回列表