草庐IT

ios - 架构 armv7 错误的 undefined symbol

coder 2024-01-19 原文

我在 github 上找到了 Unlock7 示例项目,现在我正尝试在显示音乐 Controller 时向背景添加模糊 (stackblur),但我在编译时遇到此错误:

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[2]: 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[2]: *** [obj/Unlock7.bundle/Unlock7.64873355.unsigned] Error 1
make[1]: *** [internal-bundle-all_] Error 2
make: *** [Unlock7.all.bundle.variables] Error 2

这是生成文件:

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"

代码如下:

#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 to use gesture

    [[self dateHeaderView] setPositon]; //reset the position of the date view to be below the larger clock

    UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(newUnlockStyleMover:)];
    [panRecognizer setMinimumNumberOfTouches:1];
    [panRecognizer setMaximumNumberOfTouches:1];
    //[_backgroundView addGestureRecognizer:panRecognizer] This can be used but is incompatible with LockHTML 
    [[self.subviews objectAtIndex:0] addGestureRecognizer:panRecognizer]; //Add gesture to the 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 and 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 back to default position after the 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 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");
    [_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 back to default position after cancel button is 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 is the MediaContols Thin Line
            [obj removeFromSuperview];
        }
    }
}
%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"));
    [_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

感谢任何帮助。 谢谢! (对不起英语不好)

最佳答案

这是因为 TWEAK_NAME 和 BUNDLE_NAME 具有相同的值。 Makefile 应该是这样的:

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 现在有一个不同于 TWEAK_NAME 的后缀。您可以为 bundle 使用任何其他名称。

根据新的包名称重新定义包在源中的路径:

#define kBundlePath @"/Library/MobileSubstrate/DynamicLibraries/Unlock7img.bundle"

关于ios - 架构 armv7 错误的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23978423/

有关ios - 架构 armv7 错误的 undefined symbol的更多相关文章

  1. ruby-on-rails - Rails 常用字符串(用于通知和错误信息等) - 2

    大约一年前,我决定确保每个包含非唯一文本的Flash通知都将从模块中的方法中获取文本。我这样做的最初原因是为了避免一遍又一遍地输入相同的字符串。如果我想更改措辞,我可以在一个地方轻松完成,而且一遍又一遍地重复同一件事而出现拼写错误的可能性也会降低。我最终得到的是这样的:moduleMessagesdefformat_error_messages(errors)errors.map{|attribute,message|"Error:#{attribute.to_s.titleize}#{message}."}enddeferror_message_could_not_find(obje

  2. ruby-on-rails - 迷你测试错误 : "NameError: uninitialized constant" - 2

    我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test

  3. ruby-on-rails - 如何在 Rails View 上显示错误消息? - 2

    我是rails的新手,想在form字段上应用验证。myviewsnew.html.erb.....模拟.rbclassSimulation{:in=>1..25,:message=>'Therowmustbebetween1and25'}end模拟Controller.rbclassSimulationsController我想检查模型类中row字段的整数范围,如果不在范围内则返回错误信息。我可以检查上面代码的范围,但无法返回错误消息提前致谢 最佳答案 关键是您使用的是模型表单,一种显示ActiveRecord模型实例属性的表单。c

  4. 使用 ACL 调用 upload_file 时出现 Ruby S3 "Access Denied"错误 - 2

    我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file

  5. ruby-on-rails - 错误 : Error installing pg: ERROR: Failed to build gem native extension - 2

    我克隆了一个rails仓库,我现在正尝试捆绑安装背景:OSXElCapitanruby2.2.3p173(2015-08-18修订版51636)[x86_64-darwin15]rails-v在您的Gemfile中列出的或native可用的任何gem源中找不到gem'pg(>=0)ruby​​'。运行bundleinstall以安装缺少的gem。bundleinstallFetchinggemmetadatafromhttps://rubygems.org/............Fetchingversionmetadatafromhttps://rubygems.org/...Fe

  6. ruby - #之间? Cooper 的 *Beginning Ruby* 中的错误或异常 - 2

    在Cooper的书BeginningRuby中,第166页有一个我无法重现的示例。classSongincludeComparableattr_accessor:lengthdef(other)@lengthother.lengthenddefinitialize(song_name,length)@song_name=song_name@length=lengthendenda=Song.new('Rockaroundtheclock',143)b=Song.new('BohemianRhapsody',544)c=Song.new('MinuteWaltz',60)a.betwee

  7. ruby - 如何验证 IO.copy_stream 是否成功 - 2

    这里有一个很好的答案解释了如何在Ruby中下载文件而不将其加载到内存中:https://stackoverflow.com/a/29743394/4852737require'open-uri'download=open('http://example.com/image.png')IO.copy_stream(download,'~/image.png')我如何验证下载文件的IO.copy_stream调用是否真的成功——这意味着下载的文件与我打算下载的文件完全相同,而不是下载一半的损坏文件?documentation说IO.copy_stream返回它复制的字节数,但是当我还没有下

  8. ruby-on-rails - 每次我尝试部署时,我都会得到 - (gcloud.preview.app.deploy) 错误响应 : [4] DEADLINE_EXCEEDED - 2

    我是Google云的新手,我正在尝试对其进行首次部署。我的第一个部署是RubyonRails项目。我基本上是在关注thisguideinthegoogleclouddocumentation.唯一的区别是我使用的是我自己的项目,而不是他们提供的“helloworld”项目。这是我的app.yaml文件runtime:customvm:trueentrypoint:bundleexecrackup-p8080-Eproductionconfig.ruresources:cpu:0.5memory_gb:1.3disk_size_gb:10当我转到我的项目目录并运行gcloudprevie

  9. ruby-on-rails - Rails 5 Active Record 记录无效错误 - 2

    我有两个Rails模型,即Invoice和Invoice_details。一个Invoice_details属于Invoice,一个Invoice有多个Invoice_details。我无法使用accepts_nested_attributes_forinInvoice通过Invoice模型保存Invoice_details。我收到以下错误:(0.2ms)BEGIN(0.2ms)ROLLBACKCompleted422UnprocessableEntityin25ms(ActiveRecord:4.0ms)ActiveRecord::RecordInvalid(Validationfa

  10. Ruby 文件 IO 定界符? - 2

    我正在尝试解析一个文本文件,该文件每行包含可变数量的单词和数字,如下所示:foo4.500bar3.001.33foobar如何读取由空格而不是换行符分隔的文件?有什么方法可以设置File("file.txt").foreach方法以使用空格而不是换行符作为分隔符? 最佳答案 接受的答案将slurp文件,这可能是大文本文件的问题。更好的解决方案是IO.foreach.它是惯用的,将按字符流式传输文件:File.foreach(filename,""){|string|putsstring}包含“thisisanexample”结果的

随机推荐