iosプラグイン開発-theos環境構築

4125 ワード

theosはiosが脱獄環境下で開発したエンジニアリング管理ツールです https://github.com/DHowett/theos
次に、環境構築プロセスを共有します.
  • xcodeにcommand line toolsをインストールする10.8からxcodeのcommand line toolsを自分でインストールします.インストールしていないと、gccがインストールされていないなど、いろいろな奇妙な問題が発生します.初心者はとても怖いです.https://developer.apple.com/downloads/?=Command%20Line%20Tools%20 
  • macportsのインストール macportsはdpkgをインストールするためのクイックインストールツールで、他にも多くのツールをインストールできますhttp://distfiles.macports.org/MacPorts 
  • 設定構成
  • export THEOS=/opt/theos

       4.theosをダウンロード
    sudo svn co http://svn.howett.net/svn/theos/trunk $THEOS

       5.ldidのダウンロード-証明書のシミュレーションに使用
    curl -s http://dl.dropbox.com/u/3157793/ldid > ~/Desktop/ldid
    chmod +x ~/Desktop/ldid 
    mv ~/Desktop/ldid $THEOS/bin/ldid

       6.dpkg取付
    sudo port install dpkg.

     7.libsubstrate.dylibのダウンロード コピー先 /opt/theos/lib 
    https://github.com/kokoabim/iOSOpenDev/blob/master/lib/libsubstrate.dylib 
      8.substrate.hコピーをダウンロード /opt/theos/header
    https://github.com/kokoabim/iOSOpenDev/blob/master/include/substrate.h 
    環境は基本的に完成して、hookのいくつかの特殊なヘッダファイルが必要ならば、自分でclass_を使うことができますdump_z解析はヘッダに入れて、googleで探すこともできます
    -----------------------------------------------------------------------------------------------------
    1.プロジェクトの作成
    $THEOS/bin/nic.pl
    
    NIC 1.0 - New Instance Creator —————————— 
    [1.] iphone/application   
    [2.] iphone/library   
    [3.] iphone/preference_bundle   
    [4.] iphone/tool   
    [5.] iphone/tweak 
    Choose a Template (required): 5
      com.apple.springboard      

    2.作成に成功したら、プロジェクトディレクトリの下で、MakeFileを変更してヘッダーの最初の行を変更します.
    export ARCHS = armv7
    export TARGET=iphone:latest:5.1
    include $(THEOS)/makefiles/common.mk

    3.Tweak.xmファイルコードの作成
    %hook SBScreenShotter 
    
    - (void)saveScreenshot:(BOOL)screenshot { 
    	%orig; 
     	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:@"Welcome to your iPhone love" delegate:nil cancelButtonTitle:@"okokok" otherButtonTitles:nil];
    	[alert show]; 
    	[alert release];
     } 
    
     %end
    %hook       hook    ,   %end  。          hook Springboard    method。
    %orig
        method     ,%orig        (original method)。         method    ,  :%orig(arg1,arg2)。      %orig,             。  ,   hook SpringBoard init  ,      %orig。    iphone     ,     ssh    app。

      上のコードの役割は、デスクトップのスクリーンショット中にダイアログボックスをポップアップすることです!もちろん、hookしたい関数が何なのか分からない場合は、いろいろな分析ツールを使って入手してください!、上のいくつかの文章を見ることができます.
    4.frameWorkを増やす
            UIKit framework   alert,     Makefile       :
    WelcomeWagon_FRAMEWORKS = UIKit

    5.梱包
       cdからエンジニアリングディレクトリの下、make、makeが成功した後、使用
       構成インストールの設定
    export THEOS_DEVICE_IP=10.242.125.7 (     IP)
    make package install

    リモートインストールを続行します.通常、インストールに失敗します.エラーは次のとおりです.
    /Users/TanghaoTsui/Code/coffee/firstdemo/theos/makefiles/targets/Darwin/iphone.mk:41: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
    install.exec "cat > /tmp/_theos_install.deb; dpkg -i /tmp/_theos_install.deb && rm /tmp/_theos_install.deb" < "./com.yourcompany.firstdemo_0.0.1-1_iphoneos-arm.deb"
    [email protected]'s password: 
    (Reading database ... 12996 files and directories currently installed.)
    Unpacking com.yourcompany.firstdemo (from /tmp/_theos_install.deb) ...
    dpkg-deb: file `/tmp/_theos_install.deb' contains ununderstood data member data.tar.xz , giving up
    dpkg: error processing /tmp/_theos_install.deb (--install):
    subprocess dpkg-deb --fsys-tarfile returned error exit status 2
    Errors were encountered while processing:
    /tmp/_theos_install.deb
    make: *** [internal-install] Error 1

    解決策は
    そしてもうhttps://github.com/moloch--/theos/blob/master/makefiles/package/deb.mk ダウンロード
    ディレクトリへ
    /opt/theos/makefiles/package/

    それでいいです.
    まだだめならダウンロードしてhttps://github.com/DHowett/dm.pl/blob/master/dm.pl ディレクトリ/opt/theos/binで