编写了Tweak,并且也在手机中安装成功,但是不起作用

如下一切正常

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的已安装中显示,但是启动软件的时候一点作用都没有,请问有哪位大神知道何解?

filter正确吗?

对。
看起来没问题。

系统是?

4s 8.4的

把代码传github看看吧

代码很简单,就是根据书上说的测试一下备忘录的字数统计,显示在导航栏上,代码不多就直接贴这里了吧,见谅

#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

我也遇到了这个问题,hook测试例子是可以。

共同研究研究吧,如果解决了,可以贴出来给大家看看

这个代码看不出问题,其他相关文件呢?

我这有个以前练习的iOS9的代码,你参考下 https://github.com/everettjf/iOSREPractise/tree/master/CharacountForNotes9/characountfornotes9

行,我看下
这是我的文件:
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条目不加能正常工作吗?这个我不知道,但我每次都会加上。有知道的大神告知下。

用到什么Frameworks 就加什么,不用就不加

没有写 %ctor { } 么?

我的安装成功了

打不开。。。。404

https://github.com/everettjf/Yolo/tree/master/iOSREPractise

重启手机看看生效不? install.exec “killall -9 MobileNotes” ? 应该是“install.exec "killall -9 SpringBoard” 吧

一个是关闭Notes,一个是重启手机,没关系吧

问题解决了吗?我也遇到同样的问题