[TUT] Upgrading Java to 1.7.0_17 in Ubuntu 12.04 - Sprint Samsung Galaxy Note II

I found this as I was updating to the latest version of java in Ubuntu 12.04. This isn't a tutorial I made but is one I found. I know there are plenty of linux noobs out there that may find this very useful.
The source of this Tutorial is sited here. I hope this helps some of you guys out. It helped me and I am grateful I found it, so I just wanted to pass my find forward. Hope it helps. :good:
This tutorial will cover the installation of 32-bit and 64-bit Oracle Java 7 (currently version number 1.7.0_17) JDK/JRE on 32-bit and 64-bit Ubuntu operating systems. These instructions will also work on Debian and Linux Mint.
For those who want to install Oracle Java JDK to develop Java programs and applications the Oracle JDK with the Oracle Java JRE included in the Oracle JDK.
Also to enable/upgrade the Oracle Java in your web browsers.
1 Check to see if your Ubuntu Linux operating system architecture is 32-bit or 64-bit, open up a terminal and run the following command below.
Type/Copy/Paste: file /sbin/init
Note the bit version of your Ubuntu Linux operating system architecture it will display whether it is 32-bit or 64-bit.
2 Check if you have Java installed on your system. To do this, you will have to run the Java version command from terminal.
Open up a terminal and enter the following command:
Type/Copy/Paste: java -version
If you have OpenJDK installed on your system it may look like this:
java version "1.6.0_21"
OpenJDK Runtime Environment (IcedTea6 1.10pre) (6b21~pre1-0lucid1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
If you have OpenJDK installed on your system, you have the wrong vendor version of Java installed for this exercise.
3 Completely remove the OpenJDK/JRE from your system and create a directory to hold your Oracle Java JDK/JRE binaries. This will prevent system conflicts and confusion between different vendor versions of Java. For example, if you have the OpenJDK/JRE installed on your system, you can remove it by typing the following at the command line:
Type/Copy/Paste: sudo apt-get purge openjdk-\*
This command will completely remove OpenJDK/JRE from your system
Type/Copy/Paste: sudo mkdir -p /usr/local/java
This command will create a directory to hold your Oracle Java JDK and JRE binaries.
4 Download the Oracle Java JDK/JRE for Linux. Make sure you select the correct compressed binaries for your system architecture 32-bit or 64-bit (which end in tar.gz).
For example, if you are on Ubuntu Linux 32-bit operating system download 32-bit Oracle Java binaries.
For example, if you are on Ubuntu Linux 64-bit operating system download 64-bit Oracle Java binaries.
Optional, Download the Oracle Java JDK/JRE Documentation
Select jdk-7u17-apidocs.zip
Important Information: 64-bit Oracle Java binaries do not work on 32-bit Ubuntu Linux operating systems, you will receive multiple system error messages, if you attempt to install 64-bit Oracle Java on 32-bit Ubuntu Linux.
5 Copy the Oracle Java binaries into the /usr/local/java directory. In most cases, the Oracle Java binaries are downloaded to: /home/"your_user_name"/Downloads.
32-bit Oracle Java on 32-bit Ubuntu Linux installation instructions:
Type/Copy/Paste: cd /home/"your_user_name"/Downloads
Type/Copy/Paste: sudo -s cp -r jdk-7u17-linux-i586.tar.gz /usr/local/java
Type/Copy/Paste: sudo -s cp -r jre-7u17-linux-i586.tar.gz /usr/local/java
Type/Copy/Paste: cd /usr/local/java
64-bit Oracle Java on 64-bit Ubuntu Linux installation instructions:
Type/Copy/Paste: cd /home/"your_user_name"/Downloads
Type/Copy/Paste: sudo -s cp -r jdk-7u17-linux-x64.tar.gz /usr/local/java
Type/Copy/Paste: sudo -s cp -r jre-7u17-linux-x64.tar.gz /usr/local/java
Type/Copy/Paste: cd /usr/local/java
6 Unpack the compressed Java binaries, in the directory /usr/local/java
32-bit Oracle Java on 32-bit Ubuntu Linux installation instructions:
Type/Copy/Paste: sudo -s tar xvzf jdk-7u17-linux-i586.tar.gz
Type/Copy/Paste: sudo -s tar xvzf jre-7u17-linux-i586.tar.gz
64-bit Oracle Java on 64-bit Ubuntu Linux installation instructions:
Type/Copy/Paste: sudo -s tar xvzf jdk-7u17-linux-x64.tar.gz
Type/Copy/Paste: sudo -s tar xvzf jre-7u17-linux-x64.tar.gz
7 Double-check your directories. At this point, you should have two uncompressed binary directories in /usr/local/java for the Java JDK/JRE listed as:
Type/Copy/Paste: ls -a
jdk1.7.0_17
jre1.7.0_17
8 Edit the system PATH file /etc/profile and add the following system variables to your system path. Use nano, gedit or any other text editor, as root, open up /etc/profile.
Type/Copy/Paste: sudo gedit /etc/profile
or
Type/Copy/Paste: sudo nano /etc/profile
9 Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your /etc/profile file:
Type/Copy/Paste:
JAVA_HOME=/usr/local/java/jdk1.7.0_17
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/local/java/jre1.7.0_17
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
10 Save the /etc/profile file and exit.
11 Inform your Ubuntu Linux system where your Oracle Java JDK/JRE is located. This will tell the system that the new Oracle Java version is available for use.
Type/Copy/Paste: sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_17/bin/java" 1
this command notifies the system that Oracle Java JRE is available for use
Type/Copy/Paste: sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0_17/bin/javac" 1
this command notifies the system that Oracle Java JDK is available for use
Type/Copy/Paste: sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jre1.7.0_17/bin/javaws" 1
this command notifies the system that Oracle Java Web start is available for use
12 Inform your Ubuntu Linux system that Oracle Java JDK/JRE must be the default Java.
Type/Copy/Paste: sudo update-alternatives --set java /usr/local/java/jre1.7.0_17/bin/java
this command will set the java runtime environment for the system
Type/Copy/Paste: sudo update-alternatives --set javac /usr/local/java/jdk1.7.0_17/bin/javac
this command will set the javac compiler for the system
Type/Copy/Paste: sudo update-alternatives --set javaws /usr/local/java/jre1.7.0_17/bin/javaws
this command will set Java Web start for the system
13 Reload your system wide PATH /etc/profile by typing the following command:
Type/Copy/Paste: . /etc/profile
Note your system-wide PATH /etc/profile file will reload after reboot of your Ubuntu Linux system
14 Test to see if Oracle Java was installed correctly on your system. Run the following commands and note the version of Java:
15 A successful installation of 32-bit Oracle Java will display:
Type/Copy/Paste: java -version
This command displays the version of java running on your system
You should receive a message which displays:
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b21)
Java HotSpot(TM) Server VM (build 23.1-b03, mixed mode)
Type/Copy/Paste: javac -version
This command lets you know that you are now able to compile Java programs from the terminal.
You should receive a message which displays:
javac 1.7.0_17
16 A successful installation of Oracle Java 64-bit will display:
Type/Copy/Paste: java -version
This command displays the version of java running on your system
You should receive a message which displays:
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
Type/Copy/Paste: javac -version
This command lets you know that you are now able to compile Java programs from the terminal.
You should receive a message which displays:
javac 1.7.0_17
17 Congratulations, you just installed Oracle Java on your Linux system. Now reboot your Ubuntu Linux system. Afterwards, your system will be fully configured for running and developing Java programs. Later on you may want to try compiling and running your own Java programs by following this article How to Create your First Java Program on Ubuntu Linux
EditOptional: How to enable Oracle Java in your Web Browsers
1 To enable your Java plug-in in your web browsers you must make a symbolic link from the web browsers plug-in directory to the location of the Java plug-in included in your distribution of Oracle Java.
Important Note: I would urge caution when enabling Oracle Java 7 in your web browsers, due to the fact there have been many numerous security flaws and exploits. Essentially, by enabling Oracle Java 7 in your web browsers if a security flaw or exploit is discovered this is how the bad guys break in and compromise your system. For more information on security flaws and exploits in Java see the following website: Java Tester
Edit Google Chrome
32-bit Oracle Java instructions:
1 Issue the following commands.
Type/Copy/Paste: sudo -s
this will change you into root
Type/Copy/Paste: mkdir -p /opt/google/chrome/plugins
this will create a directory called /opt/google/chrome/plugins
Type/Paste/Copy: cd /opt/google/chrome/plugins
this will change you into the google chrome plugins directory,make sure you are in this directory before you make the symbolic link
Type/Paste/Copy: ln -s /usr/local/java/jre1.7.0_17/lib/i386/libnpjp2.so
this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Google Chrome web browser
64-bit Oracle Java instructions:
1 Issue the following commands.
Type/Copy/Paste: sudo -s
this will change you into root
Type/Copy/Paste: mkdir -p /opt/google/chrome/plugins
this will create a directory called /opt/google/chrome/plugins
Type/Paste/Copy: cd /opt/google/chrome/plugins
this will change you into the google chrome plugins directory,make sure you are in this directory before you make the symbolic link
Type/Paste/Copy: ln -s /usr/local/java/jre1.7.0_17/lib/amd64/libnpjp2.so
this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Google Chrome web browser
Reminders:
1 Note: Sometimes when you issue the above command you may receive a message which states:
ln: creating symbolic link `./libnpjp2.so': File exists
To correct this issue simply remove the previous symbolic link using the following command:
Type/Copy/Paste: sudo -s
Type/Copy/Paste: cd /opt/google/chrome/plugins
Type/Copy/Paste: rm -rf libnpjp2.so
Make sure you are in the /opt/google/chrome/plugins directory before you issue the command
2 Restart your web browser and go to Java Tester to test if Java is functioning in your web browser.
Edit Mozilla Firefox
32-bit Oracle Java instructions:
1 Issue the following commands.
Type/Paste/Copy: sudo -s
this will change you into root
Type/Paste/Copy: cd /usr/lib/mozilla/plugins
this will change you into the directory /usr/lib/mozilla/plugins, create this directory if you do not have it
Type/Paste/Copy: mkdir -p /usr/lib/mozilla/plugins
this will create the directory /usr/lib/mozilla/plugins, make sure you are in this directory before you make the symbolic link
Type/Paste/Copy: ln -s /usr/local/java/jre1.7.0_17/lib/i386/libnpjp2.so
this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Mozilla Firefox web browser
64-bit Oracle Java instructions:
1 Issue the following commands.
Type/Paste/Copy: sudo -s
this will change you into root
Type/Paste/Copy: cd /usr/lib/mozilla/plugins
this will change you into the directory /usr/lib/mozilla/plugins, create this directory if you do not have it
Type/Paste/Copy: mkdir -p /usr/lib/mozilla/plugins
this will create the directory /usr/lib/mozilla/plugins, make sure you are in this directory before you make the symbolic link
Type/Paste/Copy: ln -s /usr/local/java/jre1.7.0_17/lib/amd64/libnpjp2.so
this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Mozilla Firefox web browser
Reminders:
1 Note: Sometimes when you issue the above command you may receive a message which states:
ln: creating symbolic link `./libnpjp2.so': File exists
To correct this issue simply remove the previous symbolic link using the following command:
Type/Copy/Paste: sudo -s
Type/Copy/Paste: cd /usr/lib/mozilla/plugins
Type/Copy/Paste: rm -rf libnpjp2.so
Make sure you are in the /usr/lib/mozilla/plugins directory before you issue the command
2 Restart your web browser and go to Java Tester to test if Java is functioning in your web browser.
Edit Tips
With Ubuntu Linux, you have the choice of whether to use OpenJDK, which is a free and open-source implementation of the Java programming language, or to use Oracle Java JDK and JRE. Some prefer to use Oracle Java (as it is the most up-to-date version of Java and it comes directly from the maintainers of Java technology), but this varies.
Keep in mind that Oracle makes security upgrades and bug fixes and enhances performance issues for each new release of Oracle Java. When installing Oracle Java on your system, be aware of the version number changes. See How to Upgrade Oracle Java on Ubuntu Linux for more information.
Please note that this document is in continual revision because Oracle sometimes changes the installation method of their Java JDK/JRE binaries.
Click to expand...
Click to collapse

