what restricted API was the Flux app using?

Discussion in 'iOS Programming' started by patent10021, Jul 5, 2015.

  1. patent10021 macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #1
    The Flux app got pulled from the app store because it was using private APIs. What APIs and how do you access private APIs? IS there a list of private APIs somewhere? If converting Kelvin temperature is a normal function for weather and other apps why was it banned? I guess the API is directly related to the brightness settings? So the API is the API that controls display brightness? [[UIScreen mainScreen] setBrightness:0.1] ????

    How do you control Kelvin temperature settings in Swift/Obj-C?
     
  2. Dookieman macrumors 6502

    Joined:
    Oct 12, 2009
    #2
    A private API is one that isn't publicly defined and for Apple's use only. Depending on what they do, many of them will get a public release in the future. Apple will sometimes create private APIs to test them out first, then release them when they are ready for public use.

    Flux wasn't just changing the brightness, it was directly manipulating color schemes to allow/reduce the amount of certain colors of the iPhone screen. (Less blue at night)

    Private APIs are found by poking around official Apple Apps.

    In my experience, if you can achieve a desired effect that Apple created a Private API for (without actually using the Private API), then Apple will still allow the app to get published.
     
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    Private APIs include APIs in any private frameworks and any classes that aren't documented and methods in Public classes that aren't documented. It is possible to learn what some of these are by various means. Because these private APIs may change or may provide access to things Apple doesn't want developers to touch Apple has a strict policy against third party developers using private APIs. As part of that policy they have tools that inspect any app submitted to the app store and determine if these apps use any private APIs.

    You can inspect some private APIs here for instance:

    https://github.com/nst/iOS-Runtime-Headers
     
  4. patent10021 thread starter macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #4
    How do you look inside or find an API? Where would it usually give you a clue? plist?
     
  5. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #5
    Well, all the public APIs are in Apple's documentation including the header files. I provided a link that shows both public and private APIs.
     
  6. patent10021 thread starter macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #6
    ok yeah of course the public APIs are all over the place. I didn't catch your link for the private ones. Thanks man. Cheers.

    Apple doesn't list the private APIs though so is the GitHub link a collection of private APIs that just one person found or is it an ongoing collection amassed by everyone? What's the significance of the title "iOS Runtime Headers?" APIs are monitored and found in the runtime headers?
     
  7. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #7
    Because of the dynamic nature of Objective-C compiled programs have a lot of information about the classes present. Those headers at that link are generated by a tool called class-dump or a similar tool that allows one to process all the system libraries. The headers are emitted by the tool and resemble the actual layout of the classes in the libraries with all private methods and ivars revealed.

    Look closely at the header he shows for some class that you're familiar with. Apple uses _leading _underscores on private method names in an attempt to avoid method name conflicts.
     
  8. patent10021 thread starter macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #8
    Found the app and guides. Quite straight forward! Having access to these areas helps me with my programming too! Great stuff thanks!

    p.s. Are there similar tools for Android? Probably even more right?
     
  9. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #9
    Android itself is open source so you can read the source code if you want.

    You can look up jar tool and java decompiler to snoop into compiled jars.
     

Share This Page