[Q] Create .pk8 from testkey.x509.pem file - Android Q&A, Help & Troubleshooting

Hello,
I need a specific key for sign update.zip for android device. In this device, i've find a file x509.pem, containing the sentences "-----BEGIN CERTIFICATE-----" with a long key, and at the end : "-----END CERTIFICATE-----".
But, i need a pk8 file for sign my zip and i don't know how i can to proceed for do that ...
I've read documentation on "openssl pkcs8" tool, but i can't to convert my x509.pem to .pk8 .(I'm just a beginner).
Thanks for your help.

Related

Android's .so files

OK, So I've gotten to breaking down and recompiling those pesky .dex files, but I've run into a new problem.
This is a noob question, I'm sure, but .so files look like unformatted, binary files. How do I open then, edit them, etc? I need to read whats going on in my libs. :-(
Are these X11? I'm running ubuntu 10.04 x64 - so those could be difficult.
ie - unreliable 64 bit support.
$ sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so
Click to expand...
Click to collapse
They're native library files, so platform specific machine code I imagine. Look for an ARM disassembler. I'm not familiar with linux internals, so don't know how you find the entry points, but it obviously will be widely documented. Is it impossible to obtain the source code? Assuming most are written in C/C++, reverse engineering from the machine code is not something I'd describe as a pleasant experience. If the source was well written assembly language & not too big, it can be almost enjoyable I guess. But then TBH walking through a randomly selected programmer's source, let alone object, files scares me, in a Tim Burton inspired bad trip kinda way. If you can find the source, it will be an order of magnitude less painful.
Try IDA Decompiler, it should disassemble all so files!
Most of the libs are open source in the aosp. Some are proprietary blobs with the only solution to them being reverse engineering.
.so disassembly
i know how to disassemble it
you will need orion's easy apk disassembler and apk manager
i've tested it once and it worked, but there´s a problem, i dont know how to re-assemble
1- rename the file .so to .apk like "libtestlib.so" to "libtestlib.apk"
2- put in the folder "place-apk-here-for-modding" of apk manager
3- open script.bat (or something like this) from Apk manager
4- use extract apk option
in the beggining my images inside the lib was corrupted so i used step 5 to fix
5- use option optimise images inside to fix images
6- go to project folder and copy classes.dex file to the root of easy apk disassembler's folder
7- open EasyApkDisassembler.EN.bat and use the "DISASSEMBLY a classes.dex with smali" option
8- give a name to the folder (like "libtestlib")
9- it will create a folder (like "out_libtestlib") with the disassembled files
Orion's easy apk disassembler http://forum.xda-developers.com/showthread.php?p=5826401
Apk multi tool (almost the same as apk manager) http://forum.xda-developers.com/showthread.php?t=1310151
I've tried to open libsurfaceflinger.so from my device with 7zip, and it worked too
thats it
@gkillershots
not working
i renamed .so to .apk and used extract option but getted error :
Processing archive: C:\APKMultiTools\place-apk-here-for-modding\libnative-lib.apk
Error: Can not open file as archive
"An Error Occurred, Please Check The Log (option 26)"

[Q] ApplyRecovery.bat

this is gonna sounds stupid but i followed every step but i cant seem to get the file to be only ApplyRecovery.bat, thats how i named the files but it does only open notepad....like if it was reading ApplyRecovery.bat.txt
Step 5: create a text file using notepad, called ApplyRecovery.bat. Make sure it is not named "ApplyRecovery.bat.txt" . It will contain the following lines (copy/paste is fine)
i did it finally
For future reference, it might help others if you explained how you solved your problem. For example, given this issue where the file is opening in notepad, one of the following possibilities is apparent:
1. When saving the file, you did not enclose the file name in quotes, e.g. "ApplyRecovery.bat". Enclosing the file name in quotes overrides the automatic generation of extensions and saves the file exactly as you wish.
2. Batch files, files ending in .bat, were set to open in notepad instead of being ran when double-clicked. This would by necessity require you to delete the file association before the batch file would work.

[TOOL][DEV][LINUX ONLY] Fast java src decompiler

Hello !!!
I'm not a real developper but I manage to make a little tool FOR DEVS to accelerate java src decompile
I don't know if it can be useful, but I wanted to share it ...
I don't really create something, all the tools already exist, you know them all :
JD-GUI : Java decompiler
Dex2jar : useful tool to transform .dex in readable .jar to get java src
Why did I made this ?
I searched how to get java src, useful to build apk or even compile sources, but only found manual way.
Ok decompiling one or 2 files is not a big deal ... but when you need to decompile a whole rom ......
What can this tool do ?
getting the java src from an apk and / or a .jar (framework.jar for eg) dex2jar and jd-gui already allow it
can decompile several files (.jar and or .apk)
rename each file to is native name
How to use it ?
This tool only works on Linux
Download attached zip or here
Unzip the file in home folder The folder must be in home and musn't be renamed or it won't work properly
launch the dex.sh (double click in graphic or use ./dex.sh commande in terminal)
Follow the instructions
.classes files need to be associated to JD-GUI use this programm. If you don't know if they already are or not, don't worry let the command do it ...
For more information, I included lines to make .jar files open by JD-GUI.
If you don't need / want these files to be associated after you use this tool type in terminal
PHP:
cd ~/.gnome2/nautilus-scripts
sudo rm open-in-jd-gui.sh
This tool is not perfect ... firstly I made it for me ....but finally wanted to share it ...
if you like it just tell me and use it ... if you don't .... ok just tell me why I would improve it ...
Huge thanks to :
JD-GUI Developpers : http://java.decompiler.free.fr/?q=jdgui
DEX2JAR Developpers : http://code.google.com/p/dex2jar/
tommytomatoe : for his wonderful Android Utility and for the command lines that helped me more than a lot !!! :good:
this is really useful
especially to decompile stock sony jar/apk to port some java classes from their frameworks
@Tof37
Bro, please reupload file, link is down
Thanks
EDIT:
sorry, i am dumb. THX a lot!

certificate in ota rom

there are 2 important certificate in ota rom file
1:com.sony.tablet
this is sony's ket to sign rom files,you can get it this way
unzip file rom\META-INF\CERT.RSA
rename to cert.rsa.p7b
double click to open
in system certmgr,you can find certificate file
this file only have public key,use to verify file.
only with private key,you can sign new file.
2:test key
in rom\system\etc\security\otacerts.zip\testkey.x509.pem
to open it,just change ext name to .crt,windows will open it
you can also file this key in allinone\files\,and it's private key .pk8
aio use this key to resign custom rom.you can flash custom rom with condi fixed recovery.
View attachment cert.zip
last,there are many other certificate in system\etc\security\cacerts
to open in windows,add ext name .crt
but it's not important
-----------------------------------------------------------------
PS:the rule of sign apk/zip file
android sdk have file signapk.jar to sign file.
it does:
1,calc sha1 hash for all files in zip,write it to MANIFEST.MF
2,calc sha1 hash for manifest,write to CERT.SF
3,write public part of certificate to CERT.RSA
4,append sign data at last of zip file

how to view edit Smalli codes any android app hacking

hacking or cracking an android app is a easy part with XDA AUTO TOOL ..
search and download and install this tool ..
Process
Step One – Decompiling The APK File
Open the xdaAutoTool folder and run the program. It will prompt you to install a file called “framework-res.apk.” Ignore this. Close the program.
In the xdaAutoTool folder you we see a bunch of folders appear after the program ran. Look for one called “_INPUT_APK.” Put your APK file in the folder and run the program again. Press “Decompile All” located on the left side of the program window.
xdaAutoTool will decompile the APK file and create a new directory in the _INPUT_APK folder.
Step Two – Finding Your Target
Are you ready to be introduced to Smali code? Don’t worry! It isn’t too difficult once you realize what’s going on in the code. Java can’t be decompiled back into the original source code, it can, however, be decompiled into something called Smali code.
Navigate back to the _INPUT_APK directory and open the new folder (it will have the same name as the APK file). Once there, you will see a directory named “smali.” This is your target. Depending on your intentions, you will need to sift through the various files and folders in the smali directory until you locate the code you would like to modify.
For example, if you are trying to increase the firepower of a turret in an Android game, you will need to find the file for that turret. These directories are structured. You will probably see quite a few directories containing files used for advertisements, etc. One you discover the actual game directory, everything you need to alter will be in there.
How to change smalli code
now again open xda auto tool after edit changes and recompile and build your changes
You done ..........

Categories

Resources