[GUIDE] Extract Samsung *.tar.md5 files on Linux - Android Software Development

Hey. While trying to port a TouchWiz ROM, I came across tar.md5 files. For some reason, every guide to open this format assumes you're using Windows. I use Linux Mint, so it was a bit of a problem. I found the solution, and thought I should post it here.
Materials required:
Android Kitchen
Linux distro with p7zip
Basic Terminal knowledge
Procedure:
1. Download Android Kitchen here: http://forum.xda-developers.com/showthread.php?t=633246
2. Download and install p7zip (for Ubuntu-based distros):
Code:
sudo apt-get install p7zip p7zip-full p7zip-rar
3. Open a Terminal in the directory where you have your tar.md5. Do:
Code:
7z e SomeReallyLongNameHowDoesSamsungRememberThis.tar.md5
And wait for the shell prompt to appear again. When it does, go to Android Kitchen's original_update folder and paste the boot.img and system.img that were extracted there.
4. Open a Terminal in Android Kitchen's directory. Do:
Code:
./menu
1
(just press enter, type nothing before it)
(type number corresponding to "system.img and boot.img" and press enter)
When it asks you for your password, give it the password. It needs that for mounting the IMG file.
Now your /system folder is in WORKING_whatever, and you can make a ZIP from Android Kitchen. Done.

Related

[GUIDE/Linux] Install Android SDK the "Linux way"

