arm7和arm64的Theos

 lf8762 发布于 2023-02-06 13:03

我正在努力让这些人在OSX Mavericks上工作.我最近购买了iPhone 5s,从那时起就越狱了.现在我想让Theos工作,所以我可以再次开始进行一些调整.我有它在OSX Lion和IOS 5和6上工作.我有一个非常简单的程序,应该在应用程序启动时显示UIAlert.问题是,当我运行make命令试图编译我的代码时,我得到这个错误:

Making all for tweak test...
 Preprocessing Tweak.xm...
 Compiling Tweak.xm...
 Linking tweak test...
Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_UIAlertView", referenced from:
      objc-class-ref in Tweak.xm.b0410391.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/test.dylib.1cc22e7c.unsigned] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [test.all.tweak.variables] Error 2
Williams-MacBook-Pro-2:test williamfsmillie$ 

这是我的Tweak.xm代码:

%hook SBApplicationIcon

-(void)launch{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"TEST" message:@"message...." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    [alert release];
    %orig;
}

%end

我的makefile:

export SDKVERSION=7.0

include theos/makefiles/common.mk

TWEAK_NAME = test
test_FILES = Tweak.xm
ARCHS = armv7 arm64
test_FRAMEWORKS = UIKit

include $(THEOS_MAKE_PATH)/tweak.mk

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

谢谢!

2 个回答
  • 这是一个老问题,但我仍然认为我应该回答那些有同样问题的人.您需要调用objc_getClass它才能工作,如下所示:

    UIAlertView *alert = [[objc_getClass("UIAlertView") alloc] initWithTitle:@"TEST" message:@"message...." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    

    请注意,在作业的左侧不需要这样做.

    2023-02-06 13:04 回答
  • 编辑您的makefile并在顶部插入以下内容:

    export ARCHS = armv7 armv7s arm64
    export TARGET = iphone:clang:7.0:7.0
    

    另外,将Foundation框架与您的调整相关联.

    2023-02-06 13:05 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有