[iOS] Youtube App, What is inside the IPA package?

Attention: This share is only for researching and learning purpose.

Youtube iOS app is a high-rating video streaming app. It is absolutely 5 stars. For me with the experience I have gained in the iOs mobile app development, I have to say that the youtube iOS app is kinda a role model in the industry. It successfully gives the end-users the best experience. The app is smooth, high responsive, stable, simple and well-designed generally. It actually does better than most of video streaming apps I have known.

youtube-app.png

All of these engage my curiosity in many aspects like How has it architecture and developed the app? What technologies has it used? Has it used open source libs? What design patterns has it used, and so on.

I wish some days I can look at its source code. But that is maybe improbable. Therefore, I have spend my time by using several ways revert-engineering to look closer at the app, try to reveal as much information as I can and I wish I can learn anything from it.

Youtube-view-hierarchy

In this post, I would like to share what I have found from my look-over. I hope these can be a helpful learning resource for anyone.

IPA package

In this post, I’m gonna share what I have seen inside the latest Youtube IPA package file. As you guys have known, on iOS the IPA file is the final package which reach to the end customers. By looking over this file, I think it’s gonna reveal many things, and my job is do the best guest.

I have pulled the latest IPA file from my phone on Mar 5 2019, or to save your time, you can just go to iphonecake.com and grab the file)

Open source, 3rd party libs