Hi everyone.
I will show you how to install Android SDK. After this installation, you will have CLEAN, FULLY WORKING Android SDK environment useful for PROGRAMMING, using ADB utility and for OTHER THINGS. Note that this installation will work for ALL users on one computer, so its SYSTEM-WIDE installation (best solution).
This GUIDE WILL WORK WITH ALL LINUX DISTROS (tested on Arch/Debian, 32bit PC).
------------------------------------------------
WHAT WILL YOU NEED?
- Android SDK installation files (download file for LINUX, android-sdk_rXX-linux_x86.tgz - remember to replace "XX" with actual version number you have downloaded)
- Linux machine
- internet connection
- text editor (gedit, Kate, nano or any other)
- tar (is preinstalled on all Linux distros)
------------------------------------------------
LET'S GO
Download Android SDK for Linux and store that android-sdk_rXX-linux_x86.tgz file in your home directory.
Launch terminal and navigate to your home folder with this command:
Code:
cd ~
Extract downloaded android-sdk_rXX-linux_x86.tgz file with this command:
Code:
tar xvzf android-sdk_rXX-linux_x86.tgz
After extraction, you have "android-sdk-linux_x86" folder in your home directory. Now we will copy this folder into /opt folder (i chose this folder, because its used even for JDK and its system wide directory). Copy extracted folder with this command:
Code:
sudo mv android-sdk-linux_x86 /opt/android-sdk
After this, Android SDK is copied into /opt directory.
Now we have to register our Android SDK paths with our Linux system. Path to our Android SDK is now /opt/android-sdk/. We can find folders add-ons, platforms and tools (for example) in this path. To complete Android SDK installation, open your ~/.bashrc file with your favourite text editor. If you use gedit, then use this command:
Code:
gedit ~/.bashrc
Text editor with text file opens now....
After its opened, scroll DOWN to the end of file and put on the LAST LINE of that file:
Code:
export PATH=${PATH}:/opt/android-sdk/tools:/opt/android-sdk/platform-tools
Then save file and exit text editor. This step added our Android SDK paths to Linux SYSTEM-WIDE path, so that we can use for example adb by simply typing "adb shell".
Basic installation is now complete. To make SDK usable, type this to terminal:
Code:
sudo android
If you use GNOME then write gksudo instead of sudo and when you use KDE, write kdesu instead of sudo.
ANDROID SETTINGS window will appear. Go to "Available Packages" and install
Code:
Android SDK platform-tools
Android Compatibility package
SDK Platfotm Android XX (select versions you wanna, select at least one - for example 2.3.3)
After things are downloaded and updated, close that Android Settings window.
Log out and log in to complete installation.
CHEERS!!!
If you like this GUIDE, then HIT THX button.
Have a nice day.
Why are you spamming the forum with this unnecessary cruft?
Duh... download file from web.
Extract.
done.
I mean what are you trying to do? Confuse people and drive them by force to apple?
Not everyone is as SMART as(s) you are.
So keep quiet if you have nothing positive to say to this thread.
sudo android
sudo: android: command not found
I also found this script (for ubuntu) very helpful https ://github.com/AdnanHodzic/android-sdk-installer
And it is possible to just install the eclipse plugin as a user, it will pull in the sdk. (Don't forget to install the i386 libs though)
1) Download the Android SDK for Linux and follow Google's setup directions.
2) Drop the ADB binary into /usr/bin.
3) Edit /etc/udev/rules-d/51-android.rules to read your phone.
thanks dude..I`ll try install on my debian..
kalidgate said:
sudo android
sudo: android: command not found
Click to expand...
Click to collapse
+1
HOXnoo8 said:
+1
Click to expand...
Click to collapse
cd into tools and run android
./android
This will open a GUI that allows you to download various APIs and tools such as adb and fastboot
Sent from my Nexus 7 using XDA Premium 4 mobile app

GUIDE : How to modify the cust.img

Hey there.
Does anyone knows how to modify the cust.img file of the latest official 2.3.5?
I want to remove some firmware apks (swype to install another version which support greek).
Thanks!
Hi I got this information from That-Guy:
1. Download Slitaz Linux 3.0 Live CD
2. Open terminal
3. Copy cust.img from phone to /home/tux folder
4. mkdir tmp
5. mount cust.img /home/tux/tmp
6. cd /home/tmp/hw/default/app
7. Delete apk files what you don't want
8. unmount tmp
9. Copy cust.img from /home/tux folder to phone
Thanks. I did the following and worked:
In Linux (ubuntu 10.04):
1)copy the cust.img file from your .cust_backup/image folder of your mobile somewhere in your computer (ex Desktop)
2)open a terminal and type sudo su (root permissions) and then your computer password
3)Go to "somewhere" : with command: cd somewhere (ex cd ~/Desktop )
4)type at terminal mount -o loop cust.img /mnt/
5)type sudo nautilus . This should open you a navigation window.
6)navigate to: file system --> mnt/
inside the hw/default/app are the apks of the default cust.img.
Edit it as you wish.
to unmount type at terminal (with root permissions again): umount /mnt/
you are ready to copy the cust.img back to your phone and replace the old one
can someone give us a clear cust.img and the apps to a folder in order to let us choose which of them we want to install?
I'm not so familiar with linux OS and i am afraid to do it on my own. :/
Doesn't poweriso work for this on windows?
Sent from my u8800-51 running popaura ICS.
Somcom3X said:
Doesn't poweriso work for this on windows?
Click to expand...
Click to collapse
i tried to open my cust.img with poweriso without success.
It stopped with an error, "the file format is invalid or unsupported".
http://forum.xda-developers.com/showthread.php?t=1373146
ufukyayla said:
http://forum.xda-developers.com/showthread.php?t=1373146
Click to expand...
Click to collapse
last post there is mine...

[GUIDE] Customizing ROMs for your needs.

At the request of others, I have decided to write this guide pertaining to ROM customization. I found that in most of the current custom Jelly Bean ROMs for the TF101, that the GPS configuration has been changed, at least compared to the stock Asus ICS ROMs for the TF101 and the stock Asus Jelly Bean ROM for the TF300T, and they are using modified user / group and permissions settings. They all say that it is because those items have changed in Jelly Bean. They are also using a custom /etc/gps.conf file. The problem is that I, along with several others, aren't seeing very good GPS response and some claim not to see any. The ones that do see something, see that the first initialization takes forever and then is likely to not hold a fix, only seeing a few satellites. I made some changes in the ramdisk and /etc/gps.conf file and tested with a few of the Jelly Bean ROMs for the TF101 and found that settings matching the stock Asus settings performed quite well and was asked to share the process that I used. While it would be easier probably to just post the modded kernels for others to reflash, I'll give it a go at explaining what I've done.
1) This guide will require either a working native Linux install or can probably be used with a virtual machine Linux install. I'm using Ubuntu 12.04-x86_64 LTS as Ubuntu is usually used in most of the guides I've found. You may be able to make things work with other Linux flavors, but YMMV. I'm going to assume, at least, a basic knowledge of Linux file systems and the ability to copy and paste to a terminal and follow instructions.
2) You may need to install the Android SDK and at least one platform in order to get a working "adb" command, which will be needed. You may be able to get the "adb" binary from other sources that will work and "adb" will require some setup in udev rules to allow your normal user to access the tab with it. I'm going to assume that you have all of these things in place and working and that "adb" is in your path. If not, then Google is your friend.
3) For good measure, it would help and definitely won't hurt anything to have some build environment files in place. In a terminal, copy and paste the following:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Let that install and when it is finished, copy and paste the following:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
4) Now we need to grab dsixda's Android Kitchen, which is where some of the magic can happen. Go here to read up on how to use it and to find the download link. While the TF101 isn't specifically supported, there are a lot of things that we can still use it for. Just don't try to build a ROM and flash it with this before you have read dsixda's thread thoroughly or you may wind up with a brick. I'm only going to describe things that I've done and tested and that I know will work. For ease of this guide, I'm going to assume that you read the instructions there and that you unzip the downloaded file to "/home/'yourname'/android/kitchen/".
http://forum.xda-developers.com/showthread.php?t=633246
5) Now we need to build the blob tools used to pack and unpack the .blob files. Here we will download the source code for these tools and build them on the local machine. Go here:
https://github.com/AndroidRoot/BlobTools
6) Download the .zip file and extract to "/home/'yourname'/blob_tools/", where 'yourname' is your home directory name. Then, in a terminal, type "cd ~/blob_tools", without the quotes. Then type "make". When this is finished, type "mkdir ~/bin", if it doesn't already exist, and then type "cp ./blobpack ~/bin/;cp ./blobunpack ~/bin/". Now we need to make sure that "~/bin/" is in our PATH. Type "cat ~/.profile" and make sure that there are lines matching the below there:
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
If not, use an editor like gedit, to add them just before the last line which should say "fi". For basic instructions on the blob tools, see here:
http://forum.xda-developers.com/showthread.php?t=1068548
That should be all for the tools and setup. Now reboot your PC to Linux, for good measure.
I'm going to use as an example, the changes I made for the GPS permissions and settings. Anything else will be up to your own personal study and research and experimentation. I assume no responsibility if you do something mentioned here or not or if you should brick your device.
1) Download the CWM flashable custom ROM of your choice. I'm not going to deal with Asus stock ROMs here because there are extra steps to do to look into those completely. Extract the ROM to a directory under your home directory. You will have to create it, such as "Team_EOS3" or whatever. I'm going to use the graphical file manager Nautilus and the graphical text editor gedit to work with files and directories and to edit files. When using Nautilus be sure to go to the "View" menu and select "Show hidden files". Some work will also be done in a terminal. I use Gnome terminal.
2) For example, I have a folder "K900_AOKP_JB", where I extracted K900's ROM. So if I look at that in Nautilus, I see 2 folders, "META-INF' and "system" and 2 files, "boot.blob" and "boot.img". Most of the custom roms will not have the boot.img file, only the *.blob file. The blob file and the boot.img file should be the same thing. Each contains the compressed kernel image and the initial ramdisk.
3) From a terminal, type, for example, "cd ~/K900_AOKP_JB". Then type, "blobunpack ./boot.blob", substituting the appropriate names for your particular files. In Nautilus, you will see that 1 more file was created, in my case, "boot.blob.LNX". Right click and copy this file to your Kitchen WORKING_DIRECTORY which you should have created from following the kitchen instructions. For me it is "~/android/kitchen /WORKING_091312_142859/", where "~" is shorthand for "/home/'yourname'", i.e. your personal home directory. Right click and delete or move to trash the boot.img file that is there already. Right click the file you just copied, i.e. "boot.blob.LNX" and rename it to "boot.img". Upper and lower case matters, so pay attention.
4) From a terminal, type "cd ~/android/kitchen". Then type "./menu". Choose option "0", then choose option "20", then choose option "w". Follow any instructions that come up. These actions will create a new directory, "~/android/kitchen/BOOT-EXTRACTED/", which is where the kitchen just extracted your renamed blob file (boot.img). Inside, you will see a "boot.img-ramdisk" folder, which contains the ramdisk files and a "zImage" file, which is the compressed kernel.
5) Inside the ramdisk folder, we are going to edit only the "init.ventana.rc" file to change some GPS settings. Open the file with gedit and scroll down to the #GPS section. Change it to read the following:
Code:
# GPS
mkdir /data/gps
chown system system /data/gps
chmod 770 /data/gps
chown root system /dev/ttyHS1
chmod 0664 /dev/ttyHS1
Scroll down to the #GPS init section and change it to read the following:
Code:
# GPS init
write /sys/class/gpio/export 203
write /sys/class/gpio/gpio203/value 0
write /sys/class/gpio/gpio203/direction out
chown root system /sys/class/gpio/gpio203/value
chmod 0664 /sys/class/gpio/gpio203/value
Scroll down to the # Start GPS daemon section and change it to read the following:
Code:
# Start GPS daemon
on boot
service gps-daemon /system/bin/glgps -c /system/etc/gps/gpsconfig.xml
user root
group root
class late_start
Save the file. Right click and delete "init.ventana.rc~", which will only show up if you selected to "Show hidden files" in the "View" menu. In Nautilus move back to your kitchen WORKING directory.
6) In the terminal that should still be running the kitchen menu, choose option "b" to rebuild the boot.img. You can now exit out of the kitchen menu. Back in Nautilus, right click and rename the "boot.img" file to "boot.blob.LNX" or whatever your original extracted blob file was called. Right click and copy to the folder where your ROM was extracted. Choose to replace the original file if asked.
7) In a terminal, type "cd ~/K900_AOKP_JB", substituting "K900_AOKP_JB" with whatever your extracted ROM folder is called. Then type "blobpack ./boot.blob LNX ./boot.blob.LNX", substituting your file names for "boot.blob" and "boot.blob.LNX".
8) In Nautilus, in the folder where your ROM was extracted, double click the "system" folder, then double click the "etc" folder. Then double click the "gps.conf" file. It should open up in gedit, if you were using that before, if not then choose to display it. Change it's contents to read the following:
Code:
#
# IMPORTANT:
# this file is only used by NetworkTimeUpdateService.java
# DO NOT make any GPS related settings here.
#
NTP_SERVER=xtra1.gpsonextra.net
Save and close the "gps.conf" file.
9) In Nautilus, in the folder where your ROM was extracted, left click on the "META-INF", "system" folders and the *.blob and boot.img file, if present, while holding down CTRL key, to highlight all 3 or 4 items. Right click on 1 of the highlighted items and choose "Compress". Rename the file if desired, especially if you have the original zip in that folder by the same name and want to preserve it, and then click "Create". The new zip file, with your custom name, will be created in the same folder after a few seconds. In my case, I chose to name it "K900_AOKP_JB-test.zip".
10) You now have created your own customized version of someone else's ROM, modified for your needs or experimentation. Now it's time to push it to your device. You can use Dropbox, if desired to do this, but the easier way is to use adb. I'm going to assume that you have a working Custom Recovery, preferably one that can read both internal sdcard and external MicroSD and that you have adb setup and working.
11) Plug your charging cable into the computer first and then plug the other end into the TF101.
12) In a terminal, type "cd ~/K900_AOKP_JB", substituting "K900_AOKP_JB" with the folder name where you extracted your ROM and where the new zip file resides. Type "adb devices" and after a second or two, you should see something similar to the following:
Code:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
03806245421f9417 device
If you get something looking like that, then adb is working.
13) In the same terminal, type "ls", which will list all the files and folders in your extracted ROM directory (or whatever your current directory is). If your recovery can read only the internal sdcard or both, then you can type "adb push ./K900_AOKP_JB-test.zip /sdcard/Download/", substituting "K900_AOKP_JB-test.zip" with whatever you named your zip file. After a few minutes you should get a confirmation that the transfer completed and can verify that it did with a file manager on the device.
14) If your recovery only reads from the external MicroSD card, then type "adb shell", then type "ls". You will get a list of all files and folders in the root directory of your device's file system. If you are running ICS or older, then you should see a "Removable" directory. If you are running one of the custom JB ROMs, then you may not have the "Removable" folder, but most likely a "storage" folder. For ICS or older, your external MicroSD should be located at "/Removable/MicroSD/". In the latter case, it should be located at "/storage/sdcard1/". In any case, once you have verified where the external card is mounted, then type "exit". Now type either "adb push ./K900_AOKP_JB-test.zip /Removable/MicroSD/" or "adb push ./K900_AOKP_JB-test.zip /storage/sdcard1/", depending on your results from adb shell. After a few minutes you should get a confirmation that the transfer completed and your new zip should now be on the root directory of your external MicroSD card.
15) Now you should be able to reboot to your recovery and flash the zip you created just like you would flash any ROM. Reboot and enjoy, from this example, working as intended GPS.

Convert IMG into Odin flashable TAR.MD5

Hello dear humans,
This tutorial will help you convert simple IMG files into TAR.MD5, which is flashable using Odin (Mobile or PC version both).
For this you need to install JAVA JDK and Cygwin from the links below.
JAVA JDK: http://www.oracle.com/technetwork/ja...s-2133151.html
Cygwin: content.wuala.com/contents/neroyoung/XDA%20ROM%20Dev%20Tools/Cygwin.zip
How to install?
-Before doing anything, install Java then install Cygwin by extracting the zip and then extracting the cygwin_packages.zip, Run the cygwin.exe setup and select "Install from local...." then select the folder containing extracted files from cygwin_packages.zip, then click the "S" like button on all
and install in a folder you can access easily using commands.
(THE ABOVE LINKS ARE ONLY FOR WINDOWS VERSION OF JDK AND CYGWIN, IF YOU WANT TO INSTALL IN OTHER OPERATING SYSTEMS SO PLEASE GOOGLE IT. #IN LINUX DON'T INSTALL ANYTHING JUST DO IT IN THE TERMINAL)
Now in folder installed cygwin, go to home open cygwin.exe or open it from the shortcut in your desktop (THE IMG FILE AND CYGWIN MUST BE IN SAME FOLDER), lets name our IMG file recovery.img, in cygwin type the following commands without $ [Because cygwim already types $ before a command]
$ tar -H ustar -c recovery.img >
recovery.tar
$ md5sum -t recovery.tar >> recovery.tar
$ mv recovery.tar recovery.tar.md5
Congrats you've successfully concerted your IMG file.to Odin flashable TAR.MD5
Hit Thanks if this helped you

Fixing script for boot looping on OOS 3 [Linux][OS X?]

Basically, this is a copy-paste thread from this thread.
THIS GUIDE IS FOR LINUX (AND OS X ?) ONLY! Windows version here
Download file here: https://mega.nz/#!wooAGJYA!Hr7VUkPRt1Xx9QxaRSIX-r7u9R8OtBhcpb8W5FdwHS8
Open a terminal (Ctrl + Alt + T) and go to your "~/Downloads" directory (or basically where you download your files):
Code:
cd ~/Downloads
Now, unzip the archive you just download:
Code:
unzip FixOOS3-TWRP.zip
You should now have a folder called "FixOOS3-TWRP". Go into this folder with "cd" command :
Code:
cd FixOOS3-TWRP.zip
Get sudo access (script won't run if not in root):
Code:
sudo -s
and then:
Code:
./fixoos.sh
.
The script will flash all necessary files to your device, and after 3 seconds. it will automatically reboot onto new TWRP.
From this TWRP you'll be able to flash newest CM 13 ROMs and OOS 3.x.x.
If there is no ROMs present on your phone, you can still push it with (be sure to stay in the current directory to use "./adb") :
Code:
./adb push <name_of_the_ROM>.zip /location/on/the/device/
of you can sideload it:
Code:
./adb sideload <name_of_the_ROM>.zip
(Be sure to be in "sideload mode" in TWRP).
For more pictures, check out original thread by @djsubterrain : fastboot outputs are pretty much the same, beside the fact that you are on Windows and Linux.

Categories

Resources