代码之家  ›  专栏  ›  技术社区  ›  fbrereto

未记录的iPhone API-发现和使用

  •  4
  • fbrereto  · 技术社区  · 16 年前

    有少数的iPhone应用程序在幕后使用未注册的API进行了一些欺骗,并取得了有效的效果。

    1. 我该如何获得未记录的iPhone API列表?

    2. 这些API中是否有第三方现成文档?

    3 回复  |  直到 13 年前
        1
  •  2
  •   slf    16 年前

    Erica Sadun 最受尊敬的iPhone黑客之一正是在这方面出书的。大多数未记录的头文件也可以从她的网站上提取。

        2
  •  4
  •   nonpolynomial237    16 年前

    你可以使用 classdump 获取iPhone SDK的列表,但我不知道第三方文档是否存在。不过,通过读取这些方法的名称,您可能会了解它们的作用。

        3
  •  0
  •   masche    16 年前

    我发现了一个Perl脚本(源代码= arstechnika ,wich从iphone sdk的公共和私有框架构建一个头文件文件夹。但是我得到一个错误(类转储失败,返回16777215 如果我运行它。

        #!/usr/bin/perl
    #
    # 24 November 2008
    # Framework Dumping utility; requires class-dump
    #
    
    use strict;
    
    use Cwd;
    use File::Path;
    
    my $HOME = (getpwuid($<))[7] || $ENV{'HOME'} 
      or die "Could not find your home directory!";
    
    # This command must be in your path.
    # http://www.codethecode.com/projects/class-dump/
    my $CLASS_DUMP = 'class-dump'; 
    
    # Public Frameworks
    dump_frameworks('/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks',
                    'Frameworks');
    
    # Private Frameworks
    dump_frameworks('/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/PrivateFrameworks',
                    'PrivateFrameworks');
    
    sub dump_frameworks
    {
      my($dir, $subdir) = @_;
    
      opendir(my $dirh, $dir) or die "Could not opendir($dir) - $!";
    
      # Iterate through each framework found in the directory
      foreach my $file (grep { /\.framework$/ } readdir($dirh))
      {
        # Extract the framework name
        (my $fname = $file) =~ s/\.framework$//;
        print "Framework: $fname\n";
    
        my $headers_dir = "$HOME/Headers/$subdir/$fname";
    
        # Create the folder to store the headers
        mkpath($headers_dir);
    
        # Perform the class-dump
        my $cwd = cwd();
        chdir($headers_dir) or die "Could not chdir($headers_dir) - $!";
    
        system($CLASS_DUMP, '-H', "$dir/$file");
    
        if(my $ret = $? >> 8)
        {
          die "$CLASS_DUMP failed, returning $ret\n";
        }
    
        chdir($cwd) or die "Could not chdir($cwd) - $!";
      }
    }