iOS Architecture

Redfox Security
7 min readJul 26, 2022

--

iOS Architecture

All Apple mobile devices, including the iPhone, iPad, and iPod, run on iOS, a platform jointly developed with the Darwin foundation.

With iOS, the hardware device is managed and the technology needed to create applications for the platform is provided, unlike other significant operating systems.

A few commonly used system apps are included as part of the device’s basic software package. These include Mail, Calendar, Calculator, Phone, Safari, and others.

For security and commercial reasons, it is not possible to run iOS and Mac OS X on any hardware other than Apple’s, and it is prohibited to use iOS on any other mobile device other than Apple’s. As we will discuss in the iOS Jailbreaking blog, this has made it easier for jailbreakers to discover iOS jailbreak attacks. With over 1 million apps available on the App Store, the attack surface for applications has greatly increased.

iOS Architecture

The layering of the iOS architecture involves packaging of technology into frameworks. A framework normally includes header files, pictures, and all the dynamically shared libraries that are required. The layers of the iOS software stack are shown in the following image:

iOS Architecture

There are four abstraction levels in it.

  • Core OS
  • Core Services
  • Media
  • Coca Touch

Because of several reasons, including object-oriented abstractions, the ease of writing code with fewer lines, and the ability to encapsulate other features, majority of developers choose higher-level frameworks as development gets started. One must, however, take care to prevent their higher-level frameworks from exposing them if they use lower-level frameworks. Because those frameworks are used in the majority of development operations, they have a larger attack surface than lower-level frameworks. Let’s now investigate the various abstract layers.

Core OS

The final layer in the iOS stack, it resides immediately atop the hardware of the device. Low-level features that form the basis of all iOS features are provided by the Core OS layer. In addition to the standard functions of a fundamental operating system, such as memory management, file system handling, and threads, it also offers a number of services, including low-level networking and access to external accessories.

The bottom level features that most other technologies are based upon are stored in the Core OS layer.

  • Core Bluetooth Framework: This Framework interacts with BR/EDR (“Classic”) and low energy Bluetooth devices.
  • External Accessories Framework: This Framework communicates with devices’ accessories that are connected via Bluetooth or the Apple Lightning connector.
  • Accelerate Framework: This Framework makes large-scale mathematical computations and image calculations, optimized for high performance and low energy consumption.
  • Security Services Framework: This Framework controls access to your app and the data it maintains.
  • Local Authorization Framework: This Framework authenticates users using their bio-metrics or a passphrase they are already familiar with.

iOS 7’s 64-Bit support facilitates the creation of 64-bit applications and speeds up their performance.

Core Services

The services offered by the Core OS layer are abstracted by the Core Services layer. It provides basic services that all apps can use. The core services layer, like the other layers, provides a set of frameworks:

  • Accounts framework: This framework allows users to access and manage their external accounts directly from your app without having to enter their login information.
  • Address Book framework: This framework allows access to the user’s contact information.
  • Ad Support framework: This framework Give apps access to an identifier for advertising.
  • CFNetwork framework: This framework manages network configuration changes and access to network services.
  • Core Data framework: This is the technology used to manage a Model View Controller (MVC) app’s data model.
  • Core Foundation framework: This framework provides interfaces for iOS apps that provide basic data management and service functions.
  • Core Location framework: This framework supports providing the application location and heading data.
  • Core Media framework: This framework uses essential data types to represent time-based audio-visual content.
  • Core Motion framework: This framework is used to access all motion-based data on the device.
  • Core Telephony framework: This framework provides access details about a user’s cellular service provider, such as the carrier’s VoIP support and unique identity.
  • EventKit framework: This provides access to calendar and reminders data so users can create, retrieve, and edit calendar items in your app.
  • Foundation framework: This provides a base layer of functionality for apps and frameworks, including data storage and persistence, text processing, date and time calculations, sorting and filtering, and networking. The classes, protocols, and data types defined by Foundation are used throughout the macOS, iOS, watchOS, and tvOS SDKs.
  • Mobile Core Services framework: This framework provides access and control of important operating system features including launch and identity services.
  • NewsstandKit framework: This helps develop the client side of a Newsstand application. Through the Newsstand, users can browse through newspapers and magazines that are optimized for viewing on mobile devices.
  • PassKit framework: This framework creates and distributes passes for the Wallet app, and accepts (like Apple Pay) payments in your app.
  • Quick Look framework: This framework creates file previews for usage within your app or edit previews with ease.
  • Social framework: This framework utilizes common system interfaces, posts material to supported social networking sites.
  • StoreKit framework: This framework supports in-app purchases and interactions with the App Store.
  • System Configuration framework: This framework allows applications to access the network configuration options on a device, check the device’s reachability, such as whether Wi-Fi or cellular connectivity is active.

