ios - Undefined symbols for architecture armv7 error -
i've found unlock7 example project on github , i'm trying add blur (stackblur) background when music controllers shown,but have error when compile it:
axel-4:/var/mobile/unlock7 root# make package install /var/mobile/unlock7/theos/makefiles/targets/darwin-arm/iphone.mk:43: targeting ios 4.0 , higher not supported iphone-gcc. forcing clang. /var/mobile/unlock7/theos/makefiles/targets/darwin-arm/iphone.mk:53: deploying ios 3.0 while building 6.0 generate armv7-only binaries. /var/mobile/unlock7/theos/makefiles/master/bundle.mk:17: warning: overriding commands target `unlock7' /var/mobile/unlock7/theos/makefiles/master/tweak.mk:20: warning: ignoring old commands target `unlock7' making tweak unlock7... make[2]: nothing done `internal-library-compile'. making bundle unlock7... copying resource directories bundle wrapper... linking bundle unlock7... undefined symbols architecture armv7: "_mshookmessageex", referenced from: _logoslocalinit() in tweak.xm.a06cfd38.o ld: symbol(s) not found architecture armv7 clang: error: linker command failed exit code 1 (use -v see invocation) make[2]: *** [obj/unlock7.bundle/unlock7.64873355.unsigned] error 1 make[1]: *** [internal-bundle-all_] error 2 make: *** [unlock7.all.bundle.variables] error 2
this makefile:
export go_easy_on_me = 1 include theos/makefiles/common.mk tweak_name = unlock7 bundle_name = unlock7 com.bushe.unlock7_install_path = /library/mobilesubstrate/dynamiclibraries unlock7_files = tweak.xm uiimage+stackblur.m unlock7_frameworks = uikit coregraphics include $(theos_make_path)/tweak.mk include $(theos)/makefiles/bundle.mk after-install:: install.exec "killall -9 springboard"
and here code:
#import <uikit/uikit.h> #import <uiimage+stackblur.h> #import <logos/logos.h> #define kbundlepath @"/library/mobilesubstrate/dynamiclibraries/unlock7.bundle" @interface nowplayingartplugincontroller : nsobject - (id)view; @end @interface sbawayview : uiview -(id)topbar; -(id)bottombar; -(id)_defaultdesktopimage; @end @interface sbawaydateview : uiview -(void)setpositon; @end @interface sbdevicelockviewwithkeypad : uiview @end @interface sbawaycontroller : nsobject -(id)sharedawaycontroller; @end @interface tplcdtextview : uiview {} -(void)setshadowcolor:(uicolor *)fp8; -(void)settext:(id)fp8; -(void)settextcolor:(uicolor *)fp8; -(void)setfont:(uifont*)font; - (void)setlcdtextfont:(id)arg1; @end cgpoint _priorpoint; %hook sbawayview -(void)finishedanimatingin{ %orig; uiview *&_backgroundview(mshookivar<uiview *>(self, "_backgroundview")); [_backgroundview setuserinteractionenabled:yes]; //allows backbround use gesture [[self dateheaderview] setpositon]; //reset position of date view below larger clock uipangesturerecognizer *panrecognizer = [[uipangesturerecognizer alloc] initwithtarget:self action:@selector(newunlockstylemover:)]; [panrecognizer setminimumnumberoftouches:1]; [panrecognizer setmaximumnumberoftouches:1]; //[_backgroundview addgesturerecognizer:panrecognizer] can used incompatible lockhtml [[self.subviews objectatindex:0] addgesturerecognizer:panrecognizer]; //add gesture background view or lockhtml's z order organizer [panrecognizer release]; panrecognizer = [[uipangesturerecognizer alloc] initwithtarget:self action:@selector(newunlockstylemover:)]; [panrecognizer setminimumnumberoftouches:1]; [panrecognizer setmaximumnumberoftouches:1]; [[self bottombar] addgesturerecognizer:panrecognizer]; //lockbar [panrecognizer release]; panrecognizer = [[uipangesturerecognizer alloc] initwithtarget:self action:@selector(newunlockstylemover:)]; [panrecognizer setminimumnumberoftouches:1]; [panrecognizer setmaximumnumberoftouches:1]; [[self topbar] addgesturerecognizer:panrecognizer]; //clock , date view's [panrecognizer release]; [self _settopbarimage:[self getuiimageforcontrols] shadowcolor:[uicolor clearcolor]]; [[uidevice currentdevice] begingeneratingdeviceorientationnotifications]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(orientationchanged:) name:uideviceorientationdidchangenotification object:[uidevice currentdevice]]; } %new - (void) orientationchanged:(nsnotification *)note { [[self dateheaderview] setpositon]; } %new - (void)newunlockstylemover:(uipangesturerecognizer *)sender { uiview *&_lockbar(mshookivar<uiview *>(self, "_lockbar")); float width = ([uiapplication sharedapplication].statusbarorientation == uiinterfaceorientationportrait || [uiapplication sharedapplication].statusbarorientation == uiinterfaceorientationportraitupsidedown) ? [[uiscreen mainscreen] bounds].size.width : [[uiscreen mainscreen] bounds].size.height; cgpoint point = [sender locationinview:sender.view.superview]; if (sender.state == uigesturerecognizerstatechanged){ uiimage *_defaultdesktopimage = [self _defaultdesktopimage]; for(uiview *obj in [self subviews]){ if(obj != [self.subviews objectatindex:0]){ cgpoint center = obj.center; if(center.x < width/2) center.x += (point.x - _priorpoint.x)/3; else center.x += point.x - _priorpoint.x; obj.center = center; } } } else if (sender.state == uigesturerecognizerstateended){ if(_lockbar.center.x < width){ for(uiview *obj in [self subviews]){ if(obj != [self.subviews objectatindex:0]){ cgpoint center = obj.center; center.x = width/2; [uiview animatewithduration:0.6 animations:^{ obj.center = center; } completion:^(bool finished){ }]; } } } else{ for(uiview *obj in [self subviews]){ if(obj != [self.subviews objectatindex:0]){ cgpoint center = obj.center; center.x = width+(width/2); [uiview animatewithduration:0.2 animations:^{ obj.center = center; } completion:^(bool finished){ }]; } } if([[nsfilemanager defaultmanager] fileexistsatpath:[nsstring stringwithformat:@"/library/mobilesubstrate/dynamiclibraries/androidlock.dylib"]] == true && [[[nsdictionary dictionarywithcontentsoffile:@"/var/mobile/library/preferences/com.zmaster.androidlock.plist"] objectforkey:@"enable"] boolvalue] == true){ [[%c(sbawaycontroller) sharedawaycontroller] unlockwithsound:true bypasspinlock:[[%c(sbdevicelockcontroller) sharedcontroller] ispasswordprotected]]; cgpoint center = _lockbar.center; center.x = width/2; _lockbar.center = center; } else{ //[[%c(sbawaycontroller) sharedawaycontroller] _sendtodevicelockownersetshowingdevicelock:true animated:false]; [[[[%c(sbawaycontroller) sharedawaycontroller] awayview] bottombar] sethidden:yes]; [[[[%c(sbawaycontroller) sharedawaycontroller] awayview] bottombar] unlock]; } } } _priorpoint = point; } -(id)_topbarlcdimage{ return [self _topbarlcdcontrolsimage]; } - (id)_topbarlcdcontrolsimage{ return [self getuiimageforcontrols]; } %new -(uiimage*)getuiimageforcontrols{ uigraphicsbeginimagecontextwithoptions(cgsizemake([[uiscreen mainscreen] bounds].size.width, 133), no, 0.0); nsbundle *bundle = [[[nsbundle alloc] initwithpath:kbundlepath] autorelease]; nsstring *imagepath = [bundle pathforresource:@"blurbackground" oftype:@"png"]; uiimage *blank = uigraphicsgetimagefromcurrentimagecontext(); uiimage *myimage = [uiimage imagewithcontentsoffile:imagepath]; uiimage *myima=[[uiimage imagenamed:@"blurbackground.png"] normalized]; uiimage *blurima=[myima stackblur:29.8]; uigraphicsendimagecontext(); return blank; } - (void)_setplugincontroller:(id)arg1{ %orig(arg1); if ([arg1 ismemberofclass:nsclassfromstring(@"nowplayingartplugincontroller")]){ id plugincontroller = [self currentawayplugincontroller]; if ([plugincontroller ismemberofclass:nsclassfromstring(@"nowplayingartplugincontroller")]){ uiview *pluginview = [(nowplayingartplugincontroller *)plugincontroller view]; uipangesturerecognizer *panrecognizer = [[uipangesturerecognizer alloc] initwithtarget:self action:@selector(newunlockstylemover:)]; [panrecognizer setminimumnumberoftouches:1]; [panrecognizer setmaximumnumberoftouches:1]; //[panrecognizer setdelegate:self]; [pluginview addgesturerecognizer:panrecognizer]; [panrecognizer release]; for(uiview *obj in [[(nowplayingartplugincontroller *)plugincontroller view] subviews]){ if([obj iskindofclass:[uiimageview class]]){ if([[uiscreen mainscreen] bounds].size.width == 320) obj.frame = cgrectmake(0, 0, 256, 256); } if([obj iskindofclass:nsclassfromstring(@"nowplayingreflectionview")]){ [obj removefromsuperview]; } } if([[uiscreen mainscreen] bounds].size.width == 320) pluginview.frame = cgrectmake(32,160,256,256); } } } %end %hook sbawaycontroller - (void)undimscreen:(bool)arg1{ //slide lockscreen default position after screen sleeps float width = ([uiapplication sharedapplication].statusbarorientation == uiinterfaceorientationportrait || [uiapplication sharedapplication].statusbarorientation == uiinterfaceorientationportraitupsidedown) ? [[uiscreen mainscreen] bounds].size.width : [[uiscreen mainscreen] bounds].size.height; [[[[%c(sbawaycontroller) sharedawaycontroller] awayview] bottombar] sethidden:no]; for(uiview *obj in [[self awayview] subviews]){ if(obj != [[[self awayview] subviews] objectatindex:0]){ cgpoint center = obj.center; center.x = width/2; [uiview animatewithduration:0.6 animations:^{ obj.center = center; } completion:^(bool finished){ }]; } } %orig; } %end %hook sbawaydateview -(void)setframe:(cgrect)frame{ %orig; tplcdtextview *timelabel = mshookivar<tplcdtextview *>(self, "_timelabel"); [timelabel setlcdtextfont:[[timelabel font] fontwithsize:96]]; [timelabel setframe:cgrectmake(timelabel.frame.origin.x,timelabel.frame.origin.y,timelabel.frame.size.width,timelabel.frame.size.height+60)]; [self setpositon]; } %new -(void)setpositon{ tplcdtextview *datelabel = mshookivar<tplcdtextview *>(self, "_dateandtetheringlabel"); [datelabel setframe:cgrectmake(datelabel.frame.origin.x,100,datelabel.frame.size.width,datelabel.frame.size.height)]; } - (void)setvisible:(bool)arg1{ %orig; [self setpositon]; //attempt keep date view in proper location } - (void)resizeandpositionnowplayinglabels{ uilabel *_nowplayingtitlelabel = mshookivar<uilabel *>(self, "_nowplayingtitlelabel"); uilabel *_nowplayingartistlabel = mshookivar<uilabel *>(self, "_nowplayingartistlabel"); uilabel *_nowplayingalbumlabel = mshookivar<uilabel *>(self, "_nowplayingalbumlabel"); [_nowplayingtitlelabel setframe:cgrectmake(0,95,[[uiscreen mainscreen] bounds].size.width,20)]; [_nowplayingartistlabel setframe:cgrectmake(0,109,[[uiscreen mainscreen] bounds].size.width,20)]; [_nowplayingalbumlabel setframe:cgrectmake(0,122,[[uiscreen mainscreen] bounds].size.width,20)]; } %end %hook tplcdtextview %new -(uifont *)font{ uifont *font = mshookivar<uifont *>(self, "_font"); return font; } %end %hook sbawaylockbar -(id)wellimagename{ return nil; } - (bool)usesbackgroundimage { return no; } - (id)initwithframe:(struct cgrect)frame knobcolor:(int)color{ uiview *lockbar = %orig; uiimageview *&_shadowview(mshookivar<uiimageview *>(self, "_shadowview")); [_shadowview removefromsuperview]; return lockbar; } - (id)initwithframe:(struct cgrect)frame knobimage:(id)image{ uigraphicsbeginimagecontextwithoptions(cgsizemake(60, 47), no, 0.0); uiimage *blank = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); uiview *lockbar = %orig(frame,blank); uiimageview *&_shadowview(mshookivar<uiimageview *>(self, "_shadowview")); [_shadowview removefromsuperview]; return lockbar; } %end %hook sbdevicelockview - (void)notifydelegatethatcancelbuttonwaspressed{ //slide lockscreen default position after cancel button pressed in lockscreen float width = ([uiapplication sharedapplication].statusbarorientation == uiinterfaceorientationportrait || [uiapplication sharedapplication].statusbarorientation == uiinterfaceorientationportraitupsidedown) ? [[uiscreen mainscreen] bounds].size.width : [[uiscreen mainscreen] bounds].size.height; for(uiview *obj in [[[%c(sbawaycontroller) sharedawaycontroller] awayview] subviews]){ if(obj != [[[[%c(sbawaycontroller) sharedawaycontroller] awayview] subviews] objectatindex:0]){ cgpoint center = obj.center; center.x = width/2; [uiview animatewithduration:0.6 animations:^{ obj.center = center; } completion:^(bool finished){ }]; } [[[[%c(sbawaycontroller) sharedawaycontroller] awayview] bottombar] sethidden:no]; } %orig; } %end %hook sbawaymediacontrolsview - (void)layoutsubviews{ %orig; for(uiview *obj in [self subviews]){ if ([obj ismemberofclass:nsclassfromstring(@"uiview")]){ //this mediacontols thin line [obj removefromsuperview]; } } } %end %hook tplcdbar //everything here make sure there no thin black/grey line below view - (id)initwithdefaultsize{ id topbar = %orig; uiimageview *&_shadowview(mshookivar<uiimageview *>(self, "_shadowview")); [_shadowview removefromsuperview]; return topbar; } - (id)initwithdefaultsizefororientation:(int)arg1{ id topbar = %orig; uiimageview *&_shadowview(mshookivar<uiimageview *>(self, "_shadowview")); [_shadowview removefromsuperview]; return topbar; } -(id)initwithframe:(cgrect)frame{ id topbar = %orig; uiimageview *&_shadowview(mshookivar<uiimageview *>(self, "_shadowview")); [_shadowview removefromsuperview]; return topbar; } %end
any appreciated. thank you! (sorry bad english)
it because of tweak_name , bundle_name have same values. makefile should this:
export go_easy_on_me = 1 include theos/makefiles/common.mk tweak_name = unlock7 $(tweak_name)_install_path = /library/mobilesubstrate/dynamiclibraries $(tweak_name)_files = tweak.xm uiimage+stackblur.m $(tweak_name)_frameworks = uikit coregraphics include $(theos_make_path)/tweak.mk bundle_name = unlock7img $(bundle_name)_install_path = /library/mobilesubstrate/dynamiclibraries include $(theos)/makefiles/bundle.mk after-install:: install.exec "killall -9 springboard"
bundle_name has suffix different tweak_name. may use other name bundle.
redefine path bundle in source according new bundle name:
#define kbundlepath @"/library/mobilesubstrate/dynamiclibraries/unlock7img.bundle"
Comments
Post a Comment