Install app into jailbroken ios Root’s Applications folder

我是研究僧i 提交于 2019-12-07 14:20:04

问题


when i put myapp.app in ios5 root's Applications folder, but it can't work. why? but i find that cydia can work normally.


回答1:


  1. In the main.m add setuid(0); and setgid(0);
  2. Build the app normally.
  3. Then copy and paste the executable inside the .app and rename it to anything you want, don't rename the original file.
  4. Open the original executable file and delete its contents (the contents are now stored in the previously copied and renamed binary).
  5. Add this bash script to the empty binary file from 4. :

    #!/bin/bash
    dir=$(dirname "$0")
    exec "${dir}"/<COPIED FILE NAME> "$@"
    

    Springboard will run this file first because its the CFBundleExecutable, then this will launch the actual app's executable. This is done because SpringBoard would fail to directly launch the executable with root permissions

  6. Open terminal and change the directory to the .app (ex. cd /User/Me/Desktop/MyApp.app)
  7. chmod the original executable file to 0755 (ex. chmod 0755 MyCFBundleExecutable) and the copied file to 6755 (ex. chmod 6755 CFBundleExecutableRoot)
  8. SSH the .app into /Applications on your device, respring and launch it (if its not launching then repeat set 7. but by SSHing into your device via terminal)


来源:https://stackoverflow.com/questions/9749760/install-app-into-jailbroken-ios-root-s-applications-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!