theos

How to know about app launched and details jailbreak iOS 7

孤者浪人 提交于 2019-12-11 08:29:37
问题 I am making a tweak for iOS 7 , in which I want to know about app launch event, and the details of app being launched (name and identifier). So far the only useful framework I have found is SpringBoardServices.framework . The header files which may be/are useful to track app launch event include: SBAppLaunchUtilities.h SBLaunchAppListener.h If I am on right track, can anyone provide me information about their methods usage? There is no relevant information or guide present on iphonedevwiki .

How to hook NSURLSession methods with theos?

左心房为你撑大大i 提交于 2019-12-09 23:49:42
问题 I created a tweak project using rpetrich's theos and wanted to hook NSURLSession methods but the hooks don't seem to get invoked? Why? This is my Tweak.xm code: %hook NSURLSession - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler { NSLog(@"testhook dataTaskWithRequest:completionHandler:"); return %orig(request, completionHandler); } - (NSURLSessionDataTask *

Theos iOS 11 system() function

亡梦爱人 提交于 2019-12-08 07:52:34
问题 I updated my Phone to IOS 11 and the system() function is not supported anymore. I want to shutdown after pressing a button, how can I do that? Respring works fine with posix_spawn. My old code is: (void)shutdownButtonPressed{ system("shutdown"); } 回答1: From the shutdown source, it would seem the proper way of doing this is: #define RB_HALT 0x08 extern void* reboot3(int how); (void)shutdownButtonPressed { // for a real reboot, just pass 0 instead of RB_HALT reboot3(RB_HALT); } 来源: https:/

Find out active application or if on Springboard

痴心易碎 提交于 2019-12-08 06:45:21
问题 How do you find out what current active application you are in or if you are in the springboard's homepages? 回答1: You can't do that. There is no Public API is provided by Apple to do so. If you are looking for Private API, please check this post 来源: https://stackoverflow.com/questions/21373606/find-out-active-application-or-if-on-springboard

Importing <AppKit/AppKit.h> does not work

丶灬走出姿态 提交于 2019-12-08 02:45:00
问题 I am making a cydia tweak on Xcode using IOSOpenDev and i tried to import <AppKit/AppKit.h> but i'm getting this error! 'AppKit/AppKit.h' file not found' This is my code which changes the flash color when someone tries to take a screenshot #include <AppKit/AppKit.h> %hook SBScreenFlash -(void)flashColor:(id)color { NSDictionary *prefs=[[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.junyi00.screenshotcolor.plist"]; if ([[prefs objectForKey:@"enable"]

finding IOSurface headers

旧巷老猫 提交于 2019-12-08 02:26:46
问题 I'm getting this error when I try to compile my tweak. 'IOSurface/IOSurfaceAPI.h' file not found #include <IOSurface/IOSurfaceAPI.h> I've tried this answer, but I can't find /System/Library/Frameworks/IOSurface.framework/Headers on my computer. I'm running osx 10.9.1. Thanks for the help. 回答1: Try this, not sure about the version it comes from: http://ios-toolchain-based-on-clang-for-linux.googlecode.com/files/IOSurfaceAPI.h 来源: https://stackoverflow.com/questions/21009761/finding-iosurface

Which method is called when device is about to be unlocked?

℡╲_俬逩灬. 提交于 2019-12-06 09:15:32
I would like to know where the -(void)unlock (or whatever is called) used when we "slide to unlock" on the LockScreen is. Has anyone an idea ? Try these iOS 4 - 5 SBAwayController -(void)_finishedUnlockAttemptWithStatus:(char) Argument will be non zero (I don't quite sure it will always be 1 when device is unlocked) when device is about to be unlocked. iOS 6 SBAwayController -(void)_finishUnlockWithSound:(char) unlockSource:(int) isAutoUnlock:(char) iOS 7 SBLockScreenViewController -(void)finishUIUnlockFromSource:(int) Divya Bhalodiya You can use by calling the method GSEventLockDevice ();

How to hook NSURLSession methods with theos?

半腔热情 提交于 2019-12-04 20:13:19
I created a tweak project using rpetrich's theos and wanted to hook NSURLSession methods but the hooks don't seem to get invoked? Why? This is my Tweak.xm code: %hook NSURLSession - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler { NSLog(@"testhook dataTaskWithRequest:completionHandler:"); return %orig(request, completionHandler); } - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request { NSLog(@"testhook dataTaskWithRequest"); return %orig(request); } %end

Theos 常见指令

回眸只為那壹抹淺笑 提交于 2019-12-03 14:15:38
在利用 theos 开发一些插件时,我们经常会用到以下几个指令: %hook 指定需要hook的类名,以%end结尾 //hook的是SpringBoard这个类里面的方法 %hook SpringBoard -(void)_menuButtonDown:(id)down { NSLog(@"You've pressed home button"); %orig; //call the original _menuButtonDown } %end %orig 执行被hook函数的原始代码,类似于super.method功能 %hook ClassName - (void) _menuButtonDown: (id)down { NSlog(@"ss"); //如果去掉%orig,那么原始函数不会得到执行。 %orig; } @end %new 该指令用来给现有的class添加一个新的函数。与Runtime中的class_addMethod相同。 %hook SpringBoard //hook内部的代码 默认都是替换被hook类中函数的实现,所以如果不加%new,theos默认是去类中找namespaceNewMethod这个方法,替换它的方法实现。所以如果我们是新增的函数而不是更改原函数的内部实现则需要加%new这个指令 %new -(void)

Theos for armv7 and arm64

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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