[GUIDE] Building Chromium for Snapdragon devices - General Topics

Due to the apparent lack in proper documentation on building the Snapdragon browser CAF (Code Aurora Forums) has developed, I've decided to take it upon myself to try and build it. You can find out more about it on the Code Aurora Forums Wiki. This guide only builds for m46. To build for m42, repeat the process but with the .gclient configuration provided on the CAF Wiki.
Requirements:
- At least 50GB of free space (to be safe)
- A stable Internet connection (fast one preferred)
- Ubuntu 14.04 x64 ISO
1. First, you'll need to install Ubuntu 14.04 (64-bit) on your system. You can grab the ISO image on Ubuntu's website.
2. When Ubuntu boots, connect to the Internet and open the Terminal. Run the following commands:
Code:
sudo apt-get install git-core
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH":~/depot_tools
* - Note: If you are doing it on a daily machine you may cd into another directory for your convenience, and change '~/depot_tools' to where depot_tools is installed.
* - If you wish too you can add the export line to your ~/.bashrc for convenience too.
3. Create a file called .gclient and enter the following into the text editor:
Code:
solutions = [
{ "name" : "src",
"url" : "git://codeaurora.org/quic/chrome4sdp/chromium/[email protected]/remotes/origin/m46",
"deps_file" : "DEPS",
"managed" : True,
"safesync_url": "",
},
]
target_os = ["android"]
* - You can always type 'nano .gclient' into the terminal to launch possibly the world's best text editor, just type CTRL + X, Y, then ENTER when you're done to save.
4. Now here comes the part which will take up a load of disk space (and Internet bandwidth). First run the following command:
Code:
gclient sync -n --no-nag-max
This will download the Android build dependencies and sources.
* - Make sure you do not disconnect from the Internet in the process.
* - You may see nothing change for a long time, just let the process run.
* - This personally took me 12 hours to finish due to my slow Internet connection.
(Optional) Then open src/build/install-build-deps-android.sh and remove the following lines:
Code:
DownloadFromBucket() {
bin=$1
path=$2
gs_url=$3
known_hash=$4
tmpfile=${bin}_$(/bin/date +%s)
if [ ! -x ${path}/${bin} ]; then
/b/build/scripts/slave/gsutil cp ${gs_url} ${tmpfile}
md5=$(md5sum ${tmpfile} | cut -d' ' -f 1)
if [[ $known_hash == $md5 ]]; then
/usr/bin/sudo /bin/mv ${tmpfile} ${path}/${bin}
/usr/bin/sudo /bin/chmod a+x ${path}/${bin}
/usr/bin/sudo /bin/chown root:root ${path}/${bin}
else
echo 'ERROR: Bad md5sum. Not installing' ${bin}
exit 1
fi
fi
}
DownloadFromBucket apktool /usr/local/bin \
'gs://chromium-apktool-bucket/apktool_1_5_2/apktool' \
89d099df9f8b12c043dc74f6f1368f36
DownloadFromBucket apktool.jar /usr/local/bin \
'gs://chromium-apktool-bucket/apktool_1_5_2/apktool.jar' \
2d616934a8eaa37c4501868f05c62871
* - These lines were supposed to be removed but CAF did not update their sources.
* - They are near the bottom of the file.
Afterwards, run the command:
Code:
cd src
. build/install-build-deps-android.sh
5. When all the dependencies are done installing, enter the following commands to build:
Code:
GYP_DEFINES="$GYP_DEFINES clang=0 OS=android" gclient runhooks -v
ninja -C out/Release swe_browser_apk
Have fun! Let me know in the comments below if there are any problems and I'll try my best to reply.
Credits:
hisname - for troubleshooting
enricoros.com - for providing the m46 .gclient file
Screenshots in attachments below. (m42 and m46)

Waiting for the APK.. Will love to try this out.
Sent from my Nexus 6 using Tapatalk

suku_patel_22 said:
Waiting for the APK.. Will love to try this out.
Sent from my Nexus 6 using Tapatalk
Click to expand...
Click to collapse
APK is up!

This thing is fast. Sunspider scores on my N6 are
Chrome stable : 1131
Snappy Chromium : 607
Sent from my Nexus 6 using Tapatalk

this is malicious :|

tornido067 said:
this is malicious :|
Click to expand...
Click to collapse
Malicious?
Sent from my Nexus 6 using Tapatalk

Started to build couple weeks back from m46 branch and never needed to deleted the lines you are deleting / never run the build deeps. Don't get it why you need to run this and over mine don't need.

Chaosdroid is building m46 already using Jenkins: http://chaosdroid.com/jenkins/job/chrome4sdp-beta/

kurtextrem said:
Chaosdroid is building m46 already using Jenkins: http://chaosdroid.com/jenkins/job/chrome4sdp-beta/
Click to expand...
Click to collapse
I'll put that in the OP, thanks!

Nitpicking a bit here, but you can't edit install-build-deps-android.sh until you gclient sync because you have nothing to alter also you have to cd src before building. Maybe this will clear things up for some noobs.

And don't forget you need also play services before runhooks

G4 Man2 said:
Nitpicking a bit here, but you can't edit install-build-deps-android.sh until you gclient sync because you have nothing to alter also you have to cd src before building. Maybe this will clear things up for some noobs.
Click to expand...
Click to collapse
Edited OP, thanks!

danieldmm said:
And don't forget you need also play services before runhooks
Click to expand...
Click to collapse
install-build-deps-android.sh should install that. It did that for me.

Just installed it from XDA Labs.
Question: how can I login to my Google account and get sync?

EMK2000 said:
Just installed it from XDA Labs.
Question: how can I login to my Google account and get sync?
Click to expand...
Click to collapse
The official version of SWE from the CAF repository has removed Google account sign-in. You'll need to go to accounts.google.com and sign-in again.
I didn't add it because I wanted the build to be completely original and synced with the CAF repo. If you want Google sign-in I believe you can try JSwarts's browser, it's also on XDA Labs.

Hey been using the browser for a couple days but i run into a problem where if the browser sits idle for a bit and I go to use it, I cant click the address bar and type so I end up having to kill the app to get it to work again. I'm on nexus 6 btw

gatorz77 said:
Hey been using the browser for a couple days but i run into a problem where if the browser sits idle for a bit and I go to use it, I cant click the address bar and type so I end up having to kill the app to get it to work again. I'm on nexus 6 btw
Click to expand...
Click to collapse
I don't get that problem though, is there a specific website that experiences this problem?

BachMinuetInG said:
I don't get that problem though, is there a specific website that experiences this problem?
Click to expand...
Click to collapse
No just through regular use of the browser.

gatorz77 said:
No just through regular use of the browser.
Click to expand...
Click to collapse
Unfortunately I can't recreate the problem... Maybe you'll want to contact CAF about this?

how do I compile chaos' build? I'm a newbee

Related

Android SDK source code

