适用于armv7和arm64的Theos

编程入门 行业动态 更新时间:2024-10-27 16:27:10
本文介绍了适用于armv7和arm64的Theos的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试让theos在OSX Mavericks上工作.我最近购买了iPhone 5s,从那以后越狱了.现在,我正在尝试使Theos工作,以便我可以再次进行一些调整.我已经在OSX Lion和IOS 5和6上运行了它.我有一个非常简单的程序,该程序应在应用程序启动时显示UIAlert.问题是,当我运行make命令以尝试编译我的代码时,出现此错误:

I'm trying to get theos working on OSX Mavericks. I recently purchased an iPhone 5s and have since then jailbroken it. Now I am trying to get Theos working so I can start working on some tweaks again. I had it working on OSX Lion and for IOS 5 and 6. I have a very simple program which should display a UIAlert when an application launches. The problem is, when i run the make command in an attempt to compile my code i get this error:

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代码:

Here is my code for 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:

And my 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"

谢谢!

推荐答案

这是一个老问题,但我仍然认为应该为有相同问题的人回答.您需要调用objc_getClass使其正常工作,如下所示:

It's an old question, but still I figured I should answer it for people who have the same question. You need to call objc_getClass for it to work, like this:

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

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

Note that this is not required on the left hand side of the assignment.

更多推荐

适用于armv7和arm64的Theos

本文发布于:2023-11-15 15:05:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1595515.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:适用于   Theos

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!