why need java here>???

I asked a mod where it should go before I posted, and this is where I was told to put it.
Sent from my SPH-L900 using Tapatalk 2

icefox913 said:
why need java here>???
Click to expand...
Click to collapse
We use java in development. For those of us who are developers this is VERY useful information. Its posted in general because although it deals with development its not actual development. May I suggest you also use proper English and post in a coherent manner? Your user experience here at XDA will be much more beneficial if you do....

Related

Easier ADB/Fastboot Usage Mac/Linux

Let's pretend you're running Mac OS X or Linux. You might have your adb and fastboot files in a directory such as:
Code:
~/Android/
Which means to execute the command you have to
Code:
cd ~/Android/
then execute
Code:
./adb
You must be thinking, "There has to be a similar way!" Well, there is!
Code:
sudo cp ~/Android/adb /usr/bin
followed by
Code:
sudo cp ~/Android/fastboot /usr/bin
Now, all you have to do, no matter what you're present location in your file system is to simply type whichever command you want. This will probably speed up using the commands and make your time in terminal a little easier.
It is much more efficient to add the ~Android dir to PATH.
If you ever update your android sdk you'd have to copy the files again.
so better:
Code:
export PATH=~/Android:$PATH
if you want it persistent just change your ~/.profile file (depending on your distribution)
same would work in Windows, there you have to set PATH in the system settings.