I wish to have the source code of Android SDK to get a better idea of how certain features/aspects work especially the ones that are not well documented . i really dont wish to get into all the trouble of setting up a CVS especially after looking at the steps here (http://source.android.com/download).
So anyone kind enough willing to send me a zipped one ? i want it the latest 1.5 SDK.
Thanks in advance for helping me out.
gonna have to be the one that tells you this, and i mean no disrespect by what i say
if you are too lazy to set something up in order to do something then you probably shouldn't be doing it. people are willing to help you get it set up, but you are gonna have to do it yourself unless you find some extremely kind soul to get it for you. personally i would like to recompile the cource code for cupcake to make my own build(include my favorite apps) but i don't feel like setting it up so i know i am SOL
No one will help you until you can learn to help yourself. We're not here to do your work for you. You can google just as well as we can. So get up and get it for yourself.
If you just want to download a couple of files, or you only want to be looking at files, you can do it easily without installing git on your computer by using the gitweb interface:
http://android.git.kernel.org/
Do you have eyes? Can you read?
Installing Repo
Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, see Using Repo and Git.
To install, initialize, and configure Repo, follow these steps:
1. Make sure you have a ~/bin directory in your home directory, and check to be sure that this bin directory is in your path:
$ cd ~
$ mkdir bin
$ echo $PATH
2. Download the repo script and make sure it is executable:
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo
Initializing a Repo client
1. Create an empty directory to hold your working files:
$ mkdir mydroid
$ cd mydroid
2. Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:
$ repo init -u git://android.git.kernel.org/platform/manifest.git
* If you would like to check out a branch other than "master", specify it with -b, like:
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
3. When prompted, configure Repo with your real name and email address. If you plan to submit code, use an email address that is associated with a Google account.
A successful initialization will end with a message such as
repo initialized in /mydroid
Your client directory should now contain a .repo directory where files such as the manifest will be kept.
What will my name and email be used for?
To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account (which does not have to be a Gmail address). Make sure this is a live address at which you can receive messages. The real name that you provide here will show up in attributions for your code submissions.
What is a manifest file?
The Android source files are divided among a number of different repositories. A manifest file contains a mapping of where the files from these repositories will be placed within your working directory when you synchronize your files.
Getting the files
To pull down files to your working directory from the repositories as specified in the default manifest, run
$ repo sync
For more about repo sync and other Repo commands, see Using Repo and Git.
The Android source files will be located in your working directory under their project names.
Click to expand...
Click to collapse
Condensed. Type the following:
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir mydroid
$ cd mydroid
$ repo init -u git://android.git.kernel.org/platform/manifest.git
$ repo sync
Click to expand...
Click to collapse
Now exactly how hard is it to do that?
hanged_man said:
I wish to have the source code of Android SDK to get a better idea of how certain features/aspects work especially the ones that are not well documented . i really dont wish to get into all the trouble of setting up a CVS especially after looking at the steps here (http://source.android.com/download).
So anyone kind enough willing to send me a zipped one ? i want it the latest 1.5 SDK.
Thanks in advance for helping me out.
Click to expand...
Click to collapse
@jashsu
Thanks, ive used the git browser a lot but i wish to have the source in my IDE for quicker and easier navigation.
@everyone who replied to me
All of you has misunderstood me, im not being lazy or anything, it's just that google has provided steps for linux and mac users and im a windows user.
Im not asking for anyone to do it for me, i should have been clear in my request, does anyone have it ? im pretty sure that lots of developers has done it before and willing to aid me on this one. Come on people, i expected you to be a bit more welcoming than this.
On windows you have a couple of options. You could just setup a linux VM and follow the process above quite easily. That is what I do. You can even copy the sources back to your windows host if you prefer that. Or you can give it a try by installing cygwin on windows. You might be able to at least checkout the sources. I haven't tried the cygwin setup so I can't be 100% sure if it works.
... OR, you can quit being a ***** and install a proper OS. Or at least install GIT, which comes with BASH and can run the script in exactly the same manner.
lbcoder said:
... OR, you can quit being a ***** and install a proper OS. Or at least install GIT, which comes with BASH and can run the script in exactly the same manner.
Click to expand...
Click to collapse
lol true that
lbcoder said:
... OR, you can quit being a ***** and install a proper OS. Or at least install GIT, which comes with BASH and can run the script in exactly the same manner.
Click to expand...
Click to collapse
ohhh you got me there. Your imaginary girlfriend is probably proud of you after beating me with that genius phrase.
Now people, installing linux on my machine or running it on a vm then following all these instructions and using these tools is a long tedious process that will take lot of time, it's just a source code for god's sake and not launching a spaceship, i was hoping for a gentleman to help me on this (who already has the source the code checked out) and willing to send it to me. that's all.
Thanks everyone for your time.
here's what i see, you joined this forum in hopes of just getting spoonfed, we don't like to spoon feed. setting up a VM takes about an hour including install time of the OS on the VM and setting up linux on your machine takes about 45 minutes. linux is a much better operating system ESPECIALLY if you want to develop for android because android is UNIX based and uses UNIX commands. it's not that hard to get the source code yourself, hell you could even just get a linux live cd and use that to get the source code, then just copy it to your windows drive.
this thread needs to be locked because this person is disrespecting everyone on these forums by asking us to do the work for him.
All you need is Git, no new os or anything. There is a Git client for Windows. Download that, then:
open command prompt.
cd to whereever you want to download the data to
git clone git://android.git.kernel.org + project path.
Sit back and wait.
zer0day said:
All you need is Git, no new os or anything. There is a Git client for Windows. Download that, then:
open command prompt.
cd to whereever you want to download the data to
git clone git://android.git.kernel.org + project path.
Sit back and wait.
Click to expand...
Click to collapse
Yup 0day is right.
By the way, while I would agree that Linux is the best platform to work on Android, I think overly antagonistic comments like "... OR, you can quit being a ***** and install a proper OS." do more harm than benefit for the FOSS movement. Just my $0.02

[DEV GUIDE] Build CM7 from source in its current state. Updated: 2011/05/16-23:52

PLEASE READ THIS BEFORE CONTINUING:
We are changing to a new build system which will result in an updated but VERY different ROM underneath the hood. There is a HIGH POSSIBILITY that building in the current state could BRICK your device, potentially PERMANENTLY. PLEASE DO NOT FLASH unless you are HIGHLY confident you know what you're doing.
For kernel building, see post #2.
For known issues and changelog, see post #3.
Kanged from the CM-Wiki. Yes it's a wiki, yes I could have created an epic page, but we aren't official yet.
Install ADB
Install the Android SDK.
Install the Build Packages
Install using the package manager of your choice:
For 32-bit & 64-bit systems:
Code:
git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
For 64-bit only systems:
Code:
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
NOTE: On Ubuntu 10.10, and variants, you need to enable the parter repository to install sun-java6-jdk:
Code:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Create the Directories
You will need to set up some directories in your build environment.
To create them:
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
Install the Repository
Enter the following to download make executable the "repo" binary:
Code:
curl http://android.git.kernel.org/repo > ~/bin/repo
chmod a+x ~/bin/repo
NOTE: You may need to reboot for these changes to take effect.
Now enter the following to initialize the repository:
Code:
cd ~/android/system/
repo init -u git://github.com/EpicCM/android.git -b teamhacksung-merge
repo sync -j16
Download RomManager and Google Files
NOTE: This only needs to be done when an update to RomManager or GoogleApps is released. If you are up-to-date, you may skip to Building CyanogenMod.
Code:
cd ~/android/system/
./build.sh prepare
Building CyanogenMod
First, check for updates in the source:
Code:
cd ~/android/system/
repo sync
Configure Build & Compile
Now, the environment must be configured to build and the ROM compiled, from code, for the epic.
Code:
cd ~/android/system/
. build/envsetup.sh
./build.sh epic
Build failed? Check post #3 for common problems and solutions.
Install
1. The build system should create a flashable zipfile. Place it on the root of your sdcard.
Optional: Download Google Apps for CyanogenMod 7 and place it on the root of the SD card.
2. Boot into a custom recovery like ClockworkMod Recovery and flash the CM7 update.zip. Then flash google apps if you like.
Please don't flash yet, unless you want an expensive doorstop.
This section of the guide will inform you on how to build a CM7-compatible kernel using our github sources.
Download the Code
Due to the way the new build system works, you'll need the entire CM source to build a proper kernel. (Sorry)
Follow the steps in post #1 to initialize and download our entire CM source repository.
Keeping your code up-to-date:
Code:
cd ~/android/system
repo sync
Toolchain setup
The new build system automatically utilizes the toolchain included in CM7 source.
Prepare to build
The kernel build script requires a few environment vars be set by the CM build system.
Code:
cd ~/android/system/
. build/envsetup.sh
lunch cyanogen_epic-eng
Compile the kernel
Code:
cd ~/android/system/kernel/samsung/2.6.35/
./build.sh epic
cd ~/android/system/releasetools/
./kernel.sh epic
You should now have a flashable zip in out/target/product/epic/
Please don't flash yet, unless you want an expensive doorstop.
This is also incompatible with stock roms, and unless you're amazing, never will be compatible.
KNOWN BUILD-TIME ISSUES
WARNING: These fixes may cause your repo to become out-of-sync from the official repo. Make sure you know how to revert these changes so repo sync doesn't fail.
Error: New build does not boot.
Fix: Working on it
KNOWN RUN-TIME ISSUES
Will update this when it runs.
GUIDE CHANGELOG:
20110516-2352: New build system from teamhacksung.
20110506-1842: Switched to our forks of teamhacksung work.
CODE CHANGELOG:
Available at each of our repositories:
https://github.com/EpicCM
Love seeing these types of posts; makes a pathway for new developers to learn =)
XtaC318 said:
Love seeing these types of posts; makes a pathway for new developers to learn =)
Click to expand...
Click to collapse
I agree! Time to start playing!
Cool guide, makes it easy for the new guys.
Sent from my SPH-D700 using Tapatalk
getting same error. edited make file and tried to remove the samsung/device/crespo device.mk overlap but still a no-go
Code:
build/core/base_rules.mk:479: warning: overriding commands for target `out/target/product/epic/recovery/root/sbin/tune2fs'
bootable/recovery/Android.mk:87: warning: ignoring old commands for target `out/target/product/epic/recovery/root/sbin/tune2fs'
build/core/base_rules.mk:162: *** device/samsung/epic/libs3cjpeg: MODULE.TARGET.SHARED_LIBRARIES.libs3cjpeg already defined by device/samsung/crespo/libs3cjpeg. Stop.
smeyerhuky said:
getting same error. edited make file and tried to remove the samsung/device/crespo device.mk overlap but still a no-go
Code:
build/core/base_rules.mk:479: warning: overriding commands for target `out/target/product/epic/recovery/root/sbin/tune2fs'
bootable/recovery/Android.mk:87: warning: ignoring old commands for target `out/target/product/epic/recovery/root/sbin/tune2fs'
build/core/base_rules.mk:162: *** device/samsung/epic/libs3cjpeg: MODULE.TARGET.SHARED_LIBRARIES.libs3cjpeg already defined by device/samsung/crespo/libs3cjpeg. Stop.
Click to expand...
Click to collapse
yes, that's something that we can't easily fix in our own device repo. you could always remove the crespo folder as a temporary fix, but we need to push a patch upstream that fixes crespo makefiles. I will be adding this to known issues shortly.
So my windows seven crashed on me and I'm gonna go with Ubuntu 10.10 for now
I can play with this on that Linux install, correct?
sent by an Epic4g through the cosmos
raiderep said:
So my windows seven crashed on me and I'm gonna go with Ubuntu 10.10 for now
I can play with this on that Linux install, correct?
Click to expand...
Click to collapse
Yes, it's mentioned in the instructions.
Alternatively, you can use VMWare to do compiling from Windows. That's how I'd set up my old development system. There are tons of free Ubuntu 10.10 vm images.
Updated. Sorry for the mistake in Copy Proprietary Files. That should fix a compile error related to libcamera.
Any clue what causes a build to fail due to unable to dopen system/lib/egl/libandroid_servers.so. When I build with boardconfig has generic audio I'm fine, when I set has galaxys audio it fails
Sent from my SPH-D700 using Tapatalk
dreamsforgotten said:
Any clue what causes a build to fail due to unable to dopen system/lib/egl/libandroid_servers.so. When I build with boardconfig has generic audio I'm fine, when I set has galaxys audio it fails
Sent from my SPH-D700 using Tapatalk
Click to expand...
Click to collapse
Audio in and out works if you leave it at default values.
If you absolutely want to compile with galaxys audio, it looks like ./extract-files.sh might not be pulling that file? Check ~/android/system/vendor/samsung/epic/proprietary/lib/egl/ for that file.
Thanks for the heads up, no the fileisn't in egl and from what I can tell its not supposed to be.
Sent from my SPH-D700 using Tapatalk
Fix: Open up Context.java, find the three chunks of WimaxManager JAVADOC in comments. Delete JUST the commented stuff that's related to WiMax.
Click to expand...
Click to collapse
Can anyone please elaborate, I don't understand wat exactly to be done. Even though I deleted commented lines I still receive errors
Thanks
THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!
So for kernel compilation I received and error
fs/binfmt_aout.c: In function 'load_aout_binary':
fs/binfmt_aout.c:271: error: 'SEGMENT_SIZE' undeclared (first use in this function)
Click to expand...
Click to collapse
And I had to update a line in Makefile
from
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
Click to expand...
Click to collapse
to
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) -Dlinux
Click to expand...
Click to collapse
Still nearly at the end of compile I receive
samsung-kernel-epic/scripts/mksysmap: line 44: arm-none-eabi-nm: No such file or directory
Click to expand...
Click to collapse
I'll see if I can cream system.map from vmlinux and report again
The kernel compilation issue was discussed here: http://forum.xda-developers.com/showthread.php?t=825611
I needed to do
make update-api
Click to expand...
Click to collapse
After removing those comments
it went ahead now the next place I'm stuck is
CameraService.cpp:1478: error: undefined reference to 'openCameraHardware'
Click to expand...
Click to collapse
Any ideas?
Thanks
\m/ I got cm7 compiled
So here are nullghosts instructions:
open android/system/device/samsung/epic/full_epic.mk for editing and
replace any instance of SPH-D700 to epic
Click to expand...
Click to collapse
Then open extract-files.sh for editing and make sure Copy Files (from mid to bottom) list is same as files list (at top)
add these 2 lines to
FILES="
Click to expand...
Click to collapse
section of extract-files.sh
bin/netcfg
lib/libQmageDecoder
Click to expand...
Click to collapse
If you have any other file missing read below:
head -197 extract-files.sh > files may come in handy to compare 2 files
vendor/samsung/__DEVICE__/proprietary/bin/netcfg:system/bin/netcfg
vendor/samsung/__DEVICE__/proprietary/lib/libQmageDecoder.so:system/lib/libQmageDecoder.so
Click to expand...
Click to collapse
are the 2 lines in copy files which did not have corresponding files
Now need to zip it and see if I can get kernel compiled
Can anyone that has it compiled post a zip? I dont wanna download lile 10gb of stuff.
Sent from my SPH-D700 using XDA App