The thing I pay most attention is there are a lot of software license files in the package/ These are maybe the clues on the technologies and libs which the app used. Below is the list. I have categorized them, but I still feel overwhelm because most of them are not in my awareness. How many of them you haven known and not known? Ok, Check them out.

  • Image processing, Graphical lib
    GL_LICENSE.html -> This maybe is open GL library
    glm_LICENSE.html -> glm – OpenGL mathematics library
    openctm_LICENSE.html -> openctm – OpenCTM is a file format, a software library and a tool set for compression of 3D triangle meshes
    OpenCV_LICENSE.html -> OpenCV – computer vision lib
    OpenCVX_LICENSE.html -> OpenCVX – computer vision extensions lib
    drishti_LICENSE.html -> Drishti – eye tracking lib
    swiftshader_LICENSE.html -> SwiftShader – high-performance CPU-based implementation of the OpenGL ES and Direct3D 9 graphics APIs
    lullaby_LICENSE.html -> Google lullaby – A collection of C++ libraries designed to help teams develop virtual and augmented reality experiences
    libtxc_dxtn_LICENSE.html -> libtxc_dxtn – Helper library for S3TC texture (de)compression
  • Algorithm
    absl_algorithm_LICENSE.html -> Abseil – General C++ lib
    dimsum_LICENSE.html -> Google Dimsum – General C++ lib
    stblib_LICENSE.html -> stblib – stb single-file public domain libraries for C/C++
    address_sorting_LICENSE.html -> address_sorting (not sure about the source)
    eigen3_LICENSE.html -> Eigen 3 – C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
    gemmlowp_LICENSE.html -> gemmlowp – general matrix multiplication C++ lib
    kissfft_LICENSE.html -> Kiss FFT – Fast Fourier Transform (FFT) C++ library
    lapack_LICENSE.html -> LAPACK (not sure about this)
    half_LICENSE.html -> HALF-PRECISION FLOATING POINT LIBRARY
    vectorial_LICENSE.html -> vectorial – Vector math library
    pcg_random_LICENSE.html/PCG Random Number Generator
  • Encryption
    crunchy_LICENSE.html -> Google Crunchy Crypt
    highwayhash_LICENSE.html -> Google HighwayHash – Fast strong hash functions: SipHash/HighwayHash
  • Networking – Data transport
    android_nanoproto_LICENSE.html -> Protobuf Nano (not sure about the source)
    ares_LICENSE.html -> ares – A C library for asynchronous DNS requests
    curl_LICENSE.html -> curl – A command line tool and library for transferring data
    libevent_LICENSE.html -> libevent – an event notification library
    grpc_LICENSE.html -> gRPC – Google universal RPC framework
    openssl_LICENSE.html -> Google BoringSSL – BoringSSL is a fork of OpenSSL that is designed to meet Google’s needs.
    grte_extensions_LICENSE.html/GRTE
    protobuf_LICENSE.html -> Protocol Buffers – Google’s language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler
    flatbuffers_LICENSE.html -> Google FlatBuffers – cross platform serialization library for multi languages
    libsrtp_LICENSE.html -> Cisco libSRTP – Secure Realtime Transport Protocol
    nanopb_LICENSE.html -> Nanopb – Protocol Buffers with small code size
  • Parser
    libxml_LICENSE.html -> Libxml2 – XML C parser and toolkit
    tinyxml2_LICENSE.html -> tinyxml2
    xmpmeta_LICENSE.html -> Google xmpmeta – library for parsing and writing XMP and XDM metadata
    yaml_cpp_LICENSE.html -> yaml_cpp – A YAML parser and emitter in C++
    uri_parser_LICENSE.html -> uri_parser – a strictly RFC 3986 compliant URI parsing and handling library written in C
  • Chromium
    breakpad_LICENSE.html -> breakpad (not sure about the source)
    chromium_certificate_verifier_LICENSE.html -> Chrome Certificate Verifier (not sure about the source)
    chromium_media_parsers_LICENSE.html -> chromium_media_parsers (not sure about the source)
  • Compression
    brotli_LICENSE.html -> Google Brotli – Brotli compression format
    bz2lib_LICENSE.html -> bzip2 – file compression program
    minizip_LICENSE.html -> minizip -Minizip framework wrapper
    zippy_LICENSE.html -> Zippy (not source about the source)
    zlib_LICENSE.html -> zlib – lossless data-compression library
    zstdlib_LICENSE.html -> Zstandard – real-time compression algorithm
  • Javascript
    v8_v6_9_LICENSE.html -> V8 v6.9 – Google’s open source high-performance JavaScript and WebAssembly engine, written in C++
    gios_closure_compiler_LICENSE.html -> Closure Compiler – A JavaScript checker and optimizer.
    gios_closure_library_LICENSE.html -> Closure Library -mGoogle’s common JavaScript library
    javascript_jquery2_LICENSE.html -> jquery2
    javascript_jquery_ui_LICENSE.html -> jquery_ui
    javascript_tracing_framework_LICENSE.html -> Google tracing_framework – A powerful toolset for investigating the performance of rich Javascript applications.
  • Java, android
    java_src_j2objc_protobuf_LICENSE.html -> Google J2ObjC – A Java to iOS Objective-C translation tool and runtime
  • Others
    darts_clone_LICENSE.html
    halide_LICENSE.html -> Halide – a language for fast, portable data-parallel computation
    lua_LICENSE.html -> lua (not sure about the source)
  • Video, Image, Codec
    dav1d_LICENSE.html -> dav1d – AV1 decoder
    libyuv_LICENSE.html -> libyuv – YUV scaling and conversion functionality
    jpeg_LICENSE.html -> libjpeg – JPEG image codec lib
    lodepng_LICENSE.html -> lodepng – PNG image decoder and encoder standalone lib
    libjpeg_turbo_LICENSE.html -> libjpeg-turbo – JPEG image codec
    png_LICENSE.html/PNG
    tiff_LICENSE.html
  • Google SDK, API
    firebase_ios_Releases_FirebaseCore_LICENSE.html -> Firebase
    googleurl_LICENSE.html/googleurl
  • Text, String, Font
    freetype2_LICENSE.html -> freetype2 – render fonts lib
    utf_LICENSE.html -> UTF – handle UTF-8 encoded Unicode strings
    icu_LICENSE.html -> ICU4C – International Components for Unicode
    pcre_LICENSE.html -> PCRE – regular expression pattern
    re2_LICENSE.html -> RE2 – a regular expression library
    unsmear_LICENSE.html -> Unsmear
  • Game
    fplbase_LICENSE.html -> Google fplbase – lowest level game library
    mathfu_LICENSE.html -> Google mathfu – C++ math library developed primarily for games
    motive_LICENSE.html -> Google motive – an animation system written in cross-platform C++
    fplutil_libfplutil_LICENSE.html -> Google libfplutil – fplutil is a set of small libraries and tools that can be useful when developing applications for Android and other platforms
  • Speech, audio
    speex_v1_2rc1_LICENSE.html -> speex – patent-free audio compression format designed for speech
    stl_LICENSE.html -> STL  – speech and audio-related speech processing
    libresample_LICENSE.html -> libresample – Real-time library for sample rate conversion
    libopus_LICENSE.html -> Opus audio codec – Utility, Encode, decode Ogg Opus files (not sure about the source)
  • Machine learning, neural network
    tensorflow_LICENSE.html -> TensorFlow
    rnnoise_LICENSE.html -> rnnoise – Recurrent neural network for audio noise reduction
  • Objective-C
    objective_c_AppleReachability_LICENSE.html -> AppleReachability
    objective_c_ChromeWebView_LICENSE.html -> ChromeWebView
    objective_c_CocoaHTTPServer_LICENSE.html -> CocoaHTTPServer – A small, lightweight, embeddable HTTP server
    objective_c_CocoaLumberJack_LICENSE.html -> CocoaLumberJack – A fast & simple, yet powerful & flexible logging framework
    objective_c_Cronet_LICENSE.html -> Chromium Cronet – Cronet is the networking stack of Chromium put into a library for use on mobile
    objective_c_DTCoreText_Externals_DTFoundation_LICENSE.html -> DTFoundation – Standard toolset classes and categories
    objective_c_DTCoreText_LICENSE.html -> DTCoreText – Methods to allow using HTML code with CoreText
    objective_c_FLAnimatedImage_LICENSE.html -> Flipboard – FLAnimatedImage – Performant animated GIF engine for iOS
    objective_c_IGListKit_LICENSE.html -> Instagram InstragIGListKit – A data-driven UICollectionView framework
    objective_c_OALayoutAnchor_LICENSE.html -> OALayoutAnchor
    objective_c_OAStackView_LICENSE.html -> OAStackView – Porting UIStackView to iOS 7+
    objective_c_ObjectionFramework_LICENSE.html -> ObjectionFramework – A lightweight dependency injection framework for Objective-C
    objective_c_PINCache_LICENSE.html -> Pinterest PINCache – Fast, non-deadlocking parallel object cache
    objective_c_PINOperation_LICENSE.html -> Pinterest PINOperation – Fast, concurrency-limited task queue
    objective_c_PINRemoteImage_LICENSE.html -> Pinterest PINRemoteImage – A thread safe, performant, feature rich image fetcher
    objective_c_Promises_LICENSE.html -> promise kit | Google promises (not sure about the source)
    objective_c_ResumableAssert_LICENSE.html -> Google ResumableAssert – Assert replacement to continue execution in debugger
    objective_c_TBXML_LICENSE.html -> TBXML – Super-fast, lightweight, easy to use XML parser
    objective_c_TPCircularBuffer_LICENSE.html -> TPCircularBuffer – A simple, fast circular buffer implementation for audio processing
    objective_c_Texture_LICENSE.html -> Facebook Texture – Asynckit for smooth asynchronous user interfaces
    objective_c_VideoCore_LICENSE.html -> VideoCore – video manipulation and streaming graph
    objective_c_google_api_objectivec_client_for_rest_LICENSE.html -> Google APIs Client Library for Objective-C for REST
    objective_c_google_toolbox_for_mac_LICENSE.html -> Google Toolbox for Mac
    objective_c_gtm_session_fetcher_LICENSE.html -> Google gtm_session_fetcher
    objective_c_libPhoneNumber_iOS_LICENSE.html -> libPhoneNumber_iOS
    objective_c_lottie_ios_LICENSE.html ->Airbnb lottie_ios – iOS library to natively render After Effects vector animations
    yoga_LICENSE.html -> Facebook yoga – a cross-platform layout engine which implements FlexboxMaterial.io
    objective_c_material_components_ios_LICENSE.html -> Material.io Components for iOS
    objective_c_material_font_disk_loader_ios_LICENSE.html -> Material.io MDFFontDiskLoader
    objective_c_material_internationalization_ios_LICENSE.html -> Marerial.io MDFInternationalization
    objective_c_material_roboto_font_loader_ios_LICENSE.html -> Material.io MDFRobotoFontLoader
    objective_c_material_sprited_animation_view_ios_LICENSE.html -> Material.io MDFSpritedAnimationView
    objective_c_material_text_accessibility_ios_LICENSE.html -> Material.io MDFTextAccessibility
    objective_c_motion_animator_LICENSE.html -> Material – motion animator
    objective_c_motion_interchange_LICENSE.html -> Material – motion interchange
    objective_c_motion_transitioning_LICENSE.html -> Material – motion transitioning
    objective_c_nimbus_LICENSE.html -> nimbus
  • Debugging
    tracing_framework_bindings_cpp_LICENSE.html -> Web Tracing Framework C++ Bindings
  • RTC
    webrtc_LICENSE.html -> WebRTC – Real-Time Communications (RTC) capabilities via simple APIs
    webrtc_files_stable_webrtc_common_audio_third_party_fft4g_LICENSE.html/fft4g
    webrtc_files_stable_webrtc_common_audio_third_party_spl_sqrt_floor_LICENSE.html/spl_sqrt_floor
    webrtc_files_stable_webrtc_examples_androidapp_third_party_autobanh_LICENSE.html/AutobahnAndroid
    webrtc_files_stable_webrtc_modules_third_party_fft_LICENSE.html/fft
    webrtc_files_stable_webrtc_modules_third_party_g711_LICENSE.html/g771
    webrtc_files_stable_webrtc_modules_third_party_g722_LICENSE.html/g722
    webrtc_files_stable_webrtc_modules_third_party_portaudio_LICENSE.html/Portaudio
    webrtc_files_stable_webrtc_rtc_base_third_party_base64_LICENSE.html/Base64
    webrtc_files_stable_webrtc_rtc_base_third_party_sigslot_LICENSE.html/sigslot
  • Unclassified
    OpenBLAS_LICENSE.html -> OpenBLAS
    SADIE_hrtf_database_LICENSE.html
    Xorg_LICENSE.html -> X.Org
    cbc_LICENSE.html -> cbc (not sure about the source)
    astc_codec_LICENSE.html -> Google astc_codec – ASTC decoder
    usrsctp_LICENSE.html -> SCTP – A portable SCTP userland stackcloud_truetime_c_sequence_lock_LICENSE.html
    fft2d_LICENSE.html/Ooura FFT (not sure about the source)
    libcap_LICENSE.html -> The libcap package implements the user-space interfaces to the POSIX (Not sure this lib is used for what)
    intel_intrinsics_LICENSE.html – not sure about this, but there is an explain
    pffft_LICENSE.html -> pffft – A Parallel Portable Library for Computing FFT
    libffi_LICENSE.html -> libffi – FFI stands for Foreign Function Interface. A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language
    mesa_LICENSE.html -> mesa – an agent-based modeling framework in Python
    mongoose_LICENSE.html -> mongoose – GitHub’s most popular embedded web server

