LoginSignup
2
2

More than 5 years have passed since last update.

Tweak on Tweak

Last updated at Posted at 2015-12-09

この記事は iOS Jailbreaking Advent Calendar 2015 の9日目の記事です。

はじめに

@r-plus の記事面白いですね。私は、最近CydiaSubStarteアドオンを作って遊んでいませんので、以前遊んでいたことを思い出しながら書いてみようと思います。

TweakのTweakについて考える

CCNowPlayingでAuxo 3に対してのTweakを実現して、Auxo 3のViewの上に対してボタンを配置していました。

alt

CydiaSubstrateはプロセスが読み込まれる際に、アルファベット順で /Library/MobileSubstrate/DynamicLibraris のdylibをロードするようです。もし自分のdylibが引っ掛けたいdylibより名前が若ければ引っ掛けれませんよね。
そういった場合、SpringBoardのロード後に %init を実行し、擬似的に遅延ロードを起こしています。
また、対象とするdylibのロードのタイミングが違う場合は、それによって適宜ロードするタイミングを変えてやります。

%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)application
{
    %orig;
    if (IS_IOS8()) {
        %init(Auxo3);
    }
}
%end

%init(hoge)hogeに関しては、@r-plus の7日目の記事に書かれているMeta class hooking.と同じですね。
その結果、このような感じでAuxo 3に対してExtension出来ます。

%group Auxo3
%hook UminoControlCenterBottomView
- (void)scrollViewWillBeginDragging:(UminoControlCenterBottomScrollView *)scrollView
{
    [self alphaButtonWithScrollView:scrollView];
    %orig;
...
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2