You must run a 64-bit Linux distribution to build Paranoid Android. Follow the system setup instructions on the Android Open Source Project website. Google provides Ubuntu-specific setup packages and instructions. Complete the environment setup before you proceed.
Repo is a tool provided by Google that simplifies using Git with Android source trees.
Create a directory for repo and add it to your PATH:
mkdir -p ~/.local/bin
export PATH=~/.local/bin:$PATHDownload the repo binary:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.local/bin/repoMake the binary executable:
chmod a+x ~/.local/bin/repoCreate a working directory on a case-sensitive filesystem and navigate into it.
Replace WORKSPACE with your chosen directory path.
mkdir WORKSPACE
cd WORKSPACEInitialize the manifest repository:
Important
Configure your real name and email address in Git before you initialize Repo if you plan to submit patches.
repo init -u https://github.com/AOSPA/manifest -b calciteRun repo sync to pull upstream source code.
Note
Initial synchronization downloads the entire source history and takes significant time.
The -j option specifies the number of concurrent network jobs.
repo sync --current-branch --no-tags -j4Tip
A value of four jobs (-j4) works well for most internet connections.
Adjust this value based on your connection speed.
You can synchronize individual projects instead of the entire source tree. Specify projects by repository path or remote name.
Warning
Partial synchronization can cause build failures if changes span across projects.
For example, specify frameworks/base or AOSPA/android_frameworks_base:
repo sync PROJECTThe bundled builder script ./rom-build.sh automates all build steps for a target device.
Provide the target device codename as the argument (for example, phone2 for Nothing Phone (2)).
Navigate to your workspace root and execute the build script:
cd WORKSPACE
./rom-build.sh DEVICEParanoid Android is open source and accepts patches from contributors. Track patch review status on Gerrit Code Review.
Navigate to your workspace root:
cd WORKSPACECreate a topic branch for the project you want to modify. Identify the project by repository name or local directory path:
| Identify by | Command |
|---|---|
| Repository name | repo start BRANCH AOSPA/PROJECT |
| Directory path | repo start BRANCH PROJECT_DIR |
For example, start a branch for frameworks/base (AOSPA/android_frameworks_base):
repo start BRANCH frameworks/baseNavigate to the project directory:
cd PROJECT_DIRMake your code changes, then stage and commit them:
git add -A
git commit -a -sUpload your changes to Gerrit for review:
cd WORKSPACE
repo upload PROJECT_DIRNavigate to the project directory:
cd PROJECT_DIRMake your code changes, then stage and commit them:
git add -A
git commit -a -sPush the commit directly to Gerrit.
Replace USERNAME with your Gerrit username and PROJECT with the repository name.
git push ssh://USERNAME@gerrit-ssh.aospa.co:29418/AOSPA/PROJECT HEAD:refs/for/calciteAppend a suffix to the refspec to configure review options. You can also toggle these options in the Gerrit web interface.
| Suffix | Effect |
|---|---|
%private |
Upload a change as private |
%wip |
Upload a change as work-in-progress |
%remove-private |
Remove the private status from a change |
%ready |
Mark a work-in-progress change as ready for review |
For example, upload a change as private:
git push ssh://USERNAME@gerrit-ssh.aospa.co:29418/AOSPA/PROJECT HEAD:refs/for/calcite%privateTo update an existing patch set, make your changes and amend the previous commit.
Caution
Do not run repo start again.
Running repo start creates a new topic branch instead of updating the existing review.
git commit -a --amendWhen you upload the amended commit, Gerrit attaches it as a new patch set to the existing review.
Each submitted patch must be a single commit. Squash multiple commits before you upload:
git rebase -i HEAD~<commit-count>Write clear and descriptive commit messages.
- Use the imperative mood in the subject line (for example, "Fix audio routing", not "Fixed audio routing").
- Keep the subject line near 50 characters and under 72 characters.
- Capitalize the first word of the subject line and omit trailing periods.
- Prefix the subject with the relevant project or component name when appropriate (for example,
manifest: Update default branch). - Separate the subject line from the message body with a blank line.
- Wrap message body text at 72 characters.
Submit translations for Paranoid Android through Crowdin. Access the translation portal at https://crowdin.aospa.co.
The codebase uses the Apache License, Version 2.0 unless otherwise specified. Retain all copyright and license notices when you use or modify the source code. State any modifications you make to the code. Read the full license text at https://www.apache.org/licenses/LICENSE-2.0.
Unless otherwise specified, all project assets (including images and branding) use the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license. You may share and adapt these assets for non-commercial purposes. You must provide attribution to the original author (Paranoid Android Project or AOSPA). Include a reference to the license, note any modifications, and link to https://aospa.co. Read the full license text at https://creativecommons.org/licenses/by-nc/4.0/.