美文网首页iOS Developer
关于GZip包含dlopen、dlsym提交app store

关于GZip包含dlopen、dlsym提交app store

作者: zaijianbali | 来源:发表于2017-07-05 20:38 被阅读589次

    关于GZip包含dlopen、dlsym提交app store 被拒绝

    GZip 比较早的版本中包含了Gzip ,也就是2017年5月18日前更新的代码中,包含了dlopen和dlsym 的调用。

    具体如下:
    头文件如下:

    #import <dlfcn.h>
    

    调用的库如下,

    static void *libzOpen()     
    {       
       static void *libz;       
       static dispatch_once_t onceToken;        
       dispatch_once(&onceToken, ^{     
           libz = dlopen("/usr/lib/libz.dylib", RTLD_LAZY);     
              });       
        return libz;
    }
    
    
     void *libz = libzOpen();       
     int (*deflateInit2_)(z_streamp, int, int, int, int, int, const char *, int) = (int (*)(z_streamp, int, int, int, int, int, const char *, int))dlsym(libz, "deflateInit2_");    
        
    int (*deflate)(z_streamp, int) = (int (*)(z_streamp, int))dlsym(libz, "deflate");       
    
    int (*deflateEnd)(z_streamp) = (int (*)(z_streamp))dlsym(libz, "deflateEnd");       
    
    //gunzippedData
     void *libz = libzOpen();       
    int (*inflateInit2_)(z_streamp, int, const char *, int) =       (int (*)(z_streamp, int, const char *, int))dlsym(libz, "inflateInit2_");   
        
     int (*inflate)(z_streamp, int) = (int (*)(z_streamp, int))dlsym(libz, "inflate");      
     
      int (*inflateEnd)(z_streamp) = (int (*)(z_streamp))dlsym(libz, "inflateEnd"); 
    
    

    被拒绝理由是 dlopen 等函数与“App Store Review Guideline 2.5.2”冲突,导致审核被拒:

    Guideline 2.5.2 - Performance - Software Requirements
     
    Your app, extension, or linked framework appears to contain code designed explicitly with the capability to change your app’s behavior or functionality after App Review approval, which is not in compliance with App Store Review Guideline 2.5.2 and section 3.3.2 of the Apple Developer Program License Agreement.
     
    This code, combined with a remote resource, can facilitate significant changes to your app’s behavior compared to when it was initially reviewed for the App Store. While you may not be using this functionality currently, it has the potential to load private frameworks, private methods, and enable future feature changes. This includes any code which passes arbitrary parameters to dynamic methods such as dlopen(), dlsym(), respondsToSelector:, performSelector:, method_exchangeImplementations(), and running remote scripts in order to change app behavior and/or call SPI, based on the contents of the downloaded script. Even if the remote resource is not intentionally malicious, it could easily be hijacked via a Man In The Middle (MiTM) attack, which can pose a serious security vulnerability to users of your app.
    
    

    幸运的是,GZip库在github上有更新,删除了这部分代码,所以,遇到的小伙伴直接更新这个库就好了。

    我不理解的是当时为什么加上这段代码呢,是什么导致加入这段代码。难道是从C或者C++ 转过来的习惯于使用C或者C++ 函数,调用这些库可以装逼。

    相关文章

      网友评论

        本文标题:关于GZip包含dlopen、dlsym提交app store

        本文链接:https://www.haomeiwen.com/subject/nptchxtx.html