Media Layer

You can use multimedia services from the Media layer on your iPhone. It makes the system’s entire graphics, audio, and video technology possible. It enables the developer to work with graphics-like elements like animations, photographs, movies, and audio. Apple frequently offers feedback on multimedia experiences, especially about the audio and video quality. The iOS stack’s media layer, which gives the iOS access to audio, video, graphics, and AirPlay (over-the-air) capabilities, essentially fills this duty. Similar to the Cocoa Touch layer, the media layer has a number of frameworks that programmers can use:

  • Assets Library framework: This framework provides access to the media library of a user’s assets.
  • AV Foundation framework: This framework works with audiovisual resources, manages camera settings, edits audio, and builds up system audio interactions.
  • Core Audio framework: This framework provides interface with the audio hardware of the device.
  • Core Graphics framework: This framework is the iOS app’s native drawing engine, and it supports custom 2D vector and image-based rendering.
  • Core Image framework: This framework provides advanced nondestructive support for controlling video and motionless photographs
  • Core MIDI framework: This framework provides APIs to communicate with MIDI (Musical Instrument Digital Interface) devices, including hardware keyboards and synthesizers.
  • Core Text framework: This framework provides a low-level programming interface for laying out text and handling fonts. The Core Text layout engine is designed for high performance, ease of use, and close integration with Core Foundation. The text layout API provides high-quality typesetting, including character-to-glyph conversion, with ligatures, kerning, and so on.
  • Core Video framework: This framework utilizes a pipeline-based API with support for both Metal and OpenGL to process digital video, including frame-by-frame editing.
  • Image I/O framework: This framework provides access to the metadata of an image and reads and writes the majority of image file types.
  • GLKit framework: This framework manages advanced 2D and 3D rendering using hardware-accelerated APIs.
  • Media Player framework: This framework finds and plays songs, audio podcasts, audio books, and other media from within your app.
  • OpenAL framework: This framework is an Industry Standard Audio Delivery Technology.
  • OpenGL ES framework: This framework controls powerful 2D and 3D rendering with hardware-accelerated interfaces.
  • Quartz Core framework: This framework allows users to view, alter, and save photos using slideshows and Core Image filters.

Cocoa Touch

The Cocoa Touch layer offers an abstraction layer that makes the various libraries for iPhone and other iOS device programming accessible. A vital group of Objective-C frameworks that were created using the Mac OS X Cocoa API is included with the Cocoa Touch layer. Any iOS app you encounter has an aesthetic that was created with the Cocoa Touch framework. This layer supports notifications, multitasking, touch-specific inputs, all high-level system services, and other important technologies. It also offers fundamental infrastructural support for an app.

The list of significant frameworks that are frequently used in this layer is as follows:

  • Address Book UI framework: This framework obtains the contacts of users and presents them in a graphical interface.
  • Event Kit UI framework: This framework depicts a common system interface that uses view controllers to display and change events.
  • Game Kit framework: This framework allows users to share their game-related data online via a Game Center.
  • iAd framework: This framework allows you to display banner adverts from your app.
  • Map Kit framework: This framework provides a scrollable map that may be included in the app’s user interface.
  • Message UI framework: This framework builds an email and text message composing interface so users can update and send messages without leaving your app.
  • Twitter framework: This framework provides a user interface for creating tweets as well as the creation of URLs to access the Twitter service.
  • UI Kit framework: This framework provides a critical foundation for developing graphical, event-driven apps for iOS. Some of the most important features of the UI Kit framework are:
    – Support for multitasking.
    – Fundamental app management and infrastructure.
    – User interface administration.
    – Touch and Motion events are supported.
    –Support for cutting, copying, and pasting, among other things.

Understanding how iOS architecture works is an excellent place to start when it comes to iOS penetration testing. We will be talking more about iOS apps and device security in upcoming blogs.

By partnering with Redfox Security, you’ll get the best security and technical skills required to execute an effective and thorough penetration test. Our offensive security experts have years of experience assisting organizations in protecting their digital assets through penetration testing services.

Redfox Security is a diverse network of expert security consultants with a global mindset and a collaborative culture. With a combination of data-driven, research-based, and manual testing methodologies, we proudly deliver robust security solutions.

“Join us on our journey of growth and development by signing up for our comprehensive courses, if you want to excel in the field of cybersecurity.”

--

--