[DEV][WIP] Wanna learn to dev correctly?

Recently there has been some issues with people thinking they are developing when they are not. Now this isn't here to call out anyone. I am here for one simple reason. To teach people how to develop on android correctly. This is an initial post to stir up some interest.
Simply I wanted to try and setup a google+ webchat with questions or comments. How-tos. This can all be done through a google+ chat. If anyone is interested just hit me up on google+ and watch out for the invites it will be in about 2 weeks.
I will be updating this OP with tons of android tips and tricks I have picked up. Currently finshing the first draft in a few minutes.
Thanks!
============
Installing the android sdk and getting adb working.
NOTE: You will need to install java before this will work correctly.
Code:
wget http://dl.google.com/android/android-sdk_r12-linux_x86.tgz
tar xvf android-sdk_r12-linux_x86.tgz
mkdir $HOME/.sdk
mv android-sdk-linux_x86/ $HOME/.sdk/android-sdk/
echo "
#Android Paths
export PATH='$HOME/.sdk/android-sdk/tools/:$HOME/.sdk/android-sdk/platform-tools/:${PATH}'
#Adb Alias
alias start-adb='sudo $HOME/.sdk/android-sdk/platform-tools/./adb start-server'
alias kill-adb='sudo $HOME/.sdk/android-sdk/platform-tools/./adb kill-server'
" >> ~/.bashrc
rm android-sdk_r12-linux_x86.tgz
Now simply type in your terminal:
Code:
source ~/.bashrc
or restart your terminal session.
then type:
Code:
android
Working with Sense
Installing apktool
Apktool - http://code.google.com/p/android-apktool/
All apktool credits go to the apktool devs, I just use the tool!
NOTE: Install sdk using my sdk install guide in post 1.
Code:
wget http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
wget http://android-apktool.googlecode.com/files/apktool-install-linux-r04-brut1.tar.bz2
tar -jxvf apktool-install-linux-r04-brut1.tar.bz2
tar -jxvf apktool1.4.1.tar.bz2
mv apktool $HOME/.sdk/android-sdk/platform-tools
mv aapt $HOME/.sdk/android-sdk/platform-tools
mv apktool.jar $HOME/.sdk/android-sdk/platform-tools
rm apktool-install-linux-r04-brut1.tar.bz2
rm apktool1.4.1.tar.bz2
Now if your sdk is setup like mine and you placed it in this folding after following my sdk guide. apktool should now be installed on your system.
Using the apktool (quick overview)
You can simply do the "apktool if" to your framework resources. This is sense below.
Code:
apktool if framework-res.apk
apktool if com.htc.resources.apk
then decompile:
Code:
apktool d framework-res.apk
compile:
Code:
apktool b framework-res
batch decompile:
Code:
for x in $(ls |grep '.apk' |sort); do apktool d $x; echo Decompiled $x; done
batch compile:
Code:
for x in $(ls |grep -v '.apk' |sort); do apktool d $x; echo Compiled $x; done
Languages to look for when removing system languages from apks:
Code:
values-ar values-ar-rEG values-ar-rIL values-bg values-bg-rBG values-br values-ca-rES values-cs values-cs-rCZ values-da values-da-rDK values-de values-de-rAT values-de-rCH values-de-rDE values-de-rLI values-el values-el-rGR values-en-rAU values-en-rCA values-en-rGB values-en-rIE values-en-rIN values-en-rNZ values-en-rSG values-en-rUS values-en-rZA values-es values-es-rES values-es-rUS values-fi values-fi-rFI values-fr values-fr-rBE values-fr-rCA values-fr-rCH values-fr-rFR values-he-rIL values-hi-rIN values-hr values-hr-rHR values-hu values-hu-rHU values-id-rID values-it values-it-rCH values-it-rIT values-ja values-ja-rJP values-ko values-ko-rKR values-lt-rLT values-lv-rLV values-mcc204 values-mcc204-cs values-mcc204-da values-mcc204-de values-mcc204-el values-mcc204-es values-mcc204-es-rUS values-mcc204-fr values-mcc204-it values-mcc204-ja values-mcc204-ko values-mcc204-nl values-mcc204-pl values-mcc204-pt values-mcc204-pt-rPT values-mcc204-ru values-mcc204-sv values-mcc204-tr values-mcc204-zh-rCN values-mcc204-zh-rTW values-mcc230 values-mcc230-cs values-mcc230-da values-mcc230-de values-mcc230-el values-mcc230-es values-mcc230-es-rUS values-mcc230-fr values-mcc230-it values-mcc230-ja values-mcc230-ko values-mcc230-nl values-mcc230-pl values-mcc230-pt values-mcc230-pt-rPT values-mcc230-ru values-mcc230-sv values-mcc230-tr values-mcc230-zh-rCN values-mcc230-zh-rTW values-mcc232 values-mcc232-cs values-mcc232-da values-mcc232-de values-mcc232-el values-mcc232-es values-mcc232-es-rUS values-mcc232-fr values-mcc232-it values-mcc232-ja values-mcc232-ko values-mcc232-nl values-mcc232-pl values-mcc232-pt values-mcc232-pt-rPT values-mcc232-ru values-mcc232-sv values-mcc232-tr values-mcc232-zh-rCN values-mcc232-zh-rTW values-mcc234 values-mcc234-cs values-mcc234-da values-mcc234-de values-mcc234-el values-mcc234-es values-mcc234-es-rUS values-mcc234-fr values-mcc234-it values-mcc234-ja values-mcc234-ko values-mcc234-nl values-mcc234-pl values-mcc234-pt values-mcc234-pt-rPT values-mcc234-ru values-mcc234-sv values-mcc234-tr values-mcc234-zh-rCN values-mcc234-zh-rTW values-mcc260 values-mcc260-cs values-mcc260-da values-mcc260-de values-mcc260-el values-mcc260-es values-mcc260-es-rUS values-mcc260-fr values-mcc260-it values-mcc260-ja values-mcc260-ko values-mcc260-nl values-mcc260-pl values-mcc260-pt values-mcc260-pt-rPT values-mcc260-ru values-mcc260-sv values-mcc260-tr values-mcc260-zh-rCN values-mcc260-zh-rTW values-mcc262 values-mcc262-cs values-mcc262-da values-mcc262-de values-mcc262-el values-mcc262-es values-mcc262-es-rUS values-mcc262-fr values-mcc262-it values-mcc262-ja values-mcc262-ko values-mcc262-nl values-mcc262-pl values-mcc262-pt values-mcc262-pt-rPT values-mcc262-ru values-mcc262-sv values-mcc262-tr values-mcc262-zh-rCN values-mcc262-zh-rTW values-nb values-nb-rNO values-nl values-nl-rBE values-nl-rNL values-pl values-pl-rPL values-pt values-pt-rBR values-pt-rPT values-ro values-ro-rRO values-ru values-ru-rRU values-sk values-sk-rSK values-sl values-sl-rSI values-sr values-sr-rRS values-sv values-sv-rSE values-th values-th-rTH values-tl-rPH values-tr values-tr-rTR values-uk-rUA values-vi values-vi-rVN values-zh-rCN values-zh-rHK values-zh-rTW values-zh-rTW-hdpi values-cs-nokeys values-da-nokeys values-de-nokeys values-el-nokeys values-es-nokeys values-es-rUS-nokeys values-fr-nokeys values-it-nokeys values-ja-nokeys values-ko-nokeys values-nb-nokeys values-nl-nokeys values-pl-nokeys values-pt-nokeys values-pt-rPT-nokeys values-ru-nokeys values-sv-nokeys values-tr-nokeys values-zh-rCN-nokeys values-zh-rTW-nokeys values-lt values-ca values-uk values-lv values-tl values-in values-iw values-ms values-no values-rm values-fa values-sw values-zh-rMO values-mcc262-sk values-mcc262-tl values-mcc234-hr values-mcc234-hu values-mcc262-fi values-mcc234-tl values-mcc234-sr values-mcc234-lv values-mcc262-lv values-mcc234-bg values-mcc234-en-rGB values-mcc234-sl values-mcc262-nb values-mcc234-uk values-mcc262-en-rGB values-mcc262-vi values-mcc234-nb values-mcc262-uk values-mcc262-lt values-mcc262-sr values-mcc262-ar values-mcc262-bg values-mcc234-sk values-mcc262-ca values-mcc262-ro values-mcc234-vi values-mcc262-th values-mcc234-ar values-mcc234-ca values-mcc262-hu values-mcc234-fi values-mcc234-lt values-mcc262-hr values-mcc262-sl values-mcc234-th values-mcc234-ro values-mcc206-de values-mcc228-de values-mcc262-fa values-mcc295-de values-mcc262-rm values-mcc270-de values-mcc262-in values-mcc262-iw values-zh-rHK-land-hdpi values-zh-rCN-land-hdpi values-zh-rHK-hdpi values-zh-rTW-land-hdpi values-mcc214 values-mcc311 values-mcc310 values-mcc466 values-mcc310-mnc220 values-mcc310-mnc200 values-mcc310-mnc270 values-mcc890-mnc126 values-mcc214-mnc1 values-mcc310-mnc800 values-mcc234-mnc15-gb values-mcc310-mnc490 values-mcc204-mnc4 values-mcc310-mnc260 values-mcc250-mnc1 values-mcc204-mnc4-nl values-mcc214-mnc1-es values-mcc310-mnc230 values-mcc310-mnc26 values-mcc310-mnc210 values-mcc310-mnc330 values-mcc234-mnc15 values-mcc310-mnc170 values-mcc310-mnc280 values-mcc310-mnc290 values-mcc310-mnc660 values-mcc310-mnc160 values-mcc262-mnc2-de values-mcc310-mnc240 values-mcc310-mnc580 values-mcc310-mnc310 values-mcc310-mnc250 values-mcc262-mnc2 values-en-rSA values-mcc238-mnc6 values-mcc235-mnc94 values-mcc505-mnc6 values-mcc240-mnc2 values-mcc505-mnc3 values-zh-rCN-hdpi values-mcc234-mnc20 values-mcc272-mnc5 values-mcc232-mnc10 values-en-rUA values-en-rRU values-en-rUA-hdpi values-en-rRU-hdpi values-es-rMX values-zh-rCN-normal-port values-zh-rCN-normal-land values-ur values-ja-rEN values-et values-is values-nn values-tr-800x480 values-zz-rZZ values-mcc466-zz-rZZ values-mcc230-zz-rZZ values-mcc234-zz-rZZ values-mcc214-zz-rZZ values-mcc204-zz-rZZ values-mcc232-zz-rZZ values-mcc262-zz-rZZ values-mcc260-zz-rZZ values-en values-zh-rTW-finger values-de-keysexposed values-ru-keysexposed values-ja-finger values-zh-rTW-keyshidden values-de-keyshidden values-fr-keyshidden values-it-keysexposed values-ru-finger values-ja-keyshidden values-nl-finger values-pl-finger values-fr-finger values-de-finger values-ko-finger values-zh-rCN-keysexposed values-nl-keyshidden values-es-keyshidden values-ru-keyshidden values-zh-rCN-keyshidden values-cs-keysexposed values-cs-finger values-es-finger values-cs-keyshidden values-fr-keysexposed values-nl-keysexposed values-zh-rTW-keysexposed values-it-keyshidden values-it-finger values-pl-keyshidden values-ja-keysexposed values-pl-keysexposed values-ko-keyshidden values-es-keysexposed values-zh-rCN-finger values-ko-keysexposed values-zh values-he values-es-rCR values-es-rCL values-eu values-es-rSV values-es-rNI values-ln values-es-rAR values-gl values-es-rPY values-es-rBO values-es-rPE values-es-rVE values-hi values-mo
Dsixda Android Kitchen:
Dsixda Android Kitchen - https://github.com/dsixda/Android-Kitchen
Again all credit goes to the developers of this kitchen. I only simply use it!
There are two ways to install this kitchen.
- Download it here and unzip it - https://github.com/dsixda/Android-Kitchen/archives/master
- What I do is sync with his github using git.
Note: Make sure you have git installed.
Code:
sudo apt-get install git-core
Then simply clone there repo where ever you like locally.
Code:
git clone https://github.com/dsixda/Android-Kitchen.git
Note: This method is a way to use the latest code. Use at your own risk might be bugs. Don't report issues for versions not released yet!
Working with AOSP
Compiling SalvageMod
NOTE: Until kernel.org is up. This will not work at all!
Hey there, you are here because you want to be able to compile SalvageMod for your HTC Evo. There is one simple way to do so and its very easy. Here are the current versions of SalvageMod that you can compile.
* SalvageMod1.3 (Stable)
* gingerbread (Development)
Click to expand...
Click to collapse
Please note that the gingerbread branch is the same as our "nightly" or unstable branch. As other releases come available this page will be updated with those branches. Now its time for the fun stuff.
Let's make sure we have all the needed files to compile on [http://www.ubuntu.com Ubuntu 11.04].
Use this repo for java:
Code:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
32 bit install:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush
64 bit users will need:
Code:
sudo apt-get install g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.4-multilib g++-4.4-multilib
Now we create a development directory, it doesn't matter what the name is or where its at. For example I always do:
Code:
mkdir -p ~/Development/SalvageMod
Now you need to install repo:
Code:
sudo bash
curl http://android.git.kernel.org/repo > /usr/bin/repo
chmod a+x /usr/bin/repo
exit
Now go into the directory you just created. This is where we will initate the repo we want to use.
* *Remember those branches from before?*
* SalvageMod1.3 (Stable)
* gingerbread (Development)
Click to expand...
Click to collapse
Now initate the repo you want.
* Development
Code:
repo init -u https://github.com/SalvageMod/salvage.git -b gingerbread
Click to expand...
Click to collapse
* Stable
Code:
repo init -u https://github.com/SalvageMod/salvage.git -b SalvageMod1.3
Click to expand...
Click to collapse
Now sync it.
Code:
repo sync
Now it will do some things, could take a long time depending on your internet connection. Go grab a beer.
Now that it is done compiling there are only a few steps before you are on your way to a compiled SalvageMod rom.
Go into the supersonic(Htc Evo) device tree and run extract-files.sh
Code:
cd device/htc/supersonic
./extract-files.sh
Now you want to go back into the root of the build.
Code:
cd ../../..
Should look something like this:
Code:
[email protected]:~/Development/SalvageMod$ ls
bionic build dalvik device frameworks libcore ndk prebuilt system
bootable cts development external hardware Makefile packages sdk vendor
Once you are here we start to get everything together. Run these commands. Then you will use make to build the rom!
Code:
. build/envsetup.sh
lunch salvage_supersonic-userdebug
time make -j$(grep -ic ^processor /proc/cpuinfo) otapackage
That is about it! After this is completed go into the following folder to get your rom!
Code:
cd out/target/product/supersonic
well this means im getting a google +
Considering that i already follow you on Google+, I would definitely want to check this out Lithid. Thanx in advance man.
Thanks Lithid. We appreciate all you do to help us.
Sent from my supersonic using XDA App
What's your plus lith
Sent from my PC36100 using xda premium
I have been really wanting to start without a clue as to where to begin...can I get a Google+ invite?
Sent from my supersonic using XDA App
Me too
I would love to get in on this. send me a G+ invite - jtwalker1
I will forewarn you, I have not done any coding or programming since I learned in college which was many, many moons ago (think pre WWW days)
Thanks
James
renegade37918 said:
What's your plus lith
Sent from my PC36100 using xda premium
Click to expand...
Click to collapse
Plus is in the sig man.
I know basic linux and would like to learn..
What kind of skills would you consider a prerequisite for this? Would not want to be the slow kid in class slowing everyone else down.
Cool I forgot I was already following you lol
Sent from my PC36100 using XDA App
renegade37918 said:
What's your plus lith
Sent from my PC36100 using xda premium
Click to expand...
Click to collapse
its in his sig
lithid-cm said:
Recently there has been some issues with people thinking they are developing when they are not. Now this isn't here to call out anyone. I am here for one simple reason. To teach people how to develop on android correctly. This is an initial post to stir up some interest.
Simply I wanted to try and setup a google+ webchat with questions or comments. How-tos. This can all be done through a google+ chat. If anyone is interested just hit me up on google+ and watch out for the invites it will be in about 2 weeks.
I will be updating this OP with tons of android tips and tricks I have picked up. Currently finshing the first draft in a few minutes.
Thanks!
Click to expand...
Click to collapse
I'm down man I sent you a request on plus Andres luque
Thanks alot
corynat said:
What kind of skills would you consider a prerequisite for this? Would not want to be the slow kid in class slowing everyone else down.
Click to expand...
Click to collapse
I would say basic linux command line functions. Like changing directories, running scripts, listing files, copy and paste, and removing, and text editing.
lithid-cm said:
I would say basic linux command line functions. Like changing directories, running scripts, listing files, copy and paste, and removing, and text editing.
Click to expand...
Click to collapse
"running out to get basic linux for dummies" brb
This sounds cool but I suck with commands LOL.
Sent from my PC36100 using XDA App
DrDr3z85 said:
"running out to get basic linux for dummies" brb
Click to expand...
Click to collapse
Haha +1 that off to barnes and noble!
Thanks lith this is great and much needed will def hit you up on g+
Sent from my PC36100 using Tapatalk

