Reveal - UI 分析工具

一、安装和简介

  a) download url

  b) Reveal 使用的方法有两种: Static Library Intefration, Dynamic Library Intefration。(我们使用 Dynamic Library Intefration)

 


 二、Dynamic Library Intefration

  a) 打开 Reveal -> Help -> Show Reveal Library In Finder, copy libReveal.dylib 到目标 app 的 Documents 目录。(我使用的是新浪的天气通)

  b) 创建 RevealUtil.h 和 RevealUtil.m,来自《iOS应用逆向工程》。

  RevealUtil.h

#import <Foundation/Foundation.h>

@interface RevealUtil : NSObject {
    @private
        void* revealLib;
}

- (void)startReveal;
- (void)stopReveal;

@end

  RevealUtil.m  

#import "RevealUtil.h"
#import <dlfcn.h>

@implementation RevealUtil

- (void)startReveal {
    NSString* revealLibName = @"libReveal.dylib";
    NSString* documentDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
    NSString* dyLibPath = [documentDirectory stringByAppendingPathComponent:revealLibName];
    
    revealLib = dlopen([dyLibPath cStringUsingEncoding:NSUTF8StringEncoding], RTLD_NOW);
    
    if (revealLib == nil) {
        char *error = dlerror();
        NSLog(@"dlopen error: %s", error);

    } else {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:self];
    }
}

- (void)stopReveal {
    if (revealLib != nil) {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:self];
        
        if (dlclose(revealLib) == 0) {
            revealLib = nil;
            
        } else {
            char *error = dlerror();
            NSLog(@"Reveal Library could not be unloaded: %s", error);
        }
    }
}

@end

  c) 创建一个 Theos Tweak 项目(ref

  d) 修改 xxxtweak.plist,如下

  e) 修改 Tweak.xm 如下, (注意:这里 hook 的 class name 一定要对应,我这里是凭感觉猜的)

  f) 修改 makefile 文件,如下

  g) 打包安装到 ios 设备上,先关闭之前代开的目标应用,然后重新打开,并打开 mac 端的 Reveal,会有如下效果:(注意:保持 ios 设备和 mac 处于同一网段)

  

  

转载于:https://www.cnblogs.com/eileenleung/p/3843028.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值