首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

IOS越狱开发(2)———APP开机自动启动并隐藏图标

2013-10-22 
IOS越狱开发(二)———APP开机自动启动并隐藏图标上一章已经提到了通过越狱开发可以获取Root权限制作系统级应

IOS越狱开发(二)———APP开机自动启动并隐藏图标

上一章已经提到了通过越狱开发可以获取Root权限制作系统级应用程序,当然也可以设置开机启动项,如果想更高级点还可以app自动启动后,在桌面隐藏APP图标,让用户无法关闭app(非常强盗啊!)

第一步:实现APP自动启动。

参看帖子:http://blog.csdn.net/lynjay/article/details/7936488完成环境搭建。

1、新建工程:xcode-》file-》new-》project-》iOSOpenDev-》logos tweak, 取名叫AutoRun,这个工程里面有两个文件很重要就是AutoRun.xm和AutoRun.mm文件,其中AutoRun.mm文件的内容是编译器根据AutoRun.xm自动填充的,暂时不管AutoRun.mm文件,现在我们主要是对于AutoRun.xm文件的编辑

2、按照错误提示,添加libsubstrate.dylib库到工程中,然后删除错误提示代码

3、在添加UIKit.framework

4、在AutoRun.xm文件里面添加以下代码


这个就是可以开机启动的应用文件。这个程序启动后会通过scheme打开我们想要的app



第二步:实现APP的图标隐藏

实现app的隐藏可以在plist文件里面设置,当然也可以通过代码

//隐藏APP- (IBAction)TouchHiddenApp:(id)sender {    NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];    NSFileManager* manager = [NSFileManager defaultManager];    if (plistPath)    {        NSLog(@"%@", plistPath);                NSMutableDictionary* infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];                NSArray *array = [NSArray arrayWithObject:@"hidden"];        //This is the code used to hide the app from the homepage        [infoDict setObject:array forKey:@"SBAppTags"];        [infoDict writeToFile:plistPath atomically:YES];        [manager changeFileAttributes:[NSDictionary dictionaryWithObject:[NSDate date] forKey:NSFileModificationDate] atPath: [[NSBundle mainBundle] bundlePath]];                NSMutableDictionary* infoDictModified = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];                NSLog(@"%@", infoDictModified);                if ([manager isWritableFileAtPath:plistPath])        {            NSLog(@"written");        } else {            NSLog(@"Something went wrong");        }    }}


热点排行