最新Reveal安裝與使用,可以查看任意AppUI布局。

來源:互聯網
上載者:User

標籤:cti   col   項目   loader   串連   AC   準備   匯入   location   

  最近在看iOS逆向的資料,發現了調試UI的工具--Reveal,發現這在實際開發中也是很有用處。當我們需要參照其他App介面布局的時候,使用這個工具可以看他的布局情況。不過這需要手機越獄才行。如果沒有越獄的話,只能調試自己的App,有同學會說,如果是自己的App,那我用內建就夠了,其實Reveal有個比Xcode內建的更有用的功能。Reveal提供一個可以即時改布局屬性的功能,即我不需要修改代碼,再重啟App來查看。只需要在右邊約束直接修改數值,斷行符號一下,就能看到相關的布局了,類似於前端通過瀏覽器修改介面,個人覺得非常的方便。

  安裝與使用Reveal的主要步驟:
  1. 安裝Reveal軟體。
  2. 匯入RevealServer.framework到項目的根目錄。(記得打包前移除,RevealServer.framework在Reveal應用的Help-->Show Reveal Library in Finder-->iOS Library中擷取,如果是調試自己的App,到這一步就可以了)。
  3. 將libReveal.dylib和libReveal.plist移到iOS裝置的目錄/Library/MobileSubstrate/DynamicLibraries。
  1. 安裝Reveal軟體:

    78843023 這位博主大大提供了破解版。裡邊也有其他幾種方式使用Reveal,這裡就記錄使用過的最簡單的方式。

  2. 匯入RevealServer.framework到項目的根目錄: 

    RevealServer.framework在Reveal應用的Help-->Show Reveal Library in Finder-->iOS Library中擷取。取到後,拖進項目的根目錄。然後在TARGETS中添加RevealServer.framework。

  

    到這一步後,運行項目,開啟Reveal,即可看到對應的項目。

    隨便選擇一個即可看到對應的層級結構。到這一步就能調試自己的App了。

  3. 查看其它任意App的布局:

    這一步需要越獄的手機,越獄的方法很多,PP助手、愛思助手都可以。越獄後在Cydia中安裝三個重要的外掛程式:Cydia Substrate、OpenSSH、Reveal Loader。

    安裝好對應的外掛程式後,開始準備工作:

    1. 將libReveal.dylib和libReveal.plist移到iOS裝置的目錄/Library/MobileSubstrate/DynamicLibraries。新版的Reveal沒有libReveal.dylib。需要將RevealServer.framework中的RevealServer檔案移入時重新命名成libReveal.dylib,使用的命令是(將IP地址換成iOS裝置的IP地址,主要要保持在一個區域網路內):
scp /Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer [email protected]192.168.2.6:/Library/MobileSubstrate/DynamicLibraries/libReveal.dylib

需要輸入的預設密碼是:apline

      這裡我因為試了一下 OpenSSH 能不能成功連上手機。使用了。"ssh [email protected]"。輸入密碼apline後,成功串連了iPhone的機子,再使用上面命令一直說找不到檔案目錄,是因為當前裝置主體不對。小小注意一下。另外類似的代碼將libReveal.plist也移入到裝置中:

scp xxx/libReveal.plist  [email protected]192.168.2.6:/Library/MobileSubstrate/DynamicLibraries/libReveal.plist 

    plist的內容是你要調試的App的bundle id。如:

 

    這裡再貼上一份。擷取手機所有應用的bundle id的代碼。

NSMutableArray *allID = [[NSMutableArray alloc] init];    Class  LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");    NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];    NSArray *appArray = [workspace  performSelector:@selector(allApplications)];    NSString *model = [UIDevice currentDevice].model;    for (NSString *str in appArray) {        //轉換成字串類型        NSString *string  =  [str description];        NSRange rg1 = [string rangeOfString:@">"];        string = [string substringFromIndex:rg1.location + 2];        if ([model isEqualToString:@"iPad"]) {            NSRange rg2 = [string rangeOfString:@"<"];            string = [string substringToIndex:rg2.location - 1];        }        NSDictionary *dic = @{@"bundleID":string};        [allID addObject:dic];    }    NSLog(@"allID-----%@",allID);

2. 在iOS裝置上設定中 Reveal 的Enabled Applications指定要查看的App。

 

 

到這裡就完成了。
接下來開啟你要查看的App,再開啟Reveal。即可看到對應介面。

 

最新Reveal安裝與使用,可以查看任意AppUI布局。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.