1

Simple Question: How do I download android operating system source code version 8.0.0 using the repo tool on linux mint?

Detailed:

I want to download android source code. Edit some of the code, then install it onto a device. I installed a linux operating system, and downloaded/initialized repo. However, for the life of me I cannot understand how to use REPO.

I use the operating system tag: OPR4.170623.009. Which is android-8.0.0_r16 Oreo

That is the following command:

repo sync [OPR4.170623.009]

I get this result

... A new version of repo (2.12) is available.
... You should upgrade soon:
    cp /home/k/.repo/repo/repo /home/k/bin/repo

error: project [OPR4.170623.009] not found

I even tried

repo sync [<OPR4.170623.009>]

I got

bash: OPR4.170623.009: No such file or directory

It is very weird, because the 'Downloading the Source' page doesn't really one on how to actually download the source. (https://source.android.com/setup/build/downloading#initializing-a-repo-client). It makes is seem like I should be using sync, and the 'source code tags'. However it doesn't say how to put those two together:

Here:

repo sync [project0 project1 ... projectn]
repo sync [/path/to/project0 ... /path/to/projectn]

It shows some example, but that doesn't look anything like their tags?

1 Answer 1

1

The version you want to download has to be specified for repo init, not for repo sync. Also, the version is specified using the tag, not the build ID (the second column in this list).

So the steps you have to take would be as follows:

  • Initialize the repo with the build tag you want (for example android-8.0.0_r16):

    repo init -u https://android.googlesource.com/platform/manifest -b android-8.0.0_r16
    
  • Synchronize the repo:

    repo sync --jobs=32 --current-branch --no-tags --quiet
    

    The additional flags passed to repo sync are not required, but might be helpful: The flag --jobs=32 will attempt 32 downloads in parallel (adjust to your network bandwidth). The flag --current-branch will download only the branch you have specified during repo init. The flag --no-tags will disable downloading of tag data. With the flag --quiet only the overall download progress will be shown.

Some general note: You indicated that you want to flash the image to a device. Note that your device will likely require device specific drivers to be included in the image. These drivers are generally not part of AOSP. Also, your device may have a locked boot loader that does not allow flashing custom images. I cannot give more details since I don't know the device you are targeting.

Sign up to request clarification or add additional context in comments.

10 Comments

I'm not familiar with Samsung devices unfortunately, so this would have to be a separate question for someone else to answer. Samsung may offer a way to download these drivers, but it is also entirely possible they are kept private.
In theory, yes it would be possible to only replace individual components (for some components this will be easier than others). This assumes you have a rooted device that allows such write access (the second point in my note). In general, the device vendor has an interest in not giving you such write access, since that would allow you to modify and resell their devices, which could potentially be damaging to their reputation.
To obtain a rooted device the "official" way, you would have to be part of a business that can negotiate some contract with the device vendor, which generally involves the ability to resell a large quantity of devices. Obtaining a rooted device the "unofficial" way generally involves some tools that can bypass the security mechanisms of the device. You could probably find some guides on how to root your device, though I cannot give you any recommendations (both because I'm not familiar with Samsung device and because I'm unable to judge the trustworthiness of these tools).
Regarding the extraction of the binaries: In theory, yes the drivers are stored in memory and you could extract them. Though that would involve knowing where to look, I cannot help you with that, because I don't know the details of where Samsung stores its drivers. Likely, the partition layout will have a boot partition (holding the kernel, which likely contains Samsung-specific drivers) and a system partition (holding most of the compiled AOSP code), a vendor partition holding vendor-specific files, which could include additional drivers, a user data partion and maybe other partitions.
Google is pushing the device vendors to minimize the amount of customization they do on the system partition (known as Project Treble). If Samsung fully follows that guideline, then the system partition would not contain any Samsung drivers and you could just flash your custom system partition, in that case you would not have to bother with device-specific drivers. My guess would be that Samsung is not fully following this guideline and has some customization on the system partition, but I do not know to what extend. In that case, flashing your own system partition may or may not work.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.