[Tool]File(1) command for Android (ver 5.11)

After wandering around looking for an android build of the file command, I finally went ahead and compiled it myself.
The attached package contains the file binary (v5.11), the libmagic.so shared library, the associated magic files and the build specific files that I needed (over and above the source) to build it. The paths of the files are relative to '/'.
Refs:
source: file website (www_darwinsys_com/file/)
compiling: Native Vim on Android (gdr_geekhood_net/gdrwpl/vim-android.php)
Note: Add the location of libmagic.so to LD_LIBRARY_PATH to get rid of the "CANNOT LINK EXECUTABLE" error. (I use /data/local/lib)
Compiled a dynamically linked library and associated binary instead of the monolithic binary built earlier.
samveen said:
After wandering around looking for an android build of the file command, I finally went ahead and compiled it myself.
The attached package contains the file binary (v5.11), the libmagic.so shared library, the associated magic files and the build specific files that I needed (over and above the source) to build it. The paths of the files are relative to '/'.
Refs:
source: file website (www_darwinsys_com/file/)
compiling: Native Vim on Android (gdr_geekhood_net/gdrwpl/vim-android.php)
Note: Add the location of libmagic.so to LD_LIBRARY_PATH to get rid of the "CANNOT LINK EXECUTABLE" error. (I use /data/local/lib)
Click to expand...
Click to collapse
I followed your instructions and it works perfectly.
Code:
$ echo $LD_LIBRARY_PATH
/data/local/lib:/data/local/lib:/data/local/lib:/system/lib:/vendor/lib
$ file
Usage: file [-bchikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
[-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...
file -C [-m magicfiles]
file [--help]
$ getprop | grep device
[ro.cm.device]: [jordan]
[ro.product.device]: [umts_jordan]
I have been looking for this for a while. Man!! This post needs some serious attention. Great work.
Sent from my MB525 usiIng XDA
@samveen Any chance you could compile it with libmagic statically linked again to make it portable? Thanks for your time.
osm0sis said:
@samveen Any chance you could compile it with libmagic statically linked again to make it portable? Thanks for your time.
Click to expand...
Click to collapse
@osm0sis Sure. I'll add in a statically linked binary, but it'll take a little time (2-3 days).
samveen said:
@osm0sis Sure. I'll add in a statically linked binary, but it'll take a little time (2-3 days).
Click to expand...
Click to collapse
I was just looking for this. Great tool.
Thanks for your work.
samveen said:
@osm0sis Sure. I'll add in a statically linked binary, but it'll take a little time (2-3 days).
Click to expand...
Click to collapse
Any luck? I think it only needs libmagic statically linked to be portable; the other NDK/Bionic stuff can probably stay dynamic to keep the filesize down. I see file 5.17 source is available now too if you wanted to update your builds to the latest.
osm0sis said:
Any luck? I think it only needs libmagic statically linked to be portable; the other NDK/Bionic stuff can probably stay dynamic to keep the filesize down. I see file 5.17 source is available now too if you wanted to update your builds to the latest.
Click to expand...
Click to collapse
If you want only the system file type, the workaround i use is this (eval $(/sbin/blkid /dev/block/mmcblk0p11 | /sbin/awk ' { print $3 } '); /sbin/busybox echo $TYPE)
In a script just add a var like this
TYPE=$(eval $(/sbin/blkid /dev/block/mmcblk0p11 | /sbin/awk ' { print $3 } '); /sbin/busybox echo $TYPE) and you will have the FS type in $TYPE.
Phone: Samsung Galaxy SII - GT-I9100
Kernel: Dorimanx kernel v10.43v99-mv3
1st ROM : SlimSaber 4.4.2 Maliv3 by fusionjack build of 20140320 (Online)
2nd ROM :
MODEM: UHMS1
MODS: Partition Fix, Hue Blue v4.4 by Kroz :good:
Computoncio said:
If you want only the system file type, the workaround i use is this (eval $(/sbin/blkid /dev/block/mmcblk0p11 | /sbin/awk ' { print $3 } '); /sbin/busybox echo $TYPE)
In a script just add a var like this
TYPE=$(eval $(/sbin/blkid /dev/block/mmcblk0p11 | /sbin/awk ' { print $3 } '); /sbin/busybox echo $TYPE) and you will have the FS type in $TYPE.
Click to expand...
Click to collapse
Interesting but nope; I need file to determine a filetype. Compressed archives via a script, to be specific.
@osm0sis I got the code compiled (both with a dynamic libmagic.so, and libmagic compiled into file) but I need a little more time to compile the magic data (it requires running file on the target device to compile the magic data into a binary datafile). Once I have that figured out (either by compiling it or by creating a script to allow the users to do it themselves, I'll post it all in one go (need one more day).
samveen said:
@osm0sis I got the code compiled (both with a dynamic libmagic.so, and libmagic compiled into file) but I need a little more time to compile the magic data (it requires running file on the target device to compile the magic data into a binary datafile). Once I have that figured out (either by compiling it or by creating a script to allow the users to do it themselves, I'll post it all in one go (need one more day).
Click to expand...
Click to collapse
Awesome! Thanks so much. The magic file isn't terribly important since you can grab one a lot of places and specify it with the -m parameter; keeps the file size down too if you were thinking of including it in the binary somehow!
Alright. I just wanted to thank you again for your work but I managed to make a static native compile (~440kb) of file-5.17 using my N7 and a kbox build environment I set up. It's available in my ARM Android Image Kitchen linked in my sig. Cheers!
osm0sis said:
Alright. I just wanted to thank you again for your work but I managed to make a static native compile (~440kb) of file-5.17 using my N7 and a kbox build environment I set up. It's available in my ARM Android Image Kitchen linked in my sig. Cheers!
Click to expand...
Click to collapse
@osm0sis - Can you please share how did you static compile this? I have setup the Ubuntu 13.10 image on Android using Complete Linux Installer (with all the necessary build tools setup).
I am able to compile this, but it's linking the shared library "libmagic.la".
Need to pass --static to ./configure and have a cross compiler set up, for ARMv7.
ericlnu said:
Need to pass --static to ./configure and have a cross compiler set up, for ARMv7.
Click to expand...
Click to collapse
I don't think that's a valid option.
Code:
$ ./configure --static
configure: error: unrecognized option: `--static'
Try `./configure --help' for more information
amit.bagaria said:
I don't think that's a valid option.
Code:
$ ./configure --static
configure: error: unrecognized option: `--static'
Try `./configure --help' for more information
Click to expand...
Click to collapse
Nope, seems not ^_^. Sorry, it usually is with autoconf derived configure scripts.
amit.bagaria said:
@osm0sis - Can you please share how did you static compile this? I have setup the Ubuntu 13.10 image on Android using Complete Linux Installer (with all the necessary build tools setup).
I am able to compile this, but it's linking the shared library "libmagic.la".
Click to expand...
Click to collapse
Haven't tried it using a full Linux image on Android, just made it native compile in KBox2 on my N7'13 for awhile by editing in the gettext functions it was complaining about, and have since moved on to cross-compiling on my Windows 7 desktop in Cygwin using the NDK. There were still a few tricks to getting it to be a true static compile. It's all linked in my post here:
http://forum.xda-developers.com/showthread.php?p=54510825
My latest compile included in my AIK-mobile package is file 5.20. :good:
I don't suppose you could do a quick compile with the -fPIE flag? Trying to use this on 5.0 + and don't want to patch my linker.
Tried to compile it myself (it sort-of worked, file --version is operational) but when I try to actually use it for something my terminal borks out and switches to some weird font after about 20 warnings. (configure also seems to be using the -rpath flag apparently, linker complains about it) hmm
EDIT: I've got it working after some trial and error. If anyone requests I'll post it
EDIT 2: android 6.0's linker seems less forgiving than 5.0/5.1, need to compile without -rpath (so no just using ./configure) will keep posted
Can you please post the file binary you built with -pie ?

[GUIDE] Building Pure Nexus

Introduction
Hello everyone, this is a guide to get you up and running with your own build of Pure Nexus for the Nexus 5X. In this thread, you will learn how to get your computer set up to build and the commands you will need to run. Please read the entire guide and the FAQ. Additionally, this is a developer's thread, there should be no off topic discussion.
Compilation Guide
This is available on my Github, where it may be a little more up to date.
0. Getting started
In this guide, I will go over how to build Pure Nexus on your Linux machine. This particular tutorial will focus on Ubuntu 16.04 as that is what I use (Mint 18 is also good) but this should work with any version of Linux; it does need to be 64-bit however. I will leave the installation of that up to you, Google is a wonderful resource. If you don't have a good computer but still want to build, check out this thread on XDA: http://forum.xda-developers.com/chef-central/android/guide-how-to-build-rom-google-cloud-t3360430
1. Set up your environment
1. Automatically
Code:
sudo apt-get install git-core
git clone https://github.com/akhilnarang/scripts
cd scripts
ls
bash <script-name>
<script-name> should be one of the scripts in the folder for your particular architecture.
2. Manually
1. Install Java 8
Code:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo apt-get install openjdk-8-jre
2. Install other build tools
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
2. Configure repo and git
If you have any problems with the below commands, try running as root:
Code:
sudo -s
Git is an open source version control system which is incredibly robust for tracking changes across repositories. Repo is Google's tool for working with Git in the context of Android. More reading if you are interested: https://source.android.com/source/developing.html
Run these commands to get repo working (only do this if you did the manual set up method above:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Run these commands to get git working:
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
3. Download the source
First, before downloading the source, create a folder for the source and move into it.
Code:
mkdir ~/<foldername> (eg. mkdir ~/PN or ~/PureNexus)
cd ~/<foldername>
Then, we need to grab the manifest and sync down the repositories. Here are the commands to do this for Pure Nexus for Nougat (make sure you are in the source folder you made above):
Code:
repo init -u https://github.com/PureNexusProject/manifest.git -b n
repo sync --force-sync
Here is the process generally for other ROMs:
When you go to build a ROM, you must download its source. All, if not most, ROMs will have their source code available on Github. To properly download the source, follow these steps:
Go to your ROM's Github (e.g. http://github.com/PureNexusProject)
Search for a manifest (usually called manifest or android_manifest).
Go into the repo and make sure you are in the right branch (located right under the Commits tab).
Go into the README and search for a repo init command. If one exists, copy and paste it into the terminal and hit enter.
If one does not exist, you can make one with this formula:
Code:
repo init -u <url_of_manifest_repo>.git -b <branch_you_want_to_build>
For example:
Code:
repo init -u http://github.com/PureNexusProject/manifest.git -b n
After the repo has been initialized, run this command to download the source:
Code:
repo sync --force-sync
This process can take a while depending on your internet connection.
4. Build it!
At this point, it'd be a good idea to set up ccache. ccache is a compiler cache, it stores previously compiled files in a directory and pulls from that instead of recompiling if nothing has changed. This speeds up compilation a LOT. If you want to use it, follow the below steps:
Open up your .bashrc file in your home directory using a text editor or nano and append this to the end of it:
Code:
export USE_CCACHE=1
Then type:
Code:
source ~/.bashrc
After that, run one of the below command (replacing the # with how many GBs of ccache you want, 50 is recommended)
Use this one if you used the manual method of set up in section 1:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M #G
Use this one if you used the automatic method of set up in section 1:
Code:
ccache -M #G
After that, it's time to build!
Code:
. build/envsetup.sh
breakfast bullhead
mka bacon
After that, your computer will build the flashable zip file and if you see something that says make completed, you've done it!
Any time that you want to rebuild, type the following commands:
Code:
repo sync --force-sync
. build/envsetup.sh
breakfast bullhead
mka clobber
mka bacon
I also have a script to do this on my Github here
Frequently Asked Questions
1.1 Q: I got an error, what do I do??
1.1 A: Well to start, if it is anything with Ninja, I would go ahead and disable it. You can add this to your .bashrc file:
Code:
export USE_NINJA=false
Then type this
Code:
source ~/.bashrc
. build/envsetup.sh
breakfast bullhead
mka clobber
mka bacon
If it is saying you ran out of memory, follow this post.
If it isn't Ninja related, check out @AzraelsKiss's post here, where he has documented a few common issues. If none of those apply, post here with a detailed list of what you have done and we will do our best to help you.
1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!
this wont work on Windows, right?
RonnellTapawan said:
this wont work on Windows, right?
Click to expand...
Click to collapse
I have heard people try to use Bash for Windows but I don't think it will work. Linux or bust.
nathanchance said:
I have heard people try to use Bash for Windows but I don't think it will work. Linux or bust.
Click to expand...
Click to collapse
I tried on bash for windows but it can't build android roms
Dude you should seriously get a XDA medallion or some sort of metal for all you do all over XDA. I see you everywhere. Thanks for building for us and also for this write up. :good: @ nathan
SM210 said:
Dude you should seriously get a XDA medallion or some sort of metal for all you do all over XDA. I see you everywhere. Thanks for building for us and also for this write up. :good: @ nathan
Click to expand...
Click to collapse
Talk to my superiors :silly: thanks for the kind words
Edited.......
Sent from my Nexus 5X using Tapatalk
myawan said:
Anybody wanna share home made build?
Sent from my Nexus 5X using Tapatalk
Click to expand...
Click to collapse
If you read at the end of the OP, it says:
"1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!"
Reason being, because if we start compiling these and handing it out like it's no ones business, we're going to run Pure Nexus into the ground and people will start uploading them on AFH and it'll be one big mess. My guess is, this is just a courtesy by the original poster to those of us who can't wait.
My two cents.:laugh::highfive:
i'm on it!!!!! thank you very much!!! download is taking forever ugh
Building it right now! Thanks
I think this would work in Cygwin. I used to compile stuff for the PS3 way back. I'd have a lot of reading to do if I wanted to build this for my phone.
Which gapps to use with this?
Open Gapps micro are working fine.
Gesendet von meinem Nexus 5X mit Tapatalk
So WE can't share our build either? Or what, i didn't get it.
CreasingMass Dev said:
So WE can't share our build either? Or what, i didn't get it.
Click to expand...
Click to collapse
Don't distribute personal builds. Flash them yourself and that is it.
4 hours of download :crying:
OOH MAN!!!!!! no more space in my device!!! how can i resume that???
Code:
Checking out files: 100% (1717/1717), done.
error: unable to write file current/platforms/android-21/arch-x86_64/usr/lib/libz.a
error: unable to write file current/platforms/android-21/arch-x86_64/usr/lib/libz.so
fatal: cannot create directory at 'current/platforms/android-21/arch-x86_64/usr/lib64': Spazio esaurito sul device
Traceback (most recent call last):
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/subcmds/sync.py", line 769, in Execute
project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/project.py", line 1325, in Sync_LocalHalf
self._InitWorkTree(force_sync=force_sync)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/project.py", line 2482, in _InitWorkTree
raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
can i move the PureNexus folder in an external drive and resume??? please
MatteXperiaU said:
4 hours of download :crying:
OOH MAN!!!!!! no more space in my device!!! how can i resume that???
can i move the PureNexus folder in an external drive and resume??? please
Click to expand...
Click to collapse
You can try. Your build times will be much slower though.
Sent from my Nexus 6P using XDA Labs
nathanchance said:
You can try. Your build times will be much slower though.
Sent from my Nexus 6P using XDA Labs
Click to expand...
Click to collapse
i have another partition in the same HD (300GB).. i can use that :fingers-crossed:
which command i need to resume?
sorry for the questions man, you're too kind
TPMJB said:
I think this would work in Cygwin. I used to compile stuff for the PS3 way back. I'd have a lot of reading to do if I wanted to build this for my phone.
Click to expand...
Click to collapse
No promises...
http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
Out of curiosity, realistically how much disk space would be required to download everything and compile with a 50GB cache? I got everything downloaded and the compile ran but threw some warnings (most of which may have been benign). When the compile terminated with an error, I had about 40MB left on my Linux Mint 18 partition so I assume it ran out of space I started with about 70GB free space
I deleted everything and decided to try again if and when I have a larger partition to play with..... I am currently dual booting on a Windows machine and didn't think to allocate that much space to Mint.
Paul

Categories

Resources