jbunicom  
                (jbunicom)
               
                 
              
                  
                    2014 年10 月 14 日 01:57
                   
                   
              1 
               
             
            
              %hook SBScreenshotter
- (void)saveScreenshot:(BOOL)screenshot
{
      %orig;
      NSLog(@"mytest is called!");
}
%end
 
makefile:
THEOS_DEVICE_IP = 192.168.1.101
include theos/makefiles/common.mk
TWEAK_NAME = MyTest
MyTest_FILES = Tweak.xm
MyTest_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
	install.exec "killall -9 SpringBoard"
 
运行make package install出错: 
/Users/lvdong1/code/mytest/theos/makefiles/targets/Darwin/iphone.mk:41: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries. 
Making all for tweak MyTest… 
make[2]: *** No rule to make target obj/Tweak.xm.39e80057.o', needed by obj/MyTest.dylib.ba964c90.unsigned’.  Stop. 
make[1]: *** [internal-library-all_] Error 2 
make: *** [MyTest.all.tweak.variables] Error 2。
------q请大神指教
             
            
               
               
               
            
           
          
            
            
              你的makefile漏东西了,再看看书上的makefile是怎么写的
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 14 日 06:36
                   
                   
              3 
               
             
            
              你是说加: 
ARCHS = armv7 
TARGET = iphone:6.1:4.3
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 14 日 09:06
                   
                   
              6 
               
             
            
              sh-3.2# make package install 
Your current SYSROOT, “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk”, appears to be missing. 
make: *** [before-all] Error 1
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 14 日 09:10
                   
                   
              7 
               
             
            
              这个应该是缺少SDK6我觉得。 
汗那,我在家里的电脑和单位的电脑都试了,家里都不会报错,单位这个问题不断。(PS:家里和单位同时装的系统) 
另外,家里的虽然没报错,iphone也重启了,可是syslog里就是看不到结果。应该是没HOOK成功。请教大神,咋办。
             
            
               
               
               
            
           
          
            
            
              这个意思就是缺少SDK,你Xcode的SDK实际是什么版本,makefile里改成对应的版本就好了
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 15 日 02:23
                   
                   
              10 
               
             
            
              THEOS_DEVICE_IP = 192.168.1.101
ARCHS = armv7
TARGET = iphone:7.1:4.3
include theos/makefiles/common.mk
TWEAK_NAME = MyTest
MyTest_FILES = Tweak.xm
MyTest_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
        install.exec "killall -9 SpringBoard"
 
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 15 日 02:23
                   
                   
              11 
               
             
            
              sh-3.2# make package install 
Making all for tweak MyTest… 
make[2]: *** No rule to make target obj/Tweak.xm.37d20960.o', needed by obj/MyTest.dylib.ba964c90.unsigned’.  Stop. 
make[1]: *** [internal-library-all_] Error 2 
make: *** [MyTest.all.tweak.variables] Error 2
             
            
               
               
              1 个赞 
            
           
          
            
            
              先
make clean
 
一下,再
make package install messages=yes
 
看看输出什么
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 15 日 08:44
                   
                   
              13 
               
             
            
              sh-3.2# make package install messages=yes 
Making all for tweak MyTest… 
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f makefile --no-print-directory --no-keep-going  
internal-library-compile  
_THEOS_CURRENT_TYPE=tweak THEOS_CURRENT_INSTANCE=MyTest _THEOS_CURRENT_OPERATION=compile  
THEOS_BUILD_DIR="." THEOS_MAKE_PARALLEL=yes 
make[2]: *** No rule to make target obj/Tweak.xm.cb15499c.o', needed by obj/MyTest.dylib.ba964c90.unsigned’.  Stop. 
make[1]: *** [internal-library-all ] Error 2 
make: *** [MyTest.all.tweak.variables] Error 2
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 16 日 00:38
                   
                   
              15 
               
             
            
              sh-3.2# $THEOS/bin/ldid 
usage: /opt/theos/bin/ldid -S[entitlements.xml]  
/opt/theos/bin/ldid -e MobileSafari 
/opt/theos/bin/ldid -S cat 
/opt/theos/bin/ldid -Stfp.xml gdb 
sh-3.2#
ldid需要怎么更换,请大神明示。
             
            
               
               
               
            
           
          
            
            
              发现一个问题:你的所有操作都是以root权限完成的? 
不要用root权限,再试一次看看
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 16 日 01:53
                   
                   
              17 
               
             
            
              bogon:mytest lvdong1$ make package install messages=yes 
Making all for tweak MyTest… 
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f makefile --no-print-directory --no-keep-going  
internal-library-compile  
_THEOS_CURRENT_TYPE=tweak THEOS_CURRENT_INSTANCE=MyTest _THEOS_CURRENT_OPERATION=compile  
THEOS_BUILD_DIR="." THEOS_MAKE_PARALLEL=yes 
make[2]: *** No rule to make target obj/Tweak.xm.cb15499c.o', needed by obj/MyTest.dylib.ba964c90.unsigned’.  Stop. 
make[1]: *** [internal-library-all ] Error 2 
make: *** [MyTest.all.tweak.variables] Error 2
             
            
               
               
               
            
           
          
            
            
              我的意思是从新建工程开始,全用普通用户权限重来一遍试试看
             
            
               
               
               
            
           
          
            
              
                jbunicom  
                (jbunicom)
               
              
                  
                    2014 年10 月 16 日 03:55
                   
                   
              19 
               
             
            
              是的,这两天我把能尝试的都试了,还是上面的提示错误
             
            
               
               
               
            
           
          
            
            
              我不确定是不是因为你全都是sudo的,导致有些文件没有写权限导致的,你先拿用户权限重新试试