ios - 架构 armv7 错误的 undefined symbol
<p><p>我在 github 上找到了 Unlock7 示例项目,现在我尝试在显示音乐 Controller 时将模糊(stackblur)添加到背景中,但在编译时出现此错误:</p>
<pre><code>AXel-4:/var/mobile/unlock7 root# make package install
/var/mobile/unlock7/theos/makefiles/targets/Darwin-arm/iphone.mk:43: Targeting iOS 4.0 and higher is not supported with iphone-gcc. Forcing clang.
/var/mobile/unlock7/theos/makefiles/targets/Darwin-arm/iphone.mk:53: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
/var/mobile/unlock7/theos/makefiles/master/bundle.mk:17: warning: overriding commands for target `Unlock7'
/var/mobile/unlock7/theos/makefiles/master/tweak.mk:20: warning: ignoring old commands for target `Unlock7'
Making all for tweak Unlock7...
make: Nothing to be done for `internal-library-compile'.
Making all for bundle Unlock7...
Copying resource directories into the bundle wrapper...
Linking bundle Unlock7...
Undefined symbols for architecture armv7:
"_MSHookMessageEx", referenced from:
_logosLocalInit() in Tweak.xm.a06cfd38.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** Error 1
make: *** Error 2
make: *** Error 2
</code></pre>
<p>这是生成文件:</p>
<pre><code>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"
</code></pre>
<p>这里是代码:</p>
<pre><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"));
; //Allows backbround to use gesture
[ setPositon]; //reset the position of the date view to be below the larger clock
UIPanGestureRecognizer *panRecognizer = [ initWithTarget:self action:@selector(newUnlockStyleMover:)];
;
;
// This can be used but is incompatible with LockHTML
[ addGestureRecognizer:panRecognizer]; //Add gesture to the background view or LockHTML's z order organizer
;
panRecognizer = [ initWithTarget:self action:@selector(newUnlockStyleMover:)];
;
;
[ addGestureRecognizer:panRecognizer]; //Lockbar
;
panRecognizer = [ initWithTarget:self action:@selector(newUnlockStyleMover:)];
;
;
[ addGestureRecognizer:panRecognizer]; //Clock and Date View's
;
shadowColor:];
[ beginGeneratingDeviceOrientationNotifications];
[
addObserver:self selector:@selector(orientationChanged:)
name:UIDeviceOrientationDidChangeNotification
object:];
}
%new
- (void) orientationChanged:(NSNotification *)note
{
[ setPositon];
}
%new
- (void)newUnlockStyleMover:(UIPanGestureRecognizer *)sender {
UIView *&_lockBar(MSHookIvar<UIView *>(self, "_lockBar"));
float width = (.statusBarOrientation == UIInterfaceOrientationPortrait || .statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown) ? [ bounds].size.width : [ bounds].size.height;
CGPoint point = ;
if (sender.state == UIGestureRecognizerStateChanged){
UIImage *_defaultDesktopImage = ;
for(UIView *obj in ){
if(obj != ){
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 ){
if(obj != ){
CGPoint center = obj.center;
center.x = width/2;
[UIView animateWithDuration:0.6
animations:^{
obj.center = center;
}
completion:^(BOOL finished){
}];
}
}
}
else{
for(UIView *obj in ){
if(obj != ){
CGPoint center = obj.center;
center.x = width+(width/2);
[UIView animateWithDuration:0.2
animations:^{
obj.center = center;
}
completion:^(BOOL finished){
}];
}
}
if([ fileExistsAtPath:] == TRUE && [[ 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 ;
}
- (id)_topBarLCDControlsImage{
return ;
}
%new
-(UIImage*)getUIImageForControls{
UIGraphicsBeginImageContextWithOptions(CGSizeMake([ bounds].size.width, 133), NO, 0.0);
NSBundle *bundle = [[ initWithPath:kBundlePath] autorelease];
NSString *imagePath = ;
UIImage *blank = UIGraphicsGetImageFromCurrentImageContext();
UIImage *myImage = ;
UIImage *myIma=[ normalized];
UIImage *blurIma=;
UIGraphicsEndImageContext();
return blank;
}
- (void)_setPluginController:(id)arg1{
%orig(arg1);
if (){
id pluginController = ;
if (){
UIView *pluginView = [(NowPlayingArtPluginController *)pluginController view];
UIPanGestureRecognizer *panRecognizer = [ initWithTarget:self action:@selector(newUnlockStyleMover:)];
;
;
//;
;
;
for(UIView *obj in [[(NowPlayingArtPluginController *)pluginController view] subviews]){
if(]){
if([ bounds].size.width == 320)
obj.frame = CGRectMake(0, 0, 256, 256);
}
if(){
;
}
}
if([ bounds].size.width == 320)
pluginView.frame = CGRectMake(32,160,256,256);
}
}
}
%end
%hook SBAwayController
- (void)undimScreen:(BOOL)arg1{
//Slide Lockscreen back to default position after the screen sleeps
float width = (.statusBarOrientation == UIInterfaceOrientationPortrait || .statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown) ? [ bounds].size.width : [ bounds].size.height;
[[[[%c(SBAwayController) sharedAwayController] awayView] bottomBar] setHidden:NO];
for(UIView *obj in [ subviews]){
if(obj != [[ 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");
fontWithSize:96]];
;
;
}
%new
-(void)setPositon{
TPLCDTextView *dateLabel = MSHookIvar<TPLCDTextView *>(self, "_dateAndTetheringLabel");
;
}
- (void)setVisible:(BOOL)arg1{
%orig;
; //attempt to 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");
bounds].size.width,20)];
bounds].size.width,20)];
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"));
;
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"));
;
return lockBar;
}
%end
%hook SBDeviceLockView
- (void)notifyDelegateThatCancelButtonWasPressed{
//Slide lockscreen back to default position after cancel button is pressed in lockscreen
float width = (.statusBarOrientation == UIInterfaceOrientationPortrait || .statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown) ? [ bounds].size.width : [ 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 ){
if (){ //This is the MediaContols Thin Line
;
}
}
}
%end
%hook TPLCDBar
//Everything here make sure there is no thin black/grey line below the view
- (id)initWithDefaultSize{
id topBar = %orig;
UIImageView *&_shadowView(MSHookIvar<UIImageView *>(self, "_shadowView"));
;
return topBar;
}
- (id)initWithDefaultSizeForOrientation:(int)arg1{
id topBar = %orig;
UIImageView *&_shadowView(MSHookIvar<UIImageView *>(self, "_shadowView"));
;
return topBar;
}
-(id)initWithFrame:(CGRect)frame{
id topBar = %orig;
UIImageView *&_shadowView(MSHookIvar<UIImageView *>(self, "_shadowView"));
;
return topBar;
}
%end
</code></pre>
<p>感谢任何帮助。
谢谢!
(对不起英语不好)</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>这是因为 TWEAK_NAME 和 BUNDLE_NAME 具有相同的值。 Makefile 应该是这样的:</p>
<pre><code>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"
</code></pre>
<p>BUNDLE_NAME 现在有一个不同于 TWEAK_NAME 的后缀。您可以为 bundle 使用任何其他名称。</p>
<p>根据新的bundle名称重新定义source中bundle的路径:</p>
<pre><code>#define kBundlePath @"/Library/MobileSubstrate/DynamicLibraries/Unlock7img.bundle"
</code></pre></p>
<p style="font-size: 20px;">关于ios - 架构 armv7 错误的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/23978423/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/23978423/
</a>
</p>
页:
[1]