




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















This chapter provides information about the Background, Problem Statement and Objective of the study.
The Android Operating System (OS) is a free and open source, fully customizable mobile OS plat- form. The Android Open Source Project (AOSP), which provides a framework for the development of Android, uses a community-driven model for the improvement of mobile operating system platforms. Developers around the world can distribute and share code. This helps others to use the shared code and develop their own AOSP variants. In November 2007, AOSP was announced. Since the initial release of the AOSP, many popular variants have been introduced. AOSP is led by Google and the Open Handset Alliance (OHA). Android source code is released under an open source license, but paradoxically, most Android devices ship with a combination of free and open source and proprietary firmware, especially the firmware required for accessing Google Play Services.
Google Play Services, generally referred to as Google Mobile Services (GMS), has system-level control over the mobile device. It is part of the Google Apps package and is proprietary. Developers having the intention to develop an open source application and publish it on the Play store need to agree upon Google’s terms, which state that a few parts of the code are proprietary. This paradoxical situation of the impossibility of launching a complete free and open source applicaton via the Play Store raises many privacy and security-related concerns.
AOSP has functioned as the baseline for all original equipment manufacturers (OEMs) and community- run packaged firmware such as CyanogenMod. Some of the apps inside AOSP have been abandoned and then released on Google Play with a closed-source model. Many apps only function when Google Play Services are available. Examples include Gmail, YouTube, and Google Maps.
There are many distributions of Android. CyanogenMod (CM) was a popular fork of AOSP developed by Cyanogen (Cyngn) Inc. that emphasized allowing its users to modify everything on the platform. In December 2016, Cyanogen Inc. announced the discontinuation of the CyanogenMod project. One- Plus’ first phone, Oneplus One, was a popular smart phone featuring Cyanogen OS when it shipped in
LineageOS emphasizes the delivery of a complete free and open source project. This is in contrast with the usual way to run Android hardware, in which source code is adapted by original equip- ment manufacturers (OEMs) that produce parts and equipment that were originally manufactured by another company.
This section states various problems with the Android Open Source Project in practice.
Most Android application developers rely on the Application Programming Interfaces (APIs) of Google Play services. These services include the location API, which is needed for all map-related work on a mobile device. Google Play Services is a proprietary code base; hence, nobody knows precisely how applications using it work. There are many similar APIs for which we do not have access to the full source code.
For years, Google has been adding functionality not only to the AOSP code base, but also to its own proprietary binary libraries and very specific GMS (Google Mobile Services). Manufacturers must pass a compatibility test to receive official GMS support from Google. Usually, the code being tested includes device drivers that are proprietary, meaning there is no hope of looking at the code to understand what happens inside. As a user of proprietary software is not allowed to control its execution (the vendor and other third parties control it), he or she cannot prevent tracking and selling his or her information to advertising companies, and he or she is prevented from doing all possible things on the device. At a high level, users are controlled and directed to do what vendors want them to do. On a practical level, users are continually told that their devices are obsolete just because vendors fail to upgrade the firmware. Specifically, even though AOSP is free and open source software in theory, in practice most devices uses dozens of proprietary blobs to control the actual hardware.
Most Android-based devices are manufactured with a chip-set named Qualcomm Snapdragon. This is a system on chip (SOC) semiconductor device designed and marketed by Qualcomm for mobile devices. Qualcomm develops a large number of propreitory device drivers for the SOC. Other device manufacturers have to buy the SOC and drivers from Qualcomm. For example, the H.264 video and audio codec library for the Snapdragon is actually developed by Qualcomm, who owns a patent on it. Being closed source, any flaws of the hardware-level implementation of the mobile phone are nearly impossible to fix.
Documents released by Edward Snowden have revealed that the National Security Agency (NSA) and Global Surveillance joint programs, such the program named PRISM, aims at collecting all pos- sible information about people around the world by partnering with companies such as Microsoft, Facebook, Apple, and Google (MacAskill, 2013). LineageOS is aimed at community development that reaches the masses and provides a purely free and open source operating system. GMS is not
This chapter reviews mobile operating systems and Google Mobile Services (GMS) and compares alternatives to GMS such as independent email applications, alternative search engines, offline maps, and alternative application repositories. I also provide information regarding the previous work.
In general, a mobile OS typically starts up when a device powers on, presenting a screen with icons or tiles that present information and provide application access. Mobile operating systems manage cellular and wireless network connectivity, as well as phone access. All of these tasks must be han- dled by an embedded system.
Around 1994, IBM launched the first smartphone, named IBM Simon, which only had a touchscreen, email, and PDA features. Slightly later, Symbian Ltd introduced Symbian OS, which was used by Nokia and then became the first modern mobile OS on a smartphone with the launch of the Ericsson R380 mobile phone. Around 2008, the Open Handset Alliance (OHA) released Android 1.0 based on the Linux kernel on the HTC Dream (T-Mobile G1) as the first Android phone. Android’s first version had features including the GMS from the beginning.
AOSP, being an open source developer community spread around the world, enables introduction of different custom ROMs enabling users to modify the system. LineageOS, which is a recent fork of the defunct of CyanogenMod ROM, allows users to side-load GMS or leave it out.
Google Mobile Services (GMS) includes applications and services provided by Google that enhance the user’s mobile experience. Applications such as Gmail, Chrome, Google Maps, YouTube, Google Docs, and the Play Store are pre-installed in stock Android versions. These are closed source applica- tions. There are many privacy and data mining issues with GMS because they ships many proprietary blobs with unknown functions in the software and device drivers. Google Play Services has two major components: client library and external Android Package Kit (APK) files. The client library contains interfaces to the individual Google services and allows them to obtain authorization from users to gain access to Google Play Services with their credentials. It also contains APIs that allows resolving any issues at runtime, such as a missing, disabled, or out-of-date Google Play services APKs. The Google Play Services APK contains the individual Google services and runs as a background service in the OS. Figure 2.1 shows an overview of the Google Play Services and their operation.
Figure 2.1: Overview of Play Services
Independent Email Applications such as K-9 Mail, Tutanota, and ProtanMail help developers to re- view and modify their source as intended under a free and open source model. K-9 Mail is the most popular alternative mail service has several features. Tutanota and Proton are also being the popular alternative mail services has the end-to-end encryption infrastructure. As GMS is unable to assuage user’s privacy concerns, these kind of alternative email applications are necessary.
There are different search engines available as alternatives to Google search. All of these search engines are based on search engine optimization (SEO) techniques. DuckDuckGo (DDG) is a popular open source alternative to Google search. It emphasizes protecting searchers’ privacy and avoiding personalized search results. DDG distinguishes itself from other search engines by claiming that it does not profile its users and deliberately shows all the users same search results for a given search term. It emphasizes returning the best results rather than the most results and generates those results from over 400 individual sources. It includes key crowdsourced sites such as Wikipedia and other search engines such as Bing, Yahoo!, Yandex, and Yummly.
DDG has an interesting feature, “!Bang” syntax, which allows searchers to use keywords from a menu list and directly search over different available sites. There is also the possibility of writing DDG tools on the “DDG hack” platform. Some parts of DDG’s source code is free software is hosted at GitHub under the Apache 2.0 License, but the core is proprietary. It is used by a few corporations
The microG project is a free and open source re-implementation of Googles proprietary Android client side apps and libraries. Different free and open source applications require Googles proprietary libraries to be installed. To solve this problems, different scenarios led to the development of a free and open source software clone of Googles proprietary core libraries and applications. The main idea of this project was to build a free and open source replacement for all proprietary parts injected by Google into the Android ecosystem. The components of this project are shown below.
There have been many projects building on the AOSP demonstrating tasks such as reverse engineer- ing, exploring the Play Store, and privacy-and security-related aspects of the project. Table 2.4 shows this related works.
Table 2.1: Work plan for research
At present, OnePlus company has five different devices, and OnePlus One is the first version of their flagship product line. For each of these devices, LineageOS has different nightly builds, which are maintained regularly. OnePlus One’s nightly builds are named under the codename “bacon”. In order to proceed with the installation, users should download a nightly build.
At first, OnePlus One was pre-installed with CyanogenMod OS. By December 2016, there were no future stock updates from the company. During that period, the device had CyanogenMod 13.1 as the stock OS. Before installing LineageOS, it is recommended to flash the unofficial CyanogenMod 13.1.2 OS first, as it upgrades to the latest firmware. Before installing any custom ROM, it is sug- gested to have the latest firmware on the device. Android SDK platform tools help to interact with the device shell and further interact with wiping partitions, flashing the OS, and other tasks.
Android SDK Platform Tools are basic to developing Android applications. The toolset include tools that interface with the Android platform, such as adb, fastboot, and systrace. These tools help unlock the device boot-loader and allow flashing it with a new system image. Using fastboot, a device can be flashed with a recovery file, then adb can be used to flash a custom ROM through the recovery mode. adb also allows the device shell to be accessed.
In general, the bootloader is a software program that activates an operating system. We can utilize the fastboot tool to switch to bootloader mode in order to flash a new version of the OS. This involves a complete format of the partition tree. To perform privileged shell-level activities, we must unlock the bootloader in order to give root access to the system partitions.
As mentioned earlier, the recovery partition is a separate partition on the system. It helps users to recover a damaged system with the help of tools. Besides the stock recovery mode, a device can be loaded with a custom recovery tool. Usually, custom recovery provides more functions than the stock recovery. There are many custom recoveries, among which ClockworkMod (CWM) and TeamWin (TWRP) are the most popular. CWM is a software company, whereas TWRP is an open source community project.
In order to flash a custom ROM, the device’s partitions should first be formatted. Partitions such as data, system, and cache must be wiped from the system. This is because most data is stored in those partitions. In many of the cases, normal wiping works, but if partitions are not wiped correctly, a hard wipe may be required; this means a full format of the device. OnePlus One uses the ext4 format for
the partition tree, and it requires a hard wipe to format the partition tree, because this requires several back and forth operations regarding the OS.
Flashing LineageOS on OnePlus One requires a few basic steps. As mentioned earlier, we should first upgrade to the stock version of CM 13.1.2 and follow by flashing an experimental migration build of LineageOS. This is because of the firmware included in the last stock version. LineageOS builds prior to that stock version are deprecated, and now version 14 nightly builds should be used for all devices.
We must make sure to have a full backup of the system, as data is not recovered after formatting the storage device. Also, the device needs a full charge before proceeding with the installation.
The XDA-developer community maintains the unofficial stock CM 13.1.2 version in the form of downloadable zip file. We must also make sure to download the Android SDK platform tools for Debian GNU/Linux (now it is only implemented in this environment). We must place the downloaded CM 13.1.2 zip in the SDK tools directory.
We enter fastboot mode and flash the zip file before connecting it to the laptop. TWRP is suggested on user forums. We must check the device information to make sure the flashed OS is as expected. Next, to flash LineageOS, we must make sure to download the experimental migration build from CM. Finally, by repeating the above steps, LineageOS can be successfully installed. Hereafter, nightly builds can be received as updates occur.
It is possible to install the bundled Google Apps package. This package depends on Google Mobile Services. LineageOS offers users a choice to side-load these bundled GApps.
This chapter gives results for the work that was done in chapter 3. It has the two method results which are based on the pre-build installation and source code compilation.
First, I attempted installation through the pre-build images from the official LineageOS website. This process utilizes the Android studio platform tools. As the process involves two upgrades, first the Oneplus One needs to be upgraded to the LineageOS experimental build, then we follow with the nightly update as they occur. The whole process took two hours on a 2.5 GHz CPU with 3GB RAM. Table 4.1 shows the specifications of the OnePlus One mobile phone.
Next I fetched the source from the official LineageOS project page in Github. I did the build on a virtualbox with Ubuntu 16.04 as the host system. The process took nine hours to build the entire image on a 3.10GHz CPU-i5-4440 with RAM of 5GB. In order to build proprietary modules, I extracted those modules sources from existing LineageOS device. Here, I used the pre-build image for the OnePlus One device to extract the sources of the proprietary modules. The code is available in official LineageOS Github page. The Figures 4.1-4.4 show the post execution directories of the LineageOS source compilation.
Figure 4.1: Main build tree.