jailbreak - Theos tweak: helloworld alert box did not show up -
i followed http://brandontreb.com/beginning-jailbroken-ios-development-building-and-deployment make tweak. every thing seems fine , make package install successfull,
when iphone respring, "helloworld" box did not show up, done 1 knows how solve this?
my xcode 4.6 , sdk5.1 installed
iphone ios6.1.2
i set those
export theos=/opt/theos/ export sdkversion=5.1 export theos_device_ip=192.168.1.101
this makefile
export archs=armv7 export target=iphone:5.1 include $(theos)/makefiles/common.mk helloworld_frameworks = uikit tweak_name = helloworld helloworld_files = tweak.xm include $(theos)/makefiles/tweak.mk
and tweak.xm
#import <springboard/springboard.h> %hook springboard -(void)applicationdidfinishlaunching:(id)application { %orig; uialertview *alert = [[uialertview alloc] initwithtitle:@"welcome" message:@"hello world" delegate:nil cancelbuttontitle:@"123" otherbuttontitles:nil]; [alert show]; [alert release]; } %end
i figure out, *.plist should be
{ filter = { bundles = ( "com.apple.springboard" ); }; }
thanks @h2co3, find comment somewhere else
after done helloworld tweak.
hook fopen
using mshookfunction
and meet linking error
making tweak hw... preprocessing tweak.xm... compiling tweak.xm... linking tweak hw... undefined symbols architecture armv7: "_mshookfunction", referenced from: global constructors keyed tweak.xm.mmin tweak.xm.51941273.o ld: symbol(s) not found architecture armv7 collect2: ld returned 1 exit status make[2]: *** [.theos/obj/hw.dylib.ba964c90.unsigned] error 1 make[1]: *** [internal-library-all_] error 2 make: *** [hw.all.tweak.variables] error 2
this tweak.xm
#import "substrate.h" static file * (*s_orig_fopen) ( const char * filename, const char * mode ); static file * my_fopen ( const char * filename, const char * mode ){ return s_orig_fopen(filename, mode); } static void entry(void) __attribute__ ((constructor)); static void entry(void) { mshookfunction(fopen, my_fopen, &s_orig_fopen); }
Comments
Post a Comment