After going through the list of the open source and 3rd libraries which the Youtube app has used. I’m so surprised on these things:

  • The number of libraries It has consumed is massive (~150 open source / 3rd party libs) if comparing to some enterprise apps I have known and developed. I’m not sure how many of them Youtube actually has consumed, but the number is impressive.
  • Youtube team is not shy away on using open source libs. Some of open source lib are not even high rated.
  • Youtube team is not afraid to use the open source libs from its competitors. For examples: Facebook, Instagram, Pinterest.
  • Youtube/ Google has built its in-house libraries, and it’s willing to open them for everyone as well.

Programming Language

By what I have seen in the IPA file, I believe the app has been written in Objective-C, because of these:

  •  There are clues which show that the app has consumed many Objective-C open source libs.
  • The app seems like consuming a lot of C/C++ libs, so Objective-C is a more appropriate choice.
  • There is no sight of a dynamic frameworks because the frameworks directory is almost empty.

Conclusion

To keep this post short and not so overwhelming, I should stop it here. I think it may reveal some of your questions. Actually I feel happy because it also has answered some my chronic questions:

  • Does a giant enterprise like Youtube/Google use open source and 3rd libraries? Yes, it does and it uses massively. It is not a wise choice to build everything again from scratch like somebody says “Don’t re-invent the wheel”, otherwise it is time-consuming, money-consuming and the output may not be better. Some 3rd library has been mature and used widely for decades.
  • Does anyone use Objective-C? Yes, this IPA package shows us that Objective-C has been using despite of Swift. In general, Objective-C is still a good programming language to rely on. Both Swift and Objective-C have their own advantages. Don’t look down on either

Next, I continue look over the Youtube app’s view hierarchy and its floating video player layout. Hopefully This is a helpful resource for you guys, so stay tuned.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s