[Solved] Mount a blank.img formated to ext? to bypass permission limitations?

I was wondering if I could mount an empty.img file so that I could add executable into it and chmod 777 them or what ever the number is maybe 666.
Then I would add the location to my $PATH variable in the "/system/etc/mkshrc" file so I could execute those programs from any directory.
What say you?
Has this been done before?
It works!
Well, I wen ahead and tried it out, I figured "What the hell, its not like I have to format my sd card." It worked!
So what I did
1) I changed directories to Downloads. ("cd ~/Downloads")
2) I created a directory for my image in Downloads, and moved into it. (mkdir image && cd ./image)
3) I created an empty 4 gig image called apps.img using dd ("dd if=/dev/zero of=apps.img bs=1MB count=0 seek=4096")
4) I formated it to ext2 ("mke2fs -F apps.img")
5) I used adb to push it to my phone ("adb push ~/Downloads/image/apps.img /storage/sdcard0/Download/")
6) Then on my phone as su I mounted the image ("mount -o loop '/storage/sdcard0/Download/apps.img' '/data/local/mnt' ") {with single quotes around the directories, the double quotes wrap the whole actual command, you don't need them} [EDIT: I used bash on the phone to do this, ie I "su" [enter] ; "bash" [enter] ; "THE ABOVE COMMAND" [enter]
7) To test I used the python interpreter as my executable so I created a folder in /data/local/mnt called apps,(note* I should have made that folder on my pc before I pushed it to my phone to ensure that the foder was actually in the apps.img file.) I created two more folders "bin" and "lib" using "File Manager" on my phone. I then moved what I needed to run python into those folders (though you'll see I forgot something)
8) I added PYTHONHOME PYTHONPATH and added the bin folder I created to $PATH in the /system/etc/bash/bashrc file (Ask and I'll explain). If you don't have bash the mkshrc file is located "/system/etc/mkshrc" on your phone (if its Sprint SGSIII) adding environment variable there will accomplish the same thing, sorta.
9) I connected my phone to pc w/usb, opened up a teminal on pc, started an adb shell
10)........
Code:
[email protected]:~$ adb devices
List of devices attached
xxxxxxxx device
[email protected]:~$ adb shell
[email protected]:/ $ su
[email protected]:/ # bash
void endpwent()(3) is not implemented on Android
localhost / # which python
/data/local/mnt/apps/bin/python
localhost / # python
'import site' failed; use -v for traceback
Python 2.6.2 (r262:71600, Mar 20 2011, 16:54:21)
[GCC 4.4.3] on linux-armv7l
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import sys
>>> import math
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named math
>>> import io
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/io.py", line 63, in <module>
ImportError: No module named _fileio
>>>
localhost / # exit
[email protected]:/ # ^D
[email protected]:/ $ ^D
[email protected]:~$
I'm thinking that if I can get my mkbootimg tools to work, I would mod an init script to mount the apps.img and then create links for each file in say '/mnt/apps/bin' create a link*in '/system/bin'. this should allow for phones with small or near full system partition install stuff like busybox or your own pprograms. More usefull for a developer.
I wanna try this with pythonforandroid, if I can make python and its modules. accessible during early init or just before the boot process finishes in general, and use it to run python, maybe python can handle boot in a different way, or maybe just one specific. function you might needs.
one big question I have. Does the pythonforandroid interpreter run ontop of the D VM?
Edge-Case said:
I'm thinking that if I can get my mkbootimg tools to work, I would mod an init script to mount the apps.img and then create links for each file in say '/mnt/apps/bin' create a link*in '/system/bin'. this should allow for phones with small or near full system partition install stuff like busybox or your own pprograms. More usefull for a developer.
I wanna try this with pythonforandroid, if I can make python and its modules. accessible during early init or just before the boot process finishes in general, and use it to run python, maybe python can handle boot in a different way, or maybe just one specific. function you might needs.
one big question I have. Does the pythonforandroid interpreter run ontop of the D VM?
Click to expand...
Click to collapse
I don't think so. All command-line programs I know of interface directly with the kernel.
Sent from my S3 on Sense 5 (you jelly?)
CNexus said:
I don't think so. All command-line programs I know of interface directly with the kernel.
Sent from my S3 on Sense 5 (you jelly?)
Click to expand...
Click to collapse
So getting an extended set of Linux (kernel) cli programs working with Android (kernel) is a matter of having the nessissary libraries, kernel prereq., and being compiled for the target processor?
From what I have read, the Android kernel has been cut back so far from the original Linux kernel that its difficult to port "Linux apps" to Android. Something about a slimmed down version of the GNU C/C++ libraries and the Android kernel being designed to run mostly Dalvik.
I haven't tried directly running any "Linux app" (already compiled for arm) on Android yet, but my game plan for that test was to load up an .img file with the nessissary execs, libs, config, etc files (as ext3 this time) and running some scripts that get the paths variables set up and then execute the script, I wrote a short Bash script that sets up python variables and adds others to PATH etc, and it worked, I had python on the img and the img mounted to /mnt/myside and python ran but with some errors, I need to get the variables right, its driving me mad, if its not this its that, last time it was the basic "help()" command not being declaired or something.
Well thats my plan, either these "Linux apps" run on Android without problem or I am going to A) write my own kernel to be compatible with Android/ cli Linux or I am going to get as much source code as I can and practice the art of compiling against Android and/or patching the code when/where nessissary.
We'll see what happens, I've done enough today/night.

