Auto APK/ZIP Signer in Windows - Android Apps and Games

Hi XDA.
I have created automatic version of this One Click Signer:
(Click to thanx here FIRST! ->) http://forum.xda-developers.com/showthread.php?t=822388 (<- Click to thanx here FIRST!)
This version Works for Quantum of files at same time.
There are two DIRs:
Input - move here all APK and ZIP files to sign.
Output - here comes Signed APKs and ZIPs.
How to use?
1. Download auto-sign.zip from this thread.
2. Unzip it.
3. Run once autosign.bat.
4. Now, Input and Output folders was created.
5. Move all your Unsigned APK and ZIP files into Input folder.
6. Run autosign.bat again.
7. Wait until CMD windows closes.
8. Now you have Signed Your APKs and ZIPs in Output folder.
Click to expand...
Click to collapse
If you think, that is virus, or any harmful file,
you can right click on any .bat or .cmd file, and use EDIT option.
Here you can see all code, that files do.
Thanx to ASimmons, and dont forget to hit "Thanks!" button on his thread too! (link above)
Sorry for my BAD English.
//ANY PROBLEMS?
1. Output DIR is empty.
- move your auto-sign folder to root of C: drive, maybe run it as administrator.
2. Files are in output folder, but not signed
- check if you have Java Runtime SE Library, try to reinstall it.
if you have 64 bit system, and 64 bit Java, try to install 32 bit java too.

