ios - 配置脚本和ldid

标签 ios gcc scripting jailbreak

由于 Killed: 9 错误,配置脚本的摘录失败,这是 iOS 5 只能运行签名 应用程序。所以我需要找到一种方法将 ldid -s 放在这些测试的某个位置,唯一的问题是在哪里。

有人吗???

失败了

checking build system compiler gcc... no
checking build system compiler gcc -g -O2 ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler

和配置日志

onfigure:15586: gcc -c -g -O2  conftest.c >&5
configure:15586: $? = 0
configure:15586: result: yes
configure:15586: checking sys/time.h presence
configure:15586: gcc -E  conftest.c
configure:15586: $? = 0
configure:15586: result: yes
configure:15586: checking for sys/time.h
configure:15586: result: yes
configure:15677: checking build system compiler gcc
configure:15690: gcc conftest.c
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
configure:15693: $? = 0
./configure: line 15675: 27218 Killed: 9               ./a.out
./configure: line 15695: ./b.out: No such file or directory
./configure: line 15695: ./a.exe: No such file or directory
./configure: line 15695: ./a_out.exe: No such file or directory
./configure: line 15695: ./conftest: No such file or directory
configure:15700: result: no
configure:15677: checking build system compiler gcc -g -O2
configure:15690: gcc -g -O2  conftest.c
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
configure:15693: $? = 0
./configure: line 15675: 27234 Killed: 9               ./a.out
./configure: line 15695: ./b.out: No such file or directory
./configure: line 15695: ./a.exe: No such file or directory
./configure: line 15695: ./a_out.exe: No such file or directory
./configure: line 15695: ./conftest: No such file or directory
configure:15700: result: no

最后是 ./configure 脚本..

if test -n "$CC_FOR_BUILD"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $CC_FOR_BUILD" >&5
    $as_echo_n "checking build system compiler $CC_FOR_BUILD... " >&6; }
    # remove anything that might look like compiler output to our "||" expression
    rm -f conftest* a.out b.out a.exe a_out.exe
    cat >conftest.c <<EOF
    int
    main ()
    {
      exit(0);
    }
    EOF
    gmp_compile="$CC_FOR_BUILD conftest.c"
    cc_for_build_works=no
    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
      (eval $gmp_compile) 2>&5
      ac_status=$?
      $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
      test $ac_status = 0; }; then
      if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
        cc_for_build_works=yes
      fi
    fi
    rm -f conftest* a.out b.out a.exe a_out.exe
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_for_build_works" >&5
    $as_echo "$cc_for_build_works" >&6; }
    if test "$cc_for_build_works" = yes; then
      :
    else
      as_fn_error $? "Specified CC_FOR_BUILD doesn't seem to work" "$LINENO" 5
    fi

    elif test -n "$HOST_CC"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $HOST_CC" >&5
    $as_echo_n "checking build system compiler $HOST_CC... " >&6; }
    # remove anything that might look like compiler output to our "||" expression
    rm -f conftest* a.out b.out a.exe a_out.exe
    cat >conftest.c <<EOF
    int
    main ()
    {
      exit(0);
    }

最佳答案

我不得不承认,除了最简单的 shell 脚本之外,我的阅读能力很差,但基本上,您需要在运行可执行文件之前对其进行伪代码签名。看起来您要运行的可执行文件名为 conftest,对吧?所以,尝试在这个 block 中签名:

if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
  (eval $gmp_compile) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then

  #begin added code
  ldid -S ./conftest
  #end added code

  if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
    cc_for_build_works=yes
  fi
fi

显然,如果在现有的 PATH< 中找不到,您可能需要提供 ldid 的完整路径(例如 /usr/bin/ldid)/.

更新:根据下面发帖人的评论,a.out 实际上是需要签名的可执行文件,而不是conftest

关于ios - 配置脚本和ldid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12449585/

相关文章:

ios - JSON iOS isEqualToString

windows - Cygwin 64 位 C 编译器缓存有趣(并且提前结束)

c - gcc 编译器用 puts 切换 printf 调用

php - 如何从 PHP 使用 SMPP 连接 SMSC 服务器

python - 在 Windows Batch 脚本中执行多行 python 代码

c++ - 在 C++ 和 Lua 之间来回发送变量指针?

ios - 是否可以导出 Xamarin 应用程序并在实际的 iPhone 设备上进行测试

ios - 除了 Twilio 提供的教程之外,还有什么好的 Twilio iOS VOIP Client 教程吗?

ios - 将循环的 mp4 背景添加到 iOS 应用程序注册

gcc - ld : file not found: elf_i386 error on Mac Terminal