[GUIDE] How to compile CM10.1 for your D2ATT

How to compile CyanogenMod 10.1 for your Samsung D2ATT​
This post is a copy of the guide found at http://lindroidsoup.com/so-you-want-to-build-android​It's a compilation of guides I've used along the way. It details the work-arounds I've used to get builds to complete, so I thought it would be nice to share. Special thank you to guys like DesignGears, pmos69, and Task650 for inspiring me to lean more about Android​
Tired of flashing someone else’s ROM? Ready to make your own? Read on!
This tutorial will take you from scratch to ROM with a clean new build of CyanogenMod 10.1 that you can slap on your AT&T SGS III as a daily driver. Once you’ve got the concept down, you’ll be able to change it up and build for whatever you’d like. Let’s take a look at what we’ll need to get going:
_______________________________
PREREQUISITES
Anything less would be uncivilized
Broadband Internet Connection (No, this IS a must. Attempting to sync a repo with dial-up will make your brain explode. Really).
A rooted Samsung Galaxy SIII D2ATT with CyanogenMod 10.1 or newer already flashed on it.
A 64bit Ubuntu 12.04 or later based Linux OS installed on your PC, or in a VM with adequate resources (at least 2 cores and 2-4GB RAM). This guide was written on Kubuntu 13.04, but even Mint works- notes included below.
@50GB of disk space to be used for repo storage and building.
Free Time (@3-6hrs, depending on the chomping power of your PC and the speed of your broadband).
_______________________________
!!!!! DISCLAIMER !!!!!​
This tutorial is posted as a guide for the adventurous who are eager to learn the basics of compiling a ROM. The procedures detailed here do have the ability to miff up your mobile device if something goes wrong. Since it has now been listed as a warning, you follow this guide at your own risk, and I take absolutely no responsibility for any consequences that result from any mishaps you may encounter.​
Part 1 – Setting Up The Environment
1.1 – Install The Necessary Packages
Copy and paste everything after the prompt symbol (~$) in terminal. A new prompt means a new line:
Code:
~$ sudo apt-get install git-core gnupg flex bison python rar original-awk gawk p7zip-full gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool
~$ sudo apt-get install libc6-dev x11proto-core-dev libx11-dev libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils
~$ sudo apt-get install g++-multilib lib32z1-dev ia32-libs lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib g++-multilib xsltproc
1.2 – Make Sure We Have The Right JAVA
If you try to compile with anything other than JDK 1.6, you’ll receive errors and fail to compile. If you try to download JDK 1.6 from the Oracle site, you’ll have a heck-of-a-time trying to find their archives. Luckily LindroidSoup.com just happens to have a copy of a JDK you can use…
http://lindroidsoup.com/Downloads/jdk-6u35-linux-x64.bin
Once you have the JDK downloaded, make sure you move it into your home directory. Then we’ll need to clear out any other versions of Java installed on the machine.
Code:
~$ sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Now we’re clear to install the correct JDK.
Code:
~$ sudo mkdir -p /opt/java/64 && sudo cp jdk-6u35-linux-x64.bin /opt/java/64
~$ sudo su -
~$ cd /opt/java/64 && chmod +x jdk-6u35-linux-x64.bin
~$ ./jdk-6u35-linux-x64.bin
~$ exit
Now we need to make our first PATH entry. Using your text editor of choice, (I use nano, some use vi, others use gedit…just pick one) we’ll need to add the following to our .bashrc file:
_________________________​IMPORTANT NOTE FOR LINUX MINT USERS​If you’re using Linux Mint, you’ll need to make sure you’re editing the .bashrc file located at /etc/bash.bashrc
So if you see a reference to "~/.bashrc", you should replace it with "/etc/bash.bashrc"
Got it? Good.
_________________________​
Code:
~$ sudo nano ~/.bashrc
Once the file is opened up, paste in the following at the end of the file, save, and close it.
Code:
#Java PATH
export JAVA_HOME=/opt/java/64/jdk1.6.0_35
export PATH=$PATH:$JAVA_HOME/bin
1.3 - Install The Android SDK
Now that we have our JAVA situated, it’s on to installing the Android SDK. Once again, LindroidSoup is your one-stop-shop- hit the link below for the 64bit Linux flavor of the SDK. Make sure to move it to your home directory once it’s downloaded.
http://lindroidsoup.com/Downloads/adt-bundle-linux-x86_64-20130917.zip
Let’s set up our SDK directory, and put the SDK in place.
Code:
~$ cd ~
~$ mkdir android && mkdir android/sdk
~$ sudo cp adt-bundle-linux-x86_64-20130917.zip android/sdk
~$ cd android/sdk && unzip adt-bundle-linux-x86_64-20130917.zip
~$ sudo rm -rf adt-bundle-linux-x86_64-20130917.zip && cd adt-bundle-linux-x86_64-20130917/sdk
~$ sudo cp -R platform-tools ../.. && sudo cp -R tools ../..
Now we’ll need to make sure the platform-tools and tools have the proper ownership, or the command “android” won’t work when we invoke it after adding the tools to our PATH.
You’ll need to know your username for this one- it’s pretty easy, but for those new to the scene your username is what you see listed before the “@” symbol in your prompt. For instance, my prompt shows
Code:
[email protected]:~$>
So my username is “christopher”. Now we can correct the ownership of the files, just replace each instance of username on both sides of the colons below with your username:
Code:
~$ cd ~/android/sdk
~$ sudo chown -R username:username platform-tools && sudo chown -R username:username tools
We can now add the Android SDK to our PATH, and we’ll also need to add an Extra PATH for our Device. Mint users, don’t forget to edit /etc/bash.bashrc, not ~/.bashrc.
Code:
~$ sudo nano ~/.bashrc
Once the file is opened up, paste in the following at the end of the file, save, and close it.
Code:
#Android PATH
export PATH=$PATH:~/android/sdk
export PATH=$PATH:~/android/sdk/platform-tools
export PATH=$PATH:~/android/sdk/tools
And the Extra PATH for our device. **NOTE** Mint users will edit the same file this time.
Code:
~$ sudo nano /etc/udev/rules.d/99-android.rules
Code:
#Samsung
SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666
SUBSYSTEM==”usb”, ATTRS{idVendor}==”####:####”, SYMLINK+=”android_adb”, MODE=”0666″ GROUP=”plugdev”
TEST==”/var/run/ConsoleKit/database”, \
RUN+=”udev-acl –action=$env{action} –device=$env{DEVNAME}”
Let’s make that file executable, shall we?
Code:
~$ sudo chmod +x /etc/udev/rules.d/99-android.rules
Ok, now we’ll need to close our terminal and open a new one to load all the changes we’ve made to this point.
Failure To Close And Open A New Terminal At This Point Will Cause The Android Command To Fail!
Oooh. That looked important. We should make sure we do that then. Close your terminal and open a new one.
Now to install the tools:
Code:
~$ android
The “android” command will open up the Android SDK Manager. Make sure that both the “Android SDK Tools” and “Android SDK Platform-Tools” show to be installed. If they don’t show to be, make sure you install them.
Part 2 – Gettin’ That Source Code
2.1 – Installing The Repository
Now comes the part where you’ll need to find something to do for awhile. A long while. We’re going to initialize the repository, and then start the sync process to pull in the majority of the Android Source code you’ll need to compile your ROM- but it’s several gigabytes of data and will take a fair amount of time to sync.
Code:
~$ mkdir -p ~/bin
~$ mkdir -p ~/android/system
~$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
~$ chmod a+x ~/bin/repo
And then we can make our PATH entry for the repository. Again- Mint users need to edit /etc/bash.bashrc.
Code:
~$ sudo nano ~/.bashrc
Once the file is opened up, paste in the following at the end of the file, save, and close it.
Code:
#Repo PATH
export PATH=$PATH:~/bin
We need to close our terminal again, and open another one to load our changes.
Failure To Close And Open A New Terminal At This Point Will Cause The Repo Sync Command To Fail!
Close your terminal and open a new one.
This next batch of commands will start the repo sync.
Helpful Tip
The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date. The CM manifests include a sensible default configuration for repo, which they strongly suggest you use (i.e., don’t add any options to sync). For reference, their current default values are -j4, and -c. The “-j4” part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j3 or -j2. “-c” will ask repo to pull in only the current branch, instead of the entire CM history.​
Code:
~$ cd ~/android/system
~$ repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
~$ repo sync -j4
2.2 – Grab The Device Code
Now that we have the Android Source Code, we need to pull in the code specifically for the D2ATT. We’re going to be pulling specifically from CyanogenMod’s Github, so you’ll need to make sure git is configured correctly on your machine- if their github doesn’t know who you are, you get no git! Make sure to enter you own info when configuring git. (NOTE- Those are double dashes in front of "global". Not sure why, but universally text boxes don't seem to like them, and don't display them correctly)
Code:
~$ git config –global user.name (firstname.lastname)
~$ git config –global user.email ([email protected])
Just so no one is confused, it should read like the following:
Code:
~$ git config –global user.name john.doe
~$ git config –global user.email [email protected]
Now we can use git to pull in the device code:
Code:
~$ git clone https://github.com/CyanogenMod/android_device_samsung_d2att.git -b jellybean device/samsung/d2att
~$ git clone https://github.com/CyanogenMod/android_kernel_samsung_d2.git -b jellybean kernel/samsung/msm8960
Now we can get the prebuilts from CyanogenMod as well:
Code:
~$ cd ~/android/system/vendor/cm && ./get-prebuilts
2.3 - Breakfast
Now that we have all our device specific code from both the Android and CyanogenMod repo’s, we can setup our environment and make breakfast.
Code:
~$ cd ~/android/system
~$ source build/envsetup.sh
~$ breakfast d2att
2.4 - Extracting The Blobs
The manufacturer “blobs” are kind of like a PC’s device drivers. You have to have the specific ones for the phone’s hardware, or your ROM probably won’t do important stuff- like showing anything on the display… Let’s go get them.
Now, we have two separate ways of going about this:
Option 1 –
Connect your phone to your pc via usb. You’ll need to make sure you have “UserDebug” mode enabled, as well as “Root Access for Apps and ADB” under the Developer Options of the phone.
Code:
~$ cd ~/android/system/device/samsung/d2att
~$ ./extract-files.sh
Option 2 –
Extract them from an existing CyanogenMod ROM. You’ll need to make sure you have a current copy of a CyanogenMod Nightly ROM downloaded and extracted, and you’ll need to know the path to it.
CyanogenMod Nightlies can be found here: http://download.cyanogenmod.org/?type=nightly&device=d2att
Code:
~$ cd ~/android/system/device/samsung/d2att
~$ ./extract-files.sh path/to/your/extracted/ROM
Just so everyone is clear, if I extracted my nightly ROM inside my Downloads folder- my command for Option 2 would look like this:
Code:
~$ ./extract-files.sh /home/christopher/Downloads
Wow, this is exciting. We’re almost ready to build, but first we make our last PATH entry- adding our toolchain. This step is important, because it’s the only PATH entry that has your username in it. You remember getting your username earlier, don’t you? Good!
Mint users, same old song and dance- make sure you’re editing the .bashrc file at /etc/bash.bashrc.
Code:
~$ sudo nano ~/.bashrc
Once the file is opened up, paste in the following at the end of the file, save, and close it:
Code:
#Android Toolchain PATH
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:/home/(YOUR-USERNAME-HERE)/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin
Save that file, close it, and then close and open a new terminal to load our changes. For the last time.
Failure To Close And Open A New Terminal At This Point Will Cause The Brunch Command To Fail!
Close your terminal and open a new one.
Part 3 – BUILD ANDROID
Fire up that terminal one more time:
Code:
~$ cd ~/android/system
~$ . build/envsetup.sh && brunch d2att
And watch it go. Go grab yourself a stimulating beverage- this is gonna take awhile.
Once everything wraps up, you should see a nice neat “Package Complete” message in your terminal window. Congratulations! Now go flash it- you know you wanna!
Don’t forget to grab the latest version of GAPPS if you want your Google Apps!
BONUS SECTION!!!
Q.- What the hell do I do if the build breaks!?!?
A.- This is a very valid question, although if you followed the guide you shouldn’t run into any issues- but these things happen. Google is your friend when all else fails, but here are some common occurences:
Code:
ERROR: signapk.jar failed: return code 1make: *** [out/target/product/d2att/cm_d2att-ota-eng.root.zip] Error 1
Change the following in your system/build/tools/releasetools/common.py file:
Change: “java -Xmx2048m” to “java -Xmx1024m” or “java -Xmx512m”
If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.
DOUBLE BONUS SECTION!!!
How do I make an update?
So glad you asked. So glad I saw that I left this out initially, and now I’m putting it in here…
To the terminal we go:
Code:
~$ cd ~/android/system
~$ repo sync -j4
~$ make installclean
~$ find ./out/ -name 'build.prop' | xargs rm
~$ find ./out/ -name 'cm_d2att-target_files-eng.*.zip' | xargs rm
~$ . build/envsetup.sh && brunch d2att
Just flash that update right on top of your already flashed build, and it will update it.
Again, Google is your friend.
Cheers
Automated ROM update script!!!
Want to make updating your ROM super easy? Not a problem! Download the following 'buildromupdate.sh' script from Lindroidsoup.com, or simply use a text editor to copy and paste the following! Don't forget to 'chmod +x' and make it executable- then just run it from the command line with ~$ ./buildromupdate.sh -It doesn't get much easier!
Code:
#!/bin/bash
# This script will clear out old files, and update your ROM
# Flash this updated .zip on top of your existing ROM
# You should see 'Android is updating' on next boot
cd ~/android/system
repo sync -j4
make installclean
find ./out/ -name 'build.prop' | xargs rm
find ./out/ -name 'cm_d2att-target_files-eng.*.zip' | xargs rm
. build/envsetup.sh && brunch d2att
Download the script: http://lindroidsoup.com/Downloads/buildromupdate.sh
Cheers!
I have moved your thread to general, as typically users will find guides here. I am sorry for any inconvenience.
Lindroidsoup.com will be down for maintenance on 10/16/2013
LindroidSoup.com will be down for maintenance on 10/16 - 10/19​
We apologize for any inconvenience this may cause, and are providing the direct links for both the Android SDK and Java JDK below:
Java JDK 1.6.35- http://download.oracle.com/otn/java/jdk/6u35-b10/jdk-6u35-linux-x64.bin
Android SDK- http://developer.android.com/sdk/index.html#linux-bundle
The server will be up and operational again on 10/19/2013.
Lindroidsoup.com completed maintenance ahead of schedule
LindroidSoup.com is back online!​
We're pleased to announce that the wonderful team at KnownHost, LLC was able to finish site/server maintenance well ahead of schedule, and we're now back online!
Linux Mint Users Note
If you're a Linux Mint user, just a handy little note-
Mint is notorious for over-writing /etc/bash.bashrc when major system updates are pushed out. This becomes a pain in the ass when your PATHs keep getting over-written and you receive errors when trying to build an update after you've set everything up.
To work around it, just make a copy of your /etc/bash.bashrc file- and then put it back in place if you see the original's been over-written:
To make a backup of /etc/bash.bashrc after initial setup
Code:
~$ sudo cp /etc/bash.bashrc /home/bash.bashrc.backup
To replace an over-written /etc/bash.bashrc after a system update
Code:
~$ sudo rm -rf /etc/bash.bashrc && cp /home/bash.bashrc.backup /etc/bash.bashrc
That should keep you from pulling your hair out!
Cheers
Damn it, Google!!!
Google changed the storage location of their repo code, so trying to download it was causing a '/bin/repo: line 1: syntax error near unexpected token `newline'' error.
I've adjusted the guide to reflect the new storage location for the curl command.
Sorry if this caused anybody any headaches.
Regards,
C
Any guide for Windows? If not is it cool to develop via a VMware image of Linux?
drivel2787 said:
Any guide for Windows? If not is it cool to develop via a VMware image of Linux?
Click to expand...
Click to collapse
Yes, using a vm is fine
Slithering from the nether regions of a twisted mind and tarnished soul
Hello, I am on ubuntu 14.4 and I am trying to build CM-12. When the rom is building, it keep stoppinig at the following error;
target R.java/Manifest.java: com.android.emailcommon (/home/larmyv/android/system/out/target/common/obj/JAVA_LIBRARIES/com.android.emailcommon_intermediates/src/R.stamp)
/home/larmyv/android/system/out/host/linux-x86/bin/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
make: *** [/home/larmyv/android/system/out/target/common/obj/JAVA_LIBRARIES/com.android.emailcommon_intermediates/src/R.stamp] Error 127
make: *** Waiting for unfinished jobs....
Any Ideas? Any help would be greatly appreciated.
Thanks
LARMYV said:
Hello, I am on ubuntu 14.4 and I am trying to build CM-12. When the rom is building, it keep stoppinig at the following error;
target R.java/Manifest.java: com.android.emailcommon (/home/larmyv/android/system/out/target/common/obj/JAVA_LIBRARIES/com.android.emailcommon_intermediates/src/R.stamp)
/home/larmyv/android/system/out/host/linux-x86/bin/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
make: *** [/home/larmyv/android/system/out/target/common/obj/JAVA_LIBRARIES/com.android.emailcommon_intermediates/src/R.stamp] Error 127
make: *** Waiting for unfinished jobs....
Any Ideas? Any help would be greatly appreciated.
Thanks
Click to expand...
Click to collapse
Sounds like you're running into this: http://ideid.blogspot.co.uk/2013/01/resolve-shared-library-problem-with.html
Give it a shot, and let me know what you get.
samoled said:
Sounds like you're running into this: http://ideid.blogspot.co.uk/2013/01/resolve-shared-library-problem-with.html
Give it a shot, and let me know what you get.
Click to expand...
Click to collapse
Thank you so much, i was looking for days on the error. When I put in the following command;
sudo apt-get install ia32-libs
it gave me an error that said that it was no longer available. It said to download the following;
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
I downloaded those packages and i am now in business and have finally built a rom. Now I am learning on the whole cherry picking.
Thanks again.
Awesome, glad to hear you got that sorted out.
Let me know if you run into anything else.
samoled said:
Awesome, glad to hear you got that sorted out.
Let me know if you run into anything else.
Click to expand...
Click to collapse
Hi, I have a new question for you. I am currently building slim roms and I have an issue with the kernel. The phone will boot up but would be stuck on the samsung logo screen. My question to you is how do I port over the CM12 kernel and merge it with the slim rom?

