Search code examples
iosiphonejailbreak

iOS jailbreak: simple alert is not getting displayed in `applicationDidFinishLaunching`


I am newbie to jailbreak tweak development.Now i just want to get alert dialog when i will get my springboard loaded for first time.

Tweak.mx

%hook Springboard

-(void)applicationDidFinishLaunching:(id)application {
    %orig;

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:@"Hello akash " delegate:nil cancelButtonTitle:@"Thanx" otherButtonTitles:nil];
    [alert show];
    [alert release]
  }

%end

Makefile

include theos/makefiles/common.mk

ARCHS = armv7 armv7s arm64

test_FRAMEWORKS= UIKit

TWEAK_NAME = test
test_FILES = Tweak.xm

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
    install.exec "killall -9 SpringBoard"

So here I could compile this tweak properly,and also my iphone getting respring.So at this point I should get this alert,But I am not getting anything on screen.What step I am missing

I am using iPhone 5s with ios 7.1.2

Edit

I could see console output which logs below error

<Error>: MS:Error: dlopen(/Library/MobileSubstrate/DynamicLibraries/test.dylib, 9): no suitable image found.  Did find:
        /Library/MobileSubstrate/DynamicLibraries/test.dylib: no matching architecture in universal wrapper

And then i also see its filetype using file test.dylib

test.dylib: Mach-O universal binary with 2 architectures
test.dylib (for architecture armv7):    Mach-O dynamically linked shared library arm
test.dylib (for architecture armv7s):   Mach-O dynamically linked shared library arm

That means,I am not getting arm64 architecture thats why its failing on my iPhone 5s because its 64bit,can anyone point out how to do that ?


Solution

  • Finally I found solution,

    Just need to put ARCHS = armv7 armv7s arm64 before include theos/makefiles/common.mk


    So now my makefile is as

    ARCHS = armv7 armv7s arm64 
    
    include theos/makefiles/common.mk
    
    
    test_FRAMEWORKS= UIKit
    
    TWEAK_NAME = test
    test_FILES = Tweak.xm
    
    include $(THEOS_MAKE_PATH)/tweak.mk
    
    after-install::
        install.exec "killall -9 SpringBoard"