iOS开发-逆向注入SDK(三)MonkeyDev注入打包

文章目录

MonkeyDev

强大的工具集,MonkeyDev ,使用它行了!

安装教程见 Wiki

使用

  • 拿着之前通过 frida砸壳 的 ipa包,先创建一个 MonkeyDev 工程。这里以 qqmusic 为例

在这里插入图片描述

  • 将砸壳的 ipa 放到 qqmusic/TargetApp/ 下,然后拖拽至工程文件中。

  • 设置主工程的证书,dylib的不用设置
    在这里插入图片描述
    提示 Showing All Messages Signing for "qqmusicDylib" requires a development team. Select a development team in the Signing & Capabilities editor. ,此时选择 qqmusicDylib->Build Settings->Add User-Defined Setting
    在这里插入图片描述
    添加 CODE_SIGNING_ALLOWED 为 NO,再运行即可。

  • file not found: /usr/lib/libstdc++.dylib 问题

    原因是新版本xcode去掉了libstdc++这个库,从老版本复制过来即可,这里直接使用别人的 https://github.com/devdawei/libstdc-

注入SDK

  • 可以运行之后,我们在工程中初始化pod,
修改pod文件,注释use_frameworks!
# platform :ios, '9.0'

target 'qqmusic' do
  # Comment the next line if you don't want to use dynamic frameworks
  # use_frameworks!
  pod 'GrowingAnalytics-cdp/Autotracker'
  # Pods for qqmusic

end

target 'qqmusicDylib' do
  # Comment the next line if you don't want to use dynamic frameworks
  # use_frameworks!
  pod 'GrowingAnalytics-cdp/Autotracker'
  # Pods for qqmusicDylib

end
  • 查找对应的appdelegate类,使用class-dump命令
class-dump -H xxx.app -o yourDir/Headers

发现其 AppDelegate 类叫 XXXXAppDelegate

在这里插入图片描述

// See http://iphonedevwiki.net/index.php/Logos

#import <UIKit/UIKit.h>
#import "GrowingAutotracker.h"

static NSString *const kGrowingProjectId = @"91eaf9b283361032";

%hook XXXXAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        BOOL result = %orig;
    GrowingTrackConfiguration *configuration = [GrowingTrackConfiguration configurationWithProjectId:kGrowingProjectId];
    configuration.debugEnabled = YES;
    configuration.impressionScale = 1.0;
    configuration.dataCollectionServerHost = @"https://run.mocky.io/v3/08999138-a180-431d-a136-051f3c6bd306";
    [GrowingAutotracker startWithConfiguration:configuration launchOptions:launchOptions];
        return result;
}

%end

然后再编译运行,至此,已经可以在App中调试SDK,并有相关日志输出了。

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值