pid iOS gui

时间:2017-03-18 16:21:09

标签: objective-c iphone cydia tweak

我正在编写带有图形用户界面的iosopendev调整来为pid代码执行一些任务。

应用程序本身有一个control,postint,prerm文件来获取root访问权限/权限。

Postint:

#!/bin/bash

cd "/Applications/test.app/"

# process origin binary
mv test test_
chown root.wheel test_
chmod +s        test_

cont=`cat <<"EOF"
#!/bin/bash
dir=$(dirname "$0")
exec "${dir}"/test_ "$@"
EOF
`
# create new fake binary
echo -e "$cont" > test
chown root.wheel  test
chmod +x          test

#The RESPRING script after Install
declare -a cydia
cydia=($CYDIA)

if [[ $1 == install || $1 == upgrade ]]; then
if [[ ${CYDIA+@} ]]; then
eval "echo 'finish:restart' >&${cydia[0]}"
fi
fi

出口

Prerm:

#!/bin/bash

rm -f "/Applications/test.app/test_"

有没有办法签署应用程序并获取task_for_pid访问权限?

由于

1 个答案:

答案 0 :(得分:0)

您在制作应用时签名,而不是在安装时。

  1. 安装ldid以签署您的二进制文件。如果您使用带有自制软件的macOS,请使用以下命令安装:

    brew install ldid
    

    检查http://iphonedevwiki.net/index.php/Theos/Setup#Setting_Up_Dependencies是否有其他平台。

  2. 创建权利文件(ent.plist):

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>get-task-allow</key>
        <true/>
        <key>task_for_pid-allow</key>
        <true/>
    </dict>
    </plist>
    
  3. 如果使用theos,请将ent.plist放在Makefile旁边,然后将此行添加到Makefile中(将test更改为目标名称):

    test_CODESIGN_FLAGS = -Sent.plist
    

    如果使用Xcode,请将ent.plist放在$ {PROJECT_DIR}中,然后将目标的CODE_SIGN_ENTITLEMENTS构建设置设置为ent.plist

      

    enter image description here