Run Backtrack 5 On Android Devices (Step By Step)

1. Download terminal emulator,android vnc and arm version of backtrack.
2. Extract the content of img file and transfer it in to memory of android devices.
3. Install BusyBox and start it.
4. Open terminal emulator. use "cd" command to get in backtrack directory where extracted content is saved on memory card of device. In this case command is
cd /sdcard/BT5
5. Type "sh bootbt" and we will be in Backtrack.
commend
su
cd/sdcard/bt5
sh bootbt
startvnc
download from torrent
BackTrack 5 ARM Edition Quick Start
This image has been developed and tested on the you yureka. Your mileage may vary on other devices.
As this image runs in a chroot, you will need to have your device rooted. There are numerous tutorials on the subject online and are not included here.
***Rooting your device will potentially void its warranty and we are not in any way resposible if you brick your device while rooting it.***
### IMPORTANT POINTS ###
1. Since the image runs in a chroot, there is no root password set.
2. There are 2 scripts under /usr/bin/ 'startvnc' and 'stopvnc' that are set to start with the Xoom's default resolution.
3. The current vnc password is set to 'toortoor' and can be changed by running 'vncpasswd'
4. This image is a work in progress and suggestions/tips from the community are always welcome.
### GETTING STARTED ###
1. Once you have downloaded the ARM BT package, save the files in a convenient location. The steps below assume they are in the platform-tools folder of the Android SDK.
2. Go to your platform-tools directory and proceed to make a directory on the device to store BT5:
./adb shell
mkdir /sdcard/BT5
exit
3. Copy over the busybox install files:
./adb push busybox /sdcard/
./adb push installbusybox.sh /sdcard
4. Install busybox on the device:
./adb shell
cd /sdcard/
sh installbusybox.sh
exit
5. Transfer the required BT5 files to the device:
./adb push fsrw /sdcard/BT5/
./adb push mountonly /sdcard/BT5/
./adb push bootbt /sdcard/BT5/
./adb push bt5.img.gz /sdcard/BT5/
./adb push unionfs /sdcard/BT5/
6. Uncompress the image and start BT5:
./adb shell
su
cd /sdcard/BT5
gunzip bt5.img.gz
sh bootbt
If all goes well, you'll be in the BT5 chroot:
# sh bootbt
net.ipv4.ip_forward = 1
[email protected]:/# ls /pentest/
backdoors database exploits passwords scanners stressing voip
cisco enumeration forensics python sniffers tunneling web
[email protected]:/#

[GUIDE]How to build unruu from source on Debian GNU/Linux based distributions

This program is for unpacking rom.zip from RUU on Unix-like operating systems
All commands below are to be executed from the terminal NOT as root
1)
Code:
sudo apt install m4 git unshield libunshield-dev dh-autoreconf
2)
Code:
git clone https://github.com/kmdm/unruu.git
3)
Code:
cd unruu
4)
Code:
./autogen.sh
5)
Code:
./configure
6)
Code:
make
7)
Code:
sudo make install
To use this utility is very simple: unruu /path/to/ruu/ruu.exe
For example: unruu /home/alex/RUU_Express.exe

Categories

Resources