Thanks, gouster3.
Very easy to use Signer. However, using it to create an 'update.zip' package for my tablet was unsuccessful due to the 'zipalign' step at the end. So I reversed the steps as follows in "do2.cmd", then it was accepted (although this way the ZIP isn't fully aligned) :
Code:
setlocal EnableDelayedExpansion
@ECHO off
SET rom=%1
copy !rom! x!rom!
cd lib
rem zip align
zipalign -f 4 ..\x!rom! ..\signed-!rom!
rem sign the rom
java -Xmx512m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ..\signed-!rom! ..\signed-!rom!
cd ..\
del x!rom!
Joe.

Related

[SCRIPT/HOW-TO] Sign files with terminal (Ubuntu)

sign files with a right click (Ubuntu) (Thanks Amon_RA)
-----------------------------------------------------------------------------------------------------------------
This little novice, 2-line script will help you sign update.zip files directly from any terminal window if you have the Android SDK set up on your machine. It might be pointless to some, but I thought it would be a nice idea to share.
Navigate to your Android SDK directory.
Create a folder and name it "sign".This is where you will put the update.zip that you want to sign.​
Download the attached testsign.jar file [extract from zip] and move it to the new /sign directory in your Android SDK.
Navigate to your /tools directory and Right-Click > Create Document > Empty File.
Give it a name without extension.example: sign​
Right-Click > Open with "Text Editor" and add the following:Change the directories according to your setup.
#!/bin/sh
java -classpath /AndroidSDK/sign/testsign.jar testsign /AndroidSDK/sign/update.zip /AndroidSDK/sign/update-signed.zip
Click to expand...
Click to collapse
Give it executable permissions with the terminal -
Code:
cd /YOUR-SDK-DIRECTORY/tools/
chmod a+x sign
Now you can simply drop the update.zip to your /sign directory and from the terminal type:
Code:
sign
and it will sign it without having to add the long command yourself.
Of course you can edit the script to fit your needs.
---- Optional ----
By making a link (right-click > Make Link) of your /sign directory and adding it to your Desktop, you can drag and drop update.zip directly to this link and sign. This save you some time in the signing process and you have access to it from your Desktop.
---- Optional ----
Thank you Cyanogen for this reply.
mods, please sticky this as i'm sure many will find this very informative
Perfect howto, just works like a charm Thanks to the author!
Thank you so much! Just started using ubuntu in a VM. Think you could write up a guide on setting up eclipse? That'd be absolutely super. Thanks again lol. Helped me sign files + set up the sdk. Great work.
alritewhadeva said:
Thank you so much! Just started using ubuntu in a VM. Think you could write up a guide on setting up eclipse? That'd be absolutely super. Thanks again lol. Helped me sign files + set up the sdk. Great work.
Click to expand...
Click to collapse
Well, setting up eclipse is fairly simple!
download Eclipse
unzip it any directory/AndroidSDK/Eclipse | /home/wddglr/Apps/Eclipse​
set up the ADT following the information in this page: [http://developer.android.com/sdk/1.5_r3/installing.html]
wddglr said:
Well, setting up eclipse is fairly simple!
download Eclipse
unzip it any directory/AndroidSDK/Eclipse | /home/wddglr/Apps/Eclipse​
set up the ADT following the information in this page: [http://developer.android.com/sdk/1.5_r3/installing.html]
Click to expand...
Click to collapse
Ah thank-you. I'll PM you if i run into any problems if thats okay. I'm a noob with ubuntu just set it up yesterday.
i love you man j/k
THANK UUUUUUUUUU so much man
if you use lots of different named update zips.
This is step 6
#!/bin/sh
echo -n "Source Zip Filename : "
read input
echo -n "Output Zip Filename : "
read output
java -classpath /androidsdk/sign/testsign.jar testsign /androidsdk/sign/"$input" /androidsdk/sign/"$output"
echo "Finished signing $input as $output"
Click to expand...
Click to collapse
Just input the source file and the output and it does the rest.
Was useful for me as I sign different zips.
Use as you wish, thanks to wddglr.
I don't know why I can never get this to work.
This is exactly what I see when I ls /AndroidSDK/sign:
[email protected]:~$ ls /AndroidSDK/sign
testsign.jar update.zip
[email protected]:~$ sign
Exception in thread "main" java.lang.NoClassDefFoundError: testsign
at gnu.java.lang.MainThread.run(libgcj.so.90)
Caused by: java.lang.ClassNotFoundException: testsign not found in gnu.gcj.runtime.SystemClassLoader{urls=[], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.90)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at java.lang.ClassLoader.loadClass(libgcj.so.90)
at gnu.java.lang.MainThread.run(libgcj.so.90)
Click to expand...
Click to collapse
Binary100100 said:
I don't know why I can never get this to work.
This is exactly what I see when I ls /AndroidSDK/sign:
[email protected]:~$ ls /AndroidSDK/sign
testsign.jar update.zip
Click to expand...
Click to collapse
I was wondering if you were you able to solve this? Becouse I'm getting the same.. I'm thinking it has something to do with jave. But not sure what I need to do to fix it.. thanks for any info ....
yea me toooo
edit i figured it out
Code:
# Right-Click > Open with "Text Editor" and add the following:
Change the directories according to your setup.
Quote:
#!/bin/sh
java -classpath [B]/AndroidSDK[/B]/sign/testsign.jar testsign /[B]AndroidSDK[/B]/sign/update.zip /AndroidSDK/sign/update-signed.zip
yeah that is not where my tools are lol
wddglr said:
sign files with a right click (Ubuntu) (Thanks Amon_RA)
-----------------------------------------------------------------------------------------------------------------
This little novice, 2-line script will help you sign update.zip files directly from any terminal window if you have the Android SDK set up on your machine. It might be pointless to some, but I thought it would be a nice idea to share.
Navigate to your Android SDK directory.
Create a folder and name it "sign".This is where you will put the update.zip that you want to sign.​
Download the attached testsign.jar file [extract from zip] and move it to the new /sign directory in your Android SDK.
Navigate to your /tools directory and Right-Click > Create Document > Empty File.
Give it a name without extension.example: sign​
Right-Click > Open with "Text Editor" and add the following:Change the directories according to your setup.​
Give it executable permissions with the terminal -
Code:
cd /YOUR-SDK-DIRECTORY/tools/
chmod a+x sign
Now you can simply drop the update.zip to your /sign directory and from the terminal type:
Code:
sign
and it will sign it without having to add the long command yourself.
Of course you can edit the script to fit your needs.
---- Optional ----
By making a link (right-click > Make Link) of your /sign directory and adding it to your Desktop, you can drag and drop update.zip directly to this link and sign. This save you some time in the signing process and you have access to it from your Desktop.
---- Optional ----
Thank you Cyanogen for this reply.
Click to expand...
Click to collapse
I tried every way I could, and as stupid as I am, I could not get it to work!!!
[email protected]:~$ sign
bash: sign: command not found
[email protected]:~$ cd /home/ccriffman/android/tools
[email protected]:~/android/tools$ sign
bash: sign: command not found
[email protected]:~/android/tools$ cd /home/ccriffman/android
[email protected]:~/android$ sign
bash: sign: command not found
[email protected]:~/android$ cd /sign
bash: cd: /sign: No such file or directory
[email protected]:~/android$ cd /home/ccriffman/android/sign
bash: cd: /home/ccriffman/android/sign: No such file or directory
[email protected]:~/android$ cd /tools
bash: cd: /tools: No such file or directory
[email protected]:~/android$ cd tools
[email protected]:~/android/tools$ sign
bash: sign: command not found
[email protected]:~/android/tools$ cd sign
bash: cd: sign: Not a directory
[email protected]:~/android/tools$ sign
bash: sign: command not found
[email protected]:~/android/tools$
joe v said:
I was wondering if you were you able to solve this? Becouse I'm getting the same.. I'm thinking it has something to do with jave. But not sure what I need to do to fix it.. thanks for any info ....
Click to expand...
Click to collapse
Yeah, I got it to work. The problem was with my Java.
testsign.jar in wrong spot
I got mine fixed. I had testsign.jar inside of the testsign folder inside the sign folder.
testsign.jar needs to be in the 'root' of the sign folder, or you need to modify the sign script to point to the correct location.
pconwell said:
I got mine fixed. I had testsign.jar inside of the testsign folder inside the sign folder.
testsign.jar needs to be in the 'root' of the sign folder, or you need to modify the sign script to point to the correct location.
Click to expand...
Click to collapse
..... damnit.
I did the same thing
======EDIT=======
Now I am getting this error:
sign
No command 'sign' found, did you mean:
Command 'bsign' from package 'bsign' (universe)
Command 'psign' from package 'radiance' (universe)
sign: command not found
Click to expand...
Click to collapse
Help?
I guess it means I've failed???
This script worked great, I really appreciate it. I did modify it a bit so that I don't have to necessarily sign update.zip every time. It is similar to the script posted on the first page, but rather than it asking for the input and output, you simply add parameters to the sign command. For example:
Code:
sign <input> <output>
See the code below, make sure you change the directory to where you have the sign folder located.
Code:
#!/bin/sh
java -classpath /opt/android/sign/testsign.jar testsign /opt/android/sign/$1 /opt/android/sign/$2
echo "Finished signing $1 as $2"
Hope this helps anyone.
An even better modification is to make it only take ONE parameter:
#!/bin/bash
mv $1 /tmp/$$-$1
java -classpath /opt/android/sign/testsign.jar testsign /tmp/$$-$1 $1
rm /tmp/$$-$1
Note that this form is also independent of the location of the archive to sign -- it is nicer to enter that particular directory and just run "sign file.zip".
You should really mention that the tools directory has to be added to $PATH..
Not everyone has this, if you don't then simply typing sign will not work
wedsxcrfv said:
You should really mention that the tools directory has to be added to $PATH..
Not everyone has this, if you don't then simply typing sign will not work
Click to expand...
Click to collapse
Well it should be correctly assumed that $PATH was correctly set when they installed the Android SDK, because if they followed the instructions provided by the SDK's documentation then it says to set the $PATH var in "~/.bashrc" or "~/.bash_profile".
From: http://developer.android.com/sdk/installing.html
On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:<your_sdk_dir>/tools
Click to expand...
Click to collapse

How to make a ROM

Hey XDA
This might be a dumb question, but i dont know where else to ask
I would like to try and make my own ROM for my magic, but i have no idea about where to start, so i was wondering if someone knew of a guide, or some other form of "getting startet" thingy?
And what about apps, how do you make them?
Does it require a Linux machine, or can it be done in windows?
Per
I'm interested in this as well , guys nobody wants to share with us your knowledge??
I too would like to know.
bump
I would like to know also. A quick guide or write-up would be supper nice.
Not to burst anyone's bubble but I seriously doubt a quick write-up would explain the steps on to creating your own ROM or how to write apps. If you really want to learn, I would suggest you take some programing classes at your local community college.
cptandroid said:
Not to burst anyone's bubble but I seriously doubt a quick write-up would explain the steps on to creating your own ROM or how to write apps. If you really want to learn, I would suggest you take some programing classes at your local community college.
Click to expand...
Click to collapse
A quick write up doesn't explain it, but equally going to college isn't applicable to rom cooking either.
All the information you need is on the Internet, have a look in this link where the basics are explained, and use google to fill in the blanks ...
http://www.johandekoning.nl/index.php/2009/06/07/building-android-15-build-environment/
The documentation in ASOP recommends Ubuntu for your dev machine (http://source.android.com/download) so familiarity with Linux is essential, also knowing how to use git will save you some time.
Also use the resources in the Dream section in this site. It's been around much longer than the Magic and most dev topics are already covered in a lot more detail than in Sapphire rom development. Above all I think you need a lot of time on your hands and understanding wifes/girlfriends etc as a lot of reading is necessary!
You basically need a Linux distro to be able to do the most modding. Here are the port tools:
http://www.4shared.com/file/122118622/fd190fe1/PortTools.html
Here's a nice quide that you can use as reference:
1. Download the original Nandroid backup of the Rogers-Wiped from Skittleguy (http://forum.xda-developers.com/showpost.php?p=4029461&postcount=4).
2. Unzip Rogers-Wiped.zip and move boot.img to a directory called "Org".
3. Download nk02ion_r4_LITE-signed.zip and upzip it to a directory called "nk02".
4. Move boot.img out of the nk02ion_r4_LITE-signed directory into a directory called "temp".
5. Open your Terminal window and navigate to your "temp" directory.
6. Unpack the boot image inside the "temp" directory :
Execute : $unpack-H.pl boot.img
This should give you 2 new files : boot.img-kernel and boot-img-ramdisk.gz
7. Remove boot.img and boot.img-kernel from the "temp" directory by doing :
Execute : $rm boot.img
Execute : $rm boot.img-kernel
You should now have only one file called boot.img-ramdisk.gz in your temp directory.
8. Navigate to the "org" directory.
9. Unpack the boot image inside the "org" folder :
Execute : $unpack-H.pl boot.img
This should give you 2 new files : boot.img-kernel and boot-img-ramdisk.gz
10. Move the boot.img-kernel file from the "org" directory to the "temp" directory.
Execute : $mv boot.img-kernel ../temp/
11. Remove the "org" directory
12. Navigate to the "temp" direcory
You should now have 2 files inside the "temp" directory, boot.img-kernel and boot.img-ramdisk.gz
13. Create a directory called boot.img-ramdisk inside the "temp" directory :
Execute : $mkdir boot.img-ramdisk
14. Move inside the newly created boot.img-ramdisk directory :
Execute : $cd boot.img-ramdisk
14. Unzip the boot.img-ramdisk.gz file :
Execute : $gunzip -c ../boot.img-ramdisk.gz | cpio -i
15. Check that the ramdisk is unpacked :
Execute : $ls -l
You should now see a bunch of files
16. Remove the boot.img-ramdisk.gz file inside the boot.img-ramdisk directory :
Execute : $rm boot.img-ramdisk.gz
17. Navigate to the temp folder and also delete the boot.img-ramdisk.gz file :
Execute : $rm boot.img-ramdisk.gz
You should now have 1 file called boot.img-kernel and 1 directory called boot.img-ramdisk inside the "temp" folder
18. Repack the kernel and ramdisk to a boot.img file :
Execute : $repack-H.pl boot.img-kernel boot.img-ramdisk boot.img
You should now have a new boot.img inside the "temp" directory.
19. Move the boot.img file to the nk02 directory :
Execute : $mv boot.img ../nk02/
20. Remove the "temp" folder.
21. Navigate to the nk02 folder and check that you have 1 boot.img file and 2 directories (META-INF and system)
22. Zip the boot.img and the 2 directories into an nk02.zip file
Execute : $zip -r nk02.zip *
23. Sign the nk02.zip file :
Execute : $java -jar signapk.jar testkey.x509.pem testkey.pk8 nk02.zip update.zip
24. Push update.zip to your SDcard :
Execute : adb push update.zip /sdcard/update.zip
25. Boot the device in fastboot mode.
27. $fastboot boot recovery-RAv1.0H.img
28. Select "Wipe data/factory reset"
29. Select "Apply sdcard:update.zip"
30. Select "Reboot system now"
31. Enjoy nk02ion_r4_LITE on your HTC branded Magic.
Click to expand...
Click to collapse
The above guide shows you how to modify the boot.img and how to sign the updates. That's a good start...
ok this is a dumb question i imagine but how to i sign a zip file? i have already made my rom but it wont work because it says its not signed
thejesster said:
ok this is a dumb question i imagine but how to i sign a zip file? i have already made my rom but it wont work because it says its not signed
Click to expand...
Click to collapse
Here is the thread where signing is explained.
I am no expert, but I managed to use this to modify other ROM's (Adding wallpaper, ringtones and removing apps etc.)
Signing made easy thread

[Tutorial] How to port cf-root to other i9003 Firmwares [23/02/2012]

Tutorial for Porting Cf-root To Newer Firmware's
There were quite a few requests for a tutorial to create ginger bread cf-root. So here it is folks.
Big Thanks to skin1980 for helping me out.
Credits:
Chainfire for the cf-root.
Skin1980 for porting it to Samsung Galaxy SLCD.
Prerequisites:
Any Linux. Basic knowledge of linux is mandatory.
Tools for Unpacking and Packing images.
Base Samsung Galaxy SLCD Gingerbread Cf-root.
Samsung Galaxy SLCD Gingerbread Firmware ROM for cf-root creation.
Downloads & Setup
Any Linux: For this tutorial I am using Linux Mint KDE. You are free to use the Linux of your choice. Ideal starting point for downloading and installing Linux would be Distrowatch.com.
Tools for unpacking and packing images: These are sets of tools that allow you to unpack and pack boot images. Basically one requires just a few tools to achieve.
Link to Download: cfroot-tools.zip - 19 KB.
Download and exatract it into your home folder. It will create a cfroot-tools folder under home folder. Go to the folder and execute the following comand:
Code:
chmod +x *
Base Cf-root: Download any latest cf-root from this Link. Extract the normalboot.img from the cf-root tar file.
normalboot.img: Require normalboot.img extracted from downloaded Gb ROM.
Hex editor: You will require and Hex Editor. I am using bless hex editor. You can use any one which you are comfortable or the one available under your linux distribution.
Open terminal window and enter the following commands:
Code:
[FONT=Microsoft Sans Serif][SIZE=2]cd
[/SIZE][/FONT][FONT=Microsoft Sans Serif][SIZE=2]gedit ~/.bashrc[/SIZE][/FONT]
You can use any editor of your choice. The main purpose is to set the tools path. At the bottom of this file, add the following lines:
Code:
PATH=$HOME/cfroot-tools:$PATH
export PATH
Save and close the file.
Logoff from linux and login again for the new path to take effect.
The Actual Process
For the purpose of tutorial, I am going to use XXKPQ cf-root as the base and DDKP3 for creating new one.
Create a folder called “cfroot” with out the quotes under home.
Go to the created folder and create two more folders: DDKP3 and XXKPQ.
Now copy the normalboot.img extracted from XXKPQ cf-root and copy it into the XXKPQ folder. Next copy the normalboot.img fromDDKP3 firmware and copy it into DDKP3 folder.
Now go to the cfroot-tools folder under HOME and copy the decom.sh and recom.sh into XXKPQ and DDKP3 folders.
The above steps can be accomplished by the below code. Open command window and type the following:
Code:
cd
mkdir ~/cfroot
mkdir ~/cfroot/XXKPQ
mkdir ~/cfroot/DDKP3
cd ~/cfroot/XXKPQ
cp ~/cfroot-tools/*.sh .
chmod +x *.sh
cd ~/cfroot/DDKP3
cp ~/cfroot-tools/*.sh .
chmod +x *.sh
You need to press enter after each command.
From terminal window, first to change directory to XXKPQ, type the following commands:
Code:
cd ~/cfroot/XXKPQ
./decom.sh
After the execution of the above command, the following files and folders will be created:
normalboot.img-base
normalboot.img-cmdline
normalboot.img-pagesize
normalboot.img-ramdisk.gz => Ramdisk
normalboot.img-zImage => Kernel
Click to expand...
Click to collapse
Apart from these files, a folder called ramdisk will be created, into which the contents of normalboot.img-ramdisk.gz would have been extracted.
Now once more from the terminal window execute the following command:
Code:
cd ~/cfroot/DDKP3
./decom.sh
Also make note of the following values, which are shown, when the decom.sh script is executed.
Code:
BOARD_KERNEL_BASE 81800000
BOARD_PAGE_SIZE 00001000
Now under DDKP3 folder, edit the recom.sh file. Replace the value after --base with the value after BOARD_KERNEL_BASE. Replace the value after --pagesize with value after BOARD_PAGE_SIZE. Save the file.
Now we can switch to file manager. It will be easier to work using a file manager from here on. Open the XXKPQ/ramdisk and DDKP3/ramdisk folders separately in file manager.
Copy the folders res & sbin from base cf-root (XXKPQ in our case) and paste into DDKP3/ramdisk folder. Overwrite all when prompted.
Copy all the files under XXKPQ/ramdisk (in the root) to DDKP3/ramdisk.
From XXKPQ/ramdisk/lib/modules/2.6.35.7/kernel/ copy the fs folder into DDKP3/ramdisk/lib/modules/2.6.35.7/kernel/.
At this point of time, we no longer require the XXKPQ folder. So we can close the file manager window browsing XXKPQ folder.
Now comes the tricky and critical part. This must be done very carefully. We need to edit the .ko files using a hex editor.
Under the kernel/crypto/ folder, there is a pcbc.ko file, edit it using an hex editor. Search for 2.6.35.7 using find option in the editor. Now note down the six digit numbers starting immediately after 2.6.35.7-CL. In our case the magic number is 882023. Close the file and the editor.
Now we open the kernel/fs/ folder in the file manager.
Now open the mbcache.ko file in the hex editor. Search for 2.6.35.7 again. As we can see that the six digits after 2.6.35.7-CL is not 882023. In our case it is 709629. We need to change 709629 to 882023 and save the file. Different editors provide for different methods of editing. In my case I can just simply click on starting number that is 7 and start typing 882023 and save the file.
Now you need to do the same for two more files under kernel/fs/jbd2/ and kernel/fs/ext4/.
Now go back to ramdisk folder. Under ramdisk/sbin/boot/ there is a file called install.sh. We are now going to edit this file. This not important that you edit this file.
Edit the first line and replace XXKPQ with DDKP3.
Similarly under the “# Once be enough”, there is another XXKPQ which is to be replace with DDKP3.
Now save this file.
Now back to command prompt and execute the following commands:
Code:
cd ~/cfroot/DDKP3
./recom.sh
Executing the above script recreates the normalboot.img-ramdisk.gz, the normalboot.img and create DDKP3-CFROOT-16-02-2012.tar.
The DDKP3-CFROOT-16-02-2012.tar is the cf-root for DDKP3 and can be flashed using ODIN as Pda file.
*
Thats it folks. Hope my effort is worthwhile and benefits some of you.
*
Additional Links:
A text file Create Custom Rom (though not for our phone but is quite useful all the same) - Found it while searching google. Don't know who created it. But here is the link. Create_Custom_Rom.txt - 5 KB
The link to tools zip mentioned in the above text file. tools.tar.gz - 49 MB
Script to uncompress and compress UC Kernel
uc_decom.sh - 258 b
uc_recom.sh - 382 b
10 Chars ......
For Future Use
Whoa! This is huge! Awesomr work man! Thanks.
Edit - No offence meant, but it would be appropriate if the title is How to "port" or similar. Since it ws "created" by ChainFire and we just porting it.
ganeshbiyer is good, very patient, did not think that my trouble!
Has been helping me! Am very grateful!
great job! & i already translate it into chinese^^
and a problem:
after i run the script "decom.sh",it display following words:
[[email protected] xxkpq]# ./decom.sh
./decom.sh: line 5: unpackbootimg: command not found
gunzip: ../normalboot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
[[email protected] xxkpq]#
help me please~what's going on?
cRainin said:
great job! & i already translate it into chinese^^
and a problem:
after i run the script "decom.sh",it display following words:
[[email protected] xxkpq]# ./decom.sh
./decom.sh: line 5: unpackbootimg: command not found
gunzip: ../normalboot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
[[email protected] xxkpq]#
help me please~what's going on?
Click to expand...
Click to collapse
unpackbootimg must be in the path.
also it must be executable.
ganeshbiyer said:
unpackbootimg must be in the path.
also it must be executable.
Click to expand...
Click to collapse
sorry,i paste the wrong code. my problem is this:
[[email protected] XXKPQ]$ ./decom.sh./decom.sh: /home/chenyu/cfroot-tools/unpackbootimg: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
gzip: ../normalboot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
[[email protected] XXKPQ]$
cRainin said:
sorry,i paste the wrong code. my problem is this:
[[email protected] XXKPQ]$ ./decom.sh./decom.sh: /home/chenyu/cfroot-tools/unpackbootimg: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
gzip: ../normalboot.img-ramdisk.gz: No such file or directory
cpio: premature end of archive
[[email protected] XXKPQ]$
Click to expand...
Click to collapse
Need to install the missing file ld-linux.so.2
Sent from my GT-I9003 using xda premium
Thank you Ganeshbiyer! this is the tutorial for which send multiple private messages and never answered .. Thanks again, nowI can make a version for Gingerbread UBKPD.
goodbye
Yeah ganesh! A superb work..well done bro
thanks bhaiya....
Thanks for the tutorial buddy
Hope it has been useful.
_
Release all PERFECT! I had no problem in making the entire guide .. BUT ... when flashing in ODIN, and says that when it failed to finish.
I knew that I would be so easy, so I started to analyze both folders (my UBKPD and XXKPQ) and did not get that at the root of KPD I have 12 files and only 11 KPQ. The 12th file executable type KPD called RECOVERY. This file should remove it before using recom.sh?
Thanks again for the guide. goodbye
Edit2:
Well, my little patience led me to delete that file and then went back to RECOVERY recom.sh run and throw me error that could not erase normalboot.img and did not understand, but looking at the files in the root, not the size you normalboot.img was higher than the stock then replace the stock normalboot (+5 mb), run again and finally he created recom.sh cf.root, I flash with ODIN successfully without any problem in these +30 minutes.
Thanks (again).
Now I have as including UV & OC (freqmax 1100MHz is very good speed and would think you do not need more with this phone)
maybe a stupid question:
would it work with other phones as well? natually with the files of the other phone and not with the 9003 files
fabsau said:
maybe a stupid question:
would it work with other phones as well? natually with the files of the other phone and not with the 9003 files
Click to expand...
Click to collapse
Well you can always try
thanks for your reply
I will try it soon^^
wait for my next reply
greetings fabsau
i do it all at this tutorial and it create .tar fine without trouble.. i flash with odin also no problem happen.. but while device open.. at boot logo get stuck or freeze at long time.. why it happen???
i confuse with this line:-
-Copy the folders res & sbin from base cf-root (XXKPQ in our case) and paste into DDKP3/ramdisk folder. Overwrite all when prompted.
-Copy all the files under XXKPQ/ramdisk (in the root) to DDKP3/ramdisk.
-From XXKPQ/ramdisk/lib/modules/2.6.35.7/kernel/ copy the fs folder into DDKP3/ramdisk/lib/modules/2.6.35.7/kernel/
Click to expand...
Click to collapse
why do not copy all the file in ramdisk n skip copy file inside the ramdisk folder.. it is difference?? please tell me if i do a mistake.

[Guide/Tut] G2 DEODEXING APK IN 3 SIMPLE STEPS- ANY ROM- PERFECT DEODEXING

OF LATELY A LOT OF PEOPLE SEEM TO FACE DECOMPILING ISSUES POST DEODEXING, SOME DO NOT KNOW HOW TO DEODEX. SO I MADE THIS VERY SIMPLE YET 100% WORKING GUIDE. FOLLOW IT ANY ONE, I MEAN ANYONE CAN SUCCESSFULLY DEODEX ANY APK IN HIS G2 ROM [THIS METHOD WORKS PERFECTLY FOR OTHER PHONES AS WELL]
WHAT YOU NEED:-
1. TOOLS FOR DEODEXING:- DOWNLOAD HERE
2. FRAMEWORK FOLDER FROM YOUR PHONE [FOUND IN "/system" folder"]
3. APK AND ODEX FILE TO BE DEODEXED [eg. LGSystemUI.apk & LGSystemUI.odex]-Found either in [/system/app OR /system/priv-app]
LETS START:-
PREPARATION-
---Download and unzip the tools folder above to the folder c:\baksmali . Indtall 7zip utility from the tools as made available above.
---Place the entire "framework" folder in the c:\baksmali folder. Also place the apk and odex file to be deodexed in c:\baksmali folder.
---Open up a dos prompt in c:\baksmali folder ...
*STEP 1*
Type the following command:
HTML:
java -jar baksmali.jar -d c:\baksmali\framework -x nameofodexfile.odex
You will see that an out folder is created in the c:\baksmali folder
*STEP 2*
Type the following command:
HTML:
java -jar smali.jar -o classes.dex out
You will see that a file "classes.dex" is created in the c:\baksmali folder
*STEP 3*
-Open your apk file using 7zip utility.
-Simply Drag the classes.dex file and drop in the 7zip open window. Click YES.
-YOU HAVE SUCCESSFULLY CREATED THE DEODEXED APK FILE.
NOTE:
1. If during step 1 you get errors, it is likely that either the framework is different or apk & odex belongs to a different ROM.
2. Use 7zip as it is better and safe than winrar for handling apk files.
3. If above steps are followed, the chances of any errors are "0".
4. While decompiling apks use apktool 1.5.2. This handles smali files much better than 2.0.3 version.
I certainly hope this guide proves helpful to those intending to take up theming/modding... Best of Luck... If you have any concerns get in touch with me- I will gladly help....
Thank you XDA for this wonderful forum
Consider pressing thanks button if you find this tutorial helpful- It promotes development...
Hi, very good tutorial! Just what I needed. Thanks!
rastigo said:
OF LATELY A LOT OF PEOPLE SEEM TO FACE DECOMPILING ISSUES POST DEODEXING, SOME DO NOT KNOW HOW TO DEODEX. SO I MADE THIS VERY SIMPLE YET 100% WORKING GUIDE. FOLLOW IT ANY ONE, I MEAN ANYONE CAN SUCCESSFULLY DEODEX ANY APK IN HIS G2 ROM [THIS METHOD WORKS PERFECTLY FOR OTHER PHONES AS WELL]
WHAT YOU NEED:-
1. TOOLS FOR DEODEXING:- DOWNLOAD HERE
2. FRAMEWORK FOLDER FROM YOUR PHONE [FOUND IN "/system" folder"]
3. APK AND ODEX FILE TO BE DEODEXED [eg. LGSystemUI.apk & LGSystemUI.odex]-Found either in [/system/app OR /system/priv-app]
LETS START:-
PREPARATION-
---Download and unzip the tools folder above to the folder c:\baksmali . Indtall 7zip utility from the tools as made available above.
---Place the entire "framework" folder in the c:\baksmali folder. Also place the apk and odex file to be deodexed in c:\baksmali folder.
---Open up a dos prompt in c:\baksmali folder ...
*STEP 1*
Type the following command:
HTML:
java -jar baksmali.jar -d c:\baksmali\framework -x nameofodexfile.odex
You will see that an out folder is created in the c:\baksmali folder
*STEP 2*
Type the following command:
HTML:
java -jar smali.jar -o classes.dex out
You will see that a file "classes.dex" is created in the c:\baksmali folder
*STEP 3*
-Open your apk file using 7zip utility.
-Simply Drag the classes.dex file and drop in the 7zip open window. Click YES.
-YOU HAVE SUCCESSFULLY CREATED THE DEODEXED APK FILE.
NOTE:
1. If during step 1 you get errors, it is likely that either the framework is different or apk & odex belongs to a different ROM.
2. Use 7zip as it is better and safe than winrar for handling apk files.
3. If above steps are followed, the chances of any errors are "0".
4. While decompiling apks use apktool 1.5.2. This handles smali files much better than 2.0.3 version.
I certainly hope this guide proves helpful to those intending to take up theming/modding... Best of Luck... If you have any concerns get in touch with me- I will gladly help....
Thank you XDA for this wonderful forum
Consider pressing thanks button if you find this tutorial helpful- It promotes development...
Click to expand...
Click to collapse
when i unzip the tools zip the baksmali is a file not a folder so i cant add the framework to the file? not sure if you can help me further
jaymazz13 said:
when i unzip the tools zip the baksmali is a file not a folder so i cant add the framework to the file? not sure if you can help me further
Click to expand...
Click to collapse
you've to create a folder in c:\
then you rename this new folder baksmali
in this folder you have to unzip the file downloaded here
after unzipped
now you can put here your framework
It works great!
One question, how to odex again?

[Tutorial] NOOB-Friendly Instructions on Packing and Repacking system.new.dat file

I am a Windows user, and I was having quite the trouble unpacking and repacking system.new.dat files. I tried all sorts of Windows Chinese tools for the job, but no matter what I did, when I put the system.new.dat file and system.transfer.list file back into the flashable zip (even if I made no changes to the system.new.dat file... just unpacked and repacked), I would get an error flashing the file.
I finally got around this by installing Ubuntu 16.04 Xenial Xerus on VirtualBox. You can find a lot of tutorials online about how to do that. I am basing my instructions off of xpirt's tutorial on unpacking and repacking with the tools he provides. But it took me about 2 days to figure it out because I kept running into problems since some of the instructions made assumptions that the user knows how to use Linux. I am very new to Linux. I am not completely sure how to do *everything* from the command line, so if someone wants to add to my instructions to make it easier, please do so. But these are the things I did to figure it out.
So here are the noob-friendly Linux Ubuntu instructions on how to unpack and repack:
Section 1: Getting everything Ready
1. Download your flashable .zip rom. In my case, I downloaded cm-12.1-20150619-UNOFFICIAL-afyonltetmo.zip to my Ubuntu Desktop. You can download it to your Home Directory as well. Doesn't matter.
2. Download sdat2img. I downloaded mine to my Home Directory.
3. Download img2sdat. I also downloaded this to my Home Directory.
4. Extract all 3 zips, by right clicking on them and choosing 'Extract Here.' It will extract them into their own directories. The main directories that you need to pay attention to are /sdat2img-master/ and /img2sdat-master/
5. Download ext4fs either right into the sdat2img-master folder, or anywhere you want and then drag and drop it into the sdat2img-master folder.
6. Open Terminal, and install Python 2.7, if it's not already installed. Put
Code:
sudo apt-get install python-2.7 python-pip
Section 2: Beginning the Unpacking Process
*Note, you can copy and paste the codes; however, you can't use keyboard shortcuts in terminal. You have to right click and choose your option.
*Another note: Where you see "user" in the terminal commands, substitute it with your Linux username.
1. In your extracted folder from your flashable zip, right click on system.new.dat and system.transfer.list and choose 'cut.' Then paste them in the sdat2img-master folder.
2. Back in Terminal put
Code:
cd sdat2img-master
. That will get you into the right directory.
3. Now put
Code:
./sdat2img.py system.transfer.list system.new.dat system.img
. That will create your raw ext4 .img file.
4. You want to create an output directory for all the files that are in system.img. Put
Code:
mkdir output
5. Now you can mount system.img, and it will mount it into that output folder. Put
Code:
sudo mount -t ext4 -o loop system.img output/
6. You might have the problem that you don't have ownership of all the files (they have little "locks" on them). To gain ownership, put
Code:
sudo chown -R user:user /home/user/sdat2img-master/output
. If you still can't get read and write access, just try rebooting your Ubuntu virtual computer. That was the only thing that finally worked for me. You can start modifying stuff as you wish.
Section 3: Compress files back to a raw ext4 image
1. You are now going to need your file_contexts file from your original extract rom zip. COPY (not cut) and paste it into the sdat2img-master folder.
2. You are also going to need your 'make_ext4fs' file. Make sure it is in the sdat2img-master folder. You might have trouble with permissions, so just in case, put
Code:
chmod 777 /home/user/sdat2img-master/make_ext4fs
into terminal.
3. In Files (Ubuntu's "File Manager"), in the sdat2img-master folder, right click on your system.img file and go to 'Properties'. Notice the information in "Size." Ignore the GB, but look at the bytes. Mine is 2,411,724,800. Copy that number, but remove the commas. So mine is 2411724800.
4. Next is the actual compressing part. Put
Code:
./make_ext4fs -T 0 -S file_contexts -l 2411724800 -a system system_new.img output/
into terminal, but substitute '2411724800' with whatever size you got from the Properties in system.img. You will now how a new file called system_new.img.
Section 4: Converting ext4 (raw image) to img (sparse image)
1. Now you will need to install img2simg. In Terminal, put
Code:
sudo apt-get install android-tools-fsutils
2. Now you can put
Code:
img2simg system_new.img system_new_sparse.img
You will now have a file called system_new_sparse.img that is ready to be packed in a new dat file.
Section 5: Converting img (sparse image) to dat (sparse data)
1. Cut and paste your system_new_sparse.img into img2sdat-master folder that you made earlier.
2. Now you need to navigate to that folder in terminal. Put
Code:
cd /home/user/img2sdat-master
3. Now you can put
Code:
./img2sdat.py system_new_sparse.img
to create your new dat file. It will first ask you which Android version it's for. Enter the number corresponding and hit enter.
4. You're now pretty much done. As you'll see, it created 3 files: system.new.dat, system.patch.dat, and system.transfer.list. Just paste these files into your folder where your flashable zip files are, replacing any original ones in there. Make sure you also have your file_contexts file in there as well. Highlight all the files in there, right click, and zip them up. Then name your flashable zip whatever you want and try flashing!

Categories

Resources