如下一切正常
bogon:notecount hp$ make package install
Making all for tweak NoteCount...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
Linking tweak NoteCount...
Stripping NoteCount...
Signing NoteCount...
Making stage for tweak NoteCount...
dpkg-deb: building package 'com.hp.notecount' in './com.hp.notecount_0.0.1-5_iphoneos-arm.deb'.
install.exec "cat > /tmp/_theos_install.deb; dpkg -i /tmp/_theos_install.deb && rm /tmp/_theos_install.deb" < "./com.hp.notecount_0.0.1-5_iphoneos-arm.deb"
root@192.168.168.109's password:
(Reading database ... 3037 files and directories currently installed.)
Preparing to replace com.hp.notecount 0.0.1-4 (using /tmp/_theos_install.deb) ...
Unpacking replacement com.hp.notecount ...
Setting up com.hp.notecount (0.0.1-5) ...
install.exec "killall -9 MobileNotes"
root@192.168.168.109's password:
并且也显示在Cydia的已安装中显示,但是启动软件的时候一点作用都没有,请问有哪位大神知道何解?
代码很简单,就是根据书上说的测试一下备忘录的字数统计,显示在导航栏上,代码不多就直接贴这里了吧,见谅
#import "CharacountForNotes8.h"
%hook NotesDisplayController
- (void)viewWillAppear:(BOOL)arg1
{
%orig;
NSString *content = self.note.contentAsPlainText;
NSString *contentLength = [NSString stringWithFormat:@"%lu", (unsigned long)[content length]];
self.title = contentLength;
}
- (void)viewDidDisappear:(BOOL)arg1
{
%orig;
self.title = nil;
}
- (void)noteContentLayerContentDidChange:(id)arg1 updatedTitle:(BOOL)arg2
{
%orig;
NSString *content = self.contentLayer.textView.text;
NSString *contentLength = [NSString stringWithFormat:@"%lu", (unsigned long)[content length]];
self.title = contentLength;
}
%end
行,我看下
这是我的文件:
Makefile如下
THEOS_DEVICE_IP = 192.168.108.114
export ARCHS = armv7 arm64
export TARGET = iPhone:latest:8.0
include theos/makefiles/common.mk
TWEAK_NAME = NoteCount
NoteCount_FILES = Tweak.xm
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec "killall -9 MobileNotes"
别的都没动
确认下方法名是不是变了。
方法名没有问题的话,在每个方法里面打些Log,看看hook是否成功。
如果都没有问题的话,在检查功能吧。
还有个问题,makefile里面的framework条目不加能正常工作吗?这个我不知道,但我每次都会加上。有知道的大神告知下。
Dylan
(Dylan)
14
用到什么Frameworks 就加什么,不用就不加
drjin
(dengrijin)
19
重启手机看看生效不? install.exec “killall -9 MobileNotes” ? 应该是“install.exec "killall -9 SpringBoard” 吧