Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23929] Rename contextId to stop confusing Apple's private API scan

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-09-27T12:25:53.000+0000
Affected Version/sRelease 5.5.0
Fix Version/sRelease 6.0.0, Release 6.1.0, Release 5.5.1
ComponentsiOS
Labelsn/a
ReporterIngo Muschenetz
AssigneeChristopher Williams
Created2016-09-19T20:10:00.000+0000
Updated2016-11-17T18:52:44.000+0000

Description

Evidently, several people have received the following rejection letter from Apple: The message from Apple was as follows: _Performance - 2.5.1_ _Your app uses or references the following non-public APIs:_ _contextId_ _The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change._ _Next Steps_ _Please revise your app to remove any non-public APIs. If you have defined methods in your source code with the same names as the above-mentioned APIs, we suggest altering your method names so that they no longer collide with Apple's private APIs to avoid your application being flagged in future submissions._ _Additionally, if you are using third party libraries, please update to the most recent version of those libraries. If you do not have access to the libraries' source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool can output a list of the methods that the library calls and "otool -ov" will output the Objective-C class structures and their defined methods. These tools can help you narrow down where the problematic code resides. You could also use the "nm" tool to verify if any third-party libraries are calling these APIs._ http://stackoverflow.com/questions/39573151/app-rejection-issue-2-5-1-apps-that-use-non-public-apis-will-be-rejected-since/39576096#39576096 I believe the required changes are minimal: https://github.com/search?utf8=%E2%9C%93&q=ContextId+repo%3Aappcelerator%2Ftitanium_mobile&type=Code&ref=searchresults

Comments

  1. Ingo Muschenetz 2016-09-19

    It is not clear why run-on-main-thread would matter. Perhaps a different branch of code is executing?
  2. Christopher Williams 2016-09-19

    5_5_X: https://github.com/appcelerator/titanium_mobile/pull/8402 6_0_X: https://github.com/appcelerator/titanium_mobile/pull/8400 master: https://github.com/appcelerator/titanium_mobile/pull/8401
  3. Christopher Williams 2016-09-19

    The code that referenced the contextId field was all guarded by #ifdef's that would only be true if run-on-main-thread was false. So that flag would directly impact this bug if the field's name is indeed the source of the issue.
  4. Hans Knöchel 2016-09-19

    The PR is correct. Although I feel that TIMOB-23924 might not be the only other API that causes problems - referring to the Flowdock discussion.
  5. Ingo Muschenetz 2016-09-19

    We should/could merge it, have an affected person resubmit, and see if it goes away.
  6. Chris Rose 2016-09-26

    My app was rejected because of this. I rebuilt it with the nightly 5.5.1.v20160923122321 and resubmitted. It was rejected again, for the same use (contextId), so I don't think this is fixed.
  7. Ingo Muschenetz 2016-09-26

    [~cdr] Two notes:

    We had an affected person complain to Apple and they reversed their rejection based on the faulty scan. You might try that.

    What is the text of the rejection letter you got?

  8. Hans Knöchel 2016-09-26

    It looks like the build you submitted has not been built with the mentioned 5.5.1 build (verify with your tiapp.xml), because the property is called krollContextId now, not contextId any more.
  9. Chris Rose 2016-09-26

    The rejection text is: bq. Performance - 2.5.1 bq. Your app uses or references the following non-public APIs: bq. contextId bq. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change. I complained to Apple initially, but they said that I would need to rebuild the app without this variable in it. Hans, is it possible to get the SDK version used to build an app from the ipa or xcarchive? Im 95% certain it was built with v20160923122321 as that is what I had in the tiapp.xml at the time I've resubmitted the app with run-on-main-thread set to false, waiting to see if that is accepted.
  10. Chris Rose 2016-09-26

    To be sure, I've just rebuilt the app again with the SDK nightly, but the string persists:
        $ cat tiapp.xml | grep sdk-version
            <sdk-version>5.5.1.v20160923122321</sdk-version>
        
        $ appc ti build -p ios -T dist-appstore
        Appcelerator Command-Line Interface, version 5.5.0
        Copyright (c) 2014-2016, Appcelerator, Inc.  All Rights Reserved.
        
        [INFO]  tiapp.xml <sdk-version> set to 5.5.1.v20160923122321, but current Titanium SDK set to 5.5.0.GA
        [INFO]  Forking correct SDK command: "/usr/local/bin/node" "/Users/cdr/cdr/.appcelerator/install/5.5.0/package/node_modules/titanium/lib/titanium.js" "build" "--sdk" "5.5.1.v20160923122321" "--no-banner" "--config-file" "/var/folders/6k/l6tk275j1dq_hbc26d_8n6440000gn/T/build-1474904184693.json" "--platform" "iphone" "--project-dir" "/Users/cdr/cdr/Projects/app" "--log-level" "info" "--ft-port" "4157" "--developer-name" "xxx" "--distribution-name" "xxx" "--target" "dist-appstore"
        
        9/26/2016, 4:37:07 PM
        
        Operating System
          Name                        = Mac OS X
          Version                     = 10.12
          Architecture                = 64bit
          # CPUs                      = 16
          Memory                      = 34359738368
        
        Node.js
          Node.js Version             = 4.2.3
          npm Version                 = 3.5.2
        
        Titanium CLI
          CLI Version                 = 5.0.9
        
        Titanium SDK
          SDK Version                 = 5.5.1.v20160923122321
          SDK Path                    = /Users/cdr/cdr/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.v20160923122321
          Target Platform             = iphone
        
        
        * snip *
        
        [INFO]  Archiving debug symbols: /Users/cdr/cdr/Library/Developer/Xcode/Archives/2016-09-26/Device Verification_16-39-07.xcarchive/dSYMs/Device Verification.app.dSYM
        [INFO]  Launching Xcode: /Applications/Xcode.app
        [INFO]  Packaging complete
        
        $ strings ~/Library/Developer/Xcode/Archives/2016-09-26/Device Verification_16-39-07.xcarchive/Products/Applications/Device\ Verification.app/Device\ Verification | grep contextId
        contextId
        contextId
        
  11. Hans Knöchel 2016-09-27

    PR (titanium_debugger/master): https://github.com/appcelerator/titanium_debugger/pull/51
  12. Chris Rose 2016-09-27

    Can I access that fix somehow?
  13. Chee Kiat Ng 2016-09-27

    timob PRs: 5_5_X:https://github.com/appcelerator/titanium_mobile/pull/8434 6_0_X:https://github.com/appcelerator/titanium_mobile/pull/8435 master:https://github.com/appcelerator/titanium_mobile/pull/8436
  14. Hans Knöchel 2016-09-27

    [~emerriman] All PR's merged. The functional test includes testing the kroll-based debugger (run-on-main-thread disabled) by any debugging-operation, e.g. simple app-breakpoint. [~cdr] Grab the newest 5.5.1 build (which will possible be the GA-build) and submit with that one. The build should be there in ~ 25m from this comment.
  15. Chris Rose 2016-09-29

    Thanks. I've rebuilt with 5.5.1.GA and can't find contextId in the binary anymore. I've submitted the app to Apple.
  16. Eric Wieber 2016-11-17

    Verified fixed, using: MacOS 10.12 (16A323) Studio 4.8.0.201611121409 Ti SDK 5.5.1.GA, 6.0.0.GA Appc NPM 4.2.9-1 Appc CLI 6.1.0-13 Alloy 1.9.4 Xcode 8.1 (8B62) contextId no longer appears in the binary or packaged apps. Tested by creating multiple apps with run-on-main-thread off and on, then submitting them to the store. All submissions passed.

JSON Source