apk reverse engineering - Java for Android App Development

Hello and congratulations for the forum.
I'm trying to recognize malware starting from static code android in particular in permissions.
When I try to decompile apps like WhatsApp unfortunately many strings are obscured, particularly getSystemService method arguments.
How can I do to make them readable?
thanks for your attention

How do you decompile?
Sent from my GT-S5360 using xda app-developers app

I use dex2jar to get source java code

It's illegal to do so

I am a researcher

How antivirus are developed without knowing virus signature?
We call it "Ethical hacking". Eg: SQL injection technique to assess security vulnerabilities of web app.
Sent from my GT-S5360 using xda app-developers app

there is not a way to decrypt string value in the source code please? Yes, this is for ethical hacking, of course

I want to catch whatsapp notification to analyze the text of the message in real time, for insert a routine I want to catch this event and I want decompile code

Franceso thought you would that little thanks button for supporting your views
Sent from my GT-S5360 using xda app-developers app

sure,
you can help me please?

This should be your answer:
dsgwords.blogspot.com/2013/03/android-runtime-class-loading.html?m=1#!/2013/03/android-runtime-class-loading.html
Also try decrypting input.jar in andriod services framework path
Sent from my GT-S5360 using xda app-developers app

practically to get the file. dex should I do
/ dx - dex - output = output.jar input.jar
and then use dex2jar and decompiler?
this way I can see all encrypted strings of WhatsApp?
Many thanks

This is what I wanted to do:
decompile WhatsApp
find the code snippet to send notification
before sending the notification to send the contents of the message to my program
and then send the notification normally
Do you think it possible?
When decompilo WhatsApp many strings are encoded in copdice source, this is my problem.

This in an example:
String[] arrayOfString = new String[2];
char[] arrayOfChar1 = "3&j&>;, =?&-` 3+z=><f]\027\003\027\[email protected]\013\036\034".toCharArray();
many many thanks

Good question. I have not tried decompile procedure. I wil refer my friend.
I suggest one thing. You compile a java piece of string code. Also a string array. Decompile and see. Then make apk. Decompile and see. You get difference then we see if we can apply any charcode standards like ascii.
Sent from my GT-S5360 using xda app-developers app

Please try below post friend
Did you try this:
http://androidorigin.blogspot.in/2011/02/dex-format-to-jar-format.html
Open Source
http://code.google.com/p/dex2jar/
http://code.google.com/p/smali/
and an example
http://code.google.com/p/smali/source/browse/examples/HelloWorld/HelloWorld.smali
Also I found string encrypters being used in java programs to defeat decompile or disassemble. Need to find out if whatsapp use any such algorithm like SHA. I leave it to you just research some more.
When I get time I will try for myself and let you know. Have official work thanks buddy.
(Mods please let me know instructions on posting outside urls or the rules pertaining to it.)
PS: Remember to use same java compiler version that used to compile whatsapp. After you get jar, you can check which version created edit.
To know go to:
jar file > Open with Winzip or WinRar (Any archiver Winrar preferred. Do not double click it will execute) -> META-INF directory -> MANIFEST.MF
You should see something like this
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_08-b03 (Sun Microsystems Inc.)
Hope that helps.

Use dex2jar to convert the APK into a standard JAR file and then JD-GUI to view the source code. However if the application was compiled with proguard obfuscation then you will have a very hard time to understand the code.

Related

[Q] .xml files

Ok I'm posting this in hope that a developer will answer.
I have been trying to edit .xml files on the droid x. I'm running linux (who runs windows anyway) I have experience in c++ and scripting , but non in themeing.
I have download a bunch of xml file editors. The problem is that every time I open one with the editor I get a error saying " coding not supported ". What ia the deal here and why? Does anyone have any suggestions or ideas why?
Thank you xda
The .xml files need to be decompiled first. Otherwise, they are unreadable. The only way I know off is to decompile the entire apk file with apk manager or aapt.
Note that you have to recompile the apk (xml) before putting it back on your phone.
GL
Thank you makes sense.
B-dub25 said:
Ok I'm posting this in hope that a developer will answer.
I have been trying to edit .xml files on the droid x. I'm running linux (who runs windows anyway) I have experience in c++ and scripting , but non in themeing.
I have download a bunch of xml file editors. The problem is that every time I open one with the editor I get a error saying " coding not supported ". What ia the deal here and why? Does anyone have any suggestions or ideas why?
Thank you xda
Click to expand...
Click to collapse
Still working with this myself. You need to look on google code for smali/baksmaling, as this is what is used to compress/decompress the xml files.
Thank you systemadmin that's what I thought I had to do, decompile the. Xml file ,but just didn't now how thank you for your reply.
No worries. I have been working on trying to theme and what not myself, and it seems pretty complex at the beginning. Im trying to get some tips from like bignadad, acidbath, and some of the other big developers out here, but they are usually pretty busy and I haven't had much luck. If you start making some progress, send me a PM and share the love =)
Sent from my DROIDX using XDA App

[Q] rebuild .apk after using dex2jar and jd-gui

Hello,
I'm trying to learn how to edit .apk files,
So after a bit of reading I got dex2jar working, and now I can see the actual code with jd-gui.
1. How can I edit the classes that are in jd-gui?
2. How can I repack everything to a .apk file?
Thanks.
I would suggest you learn to do basic stuff with the android ask, any questions pm me and ill be glad to help. Does dex2jar realty work, think I might take a look at that.
leoon said:
Hello,
I'm trying to learn how to edit .apk files,
So after a bit of reading I got dex2jar working, and now I can see the actual code with jd-gui.
1. How can I edit the classes that are in jd-gui?
2. How can I repack everything to a .apk file?
Thanks.
Click to expand...
Click to collapse
That's impossible. Only reading, no reassembling. For editing you need to learn Smali.
Sent from my GT-I9100 using XDA App

Is There Any Windows app to decompile APK files ?

Is There Any Windows app to decompile APK files ?
apktool, apkmanager.
I think just renaming the file extension from .apk to .zip will do it for you.
1. Wrong section to post this. There is a Q/A section for a reason
2. Depends on level of modifying you want done
a) Image editing (unzip/rezip)
b) Xml/smali editing (smali/baksmali/apktool/apkmanager)
c) Read "close to original" java code (dex2jar -> jd-gui)
i need to find ads code from a app and remove it
dadyal said:
i need to find ads code from a app and remove it
Click to expand...
Click to collapse
That's not really good for the developer considering quite often its his only source of mobile income and only motivation to keep improving the application.
Anyway, there is already an app that does so called Adfree i believe.
app is of my own website news feed but person who made this put a admob ads on the end of it and i need to repalce it with my own as i am going to upload it to market
ur chance do that almost 0%, forget it, get the original source code
ur questions tell us you are not pro coder, only waste ur time
i need a code example of ad mob ads

Need help with adding two android projects into one project

Hi I have 2 android projects in eclipse a subnet calculator and a data tester The problem is that they are in two different projects! I want to add the data tester one into the subnet calculator! The question is how do I do this?
I have tried almost everything I can think of!!
Please help!!
Thanks in advance!!
Rapsong11
That can be done only manually afaik. From where you want to move from one project to another you'll have manually create intents of fragment calls or whatever is needed. Copy-paste the needed classes to newly created packages etc, update your manifest, copy-paste layoutfiles etc etc. I know, quite some work but there is no automated process for this.
Zatta said:
That can be done only manually afaik. From where you want to move from one project to another you'll have manually create intents of fragment calls or whatever is needed. Copy-paste the needed classes to newly created packages etc, update your manifest, copy-paste layoutfiles etc etc. I know, quite some work but there is no automated process for this.
Click to expand...
Click to collapse
Thanks for the reply!! would you mind showing me how to do this? via team viewer?
please let me know
Rapsong11
rapsong11 said:
Thanks for the reply!! would you mind showing me how to do this? via team viewer?
please let me know
Rapsong11
Click to expand...
Click to collapse
He means copy the src of project1 to src of project2
res/ of project1 to res of project2
Donot overwrite
For files with same name copy the contents manually
Sent from my GT-S5302 using Tapatalk 2
rapsong11 said:
Thanks for the reply!! would you mind showing me how to do this? via team viewer?
please let me know
Rapsong11
Click to expand...
Click to collapse
I'm not in the situation I can do it. But also I don't want to do it and you shouldn't want to do that either.
I got everything over no errors and when you are at the main menu I have two buttons one that says subnet calculator and one that says network tester when you click the network tester button it works when you click the subnet calculator button the app crashes what am I doing wrong please let me know
Sent from my Nexus 4 using xda app-developers app
Nevermind I figured it out
Sent from my Nexus 4 using xda app-developers app
The best way to do this is to use maven projects instead standard android projects. Both projects can be children projects of superpom (maven parent project). Search for maven-android-plugins for more details.
Cheers
Sent from my SK17i using xda app-developers app

Creating a modded apk

Hello everyone.
I'm trying to start to make some mods in some applications but I'm not sure where to start, mainly because i'm in Linux.
For Windows I know about dnSpy which allow us to decompile, edit, compile etc etc apk files!
Is there any applications for Linux to do the same job?
HorusEyE said:
Hello everyone.
I'm trying to start to make some mods in some applications but I'm not sure where to start, mainly because i'm in Linux.
For Windows I know about dnSpy which allow us to decompile, edit, compile etc etc apk files!
Is there any applications for Linux to do the same job?
Click to expand...
Click to collapse
APK Studio :good:
guitardedhero said:
APK Studio :good:
Click to expand...
Click to collapse
Ok, I have already that application installed, but it keeps telling me that I should have some 3rd party applications in my "vendor" folder. What applications are those? I already tried to copy into that folde "adb" and also the applications that comes with APK Tool, but it still shows the same warning. And I cannot edit dll modules with APK Studio as I can with dnSpy!
HorusEyE said:
Ok, I have already that application installed, but it keeps telling me that I should have some 3rd party applications in my "vendor" folder. What applications are those? I already tried to copy into that folde "adb" and also the applications that comes with APK Tool, but it still shows the same warning. And I cannot edit dll modules with APK Studio as I can with dnSpy!
Click to expand...
Click to collapse
I use apktool and smali/baksmali...no studio needed. It is also a good idea to have old and new versions of smali/baksmali (I use 1.3.3 and 2.1.3) because some mods you download the smali files will be in old code format. So I smali them into classes.dex with the 1.3.3 and then baksmali with 2.1.3 to convert old code to new before merging with your apk.
Sent from my SM-T210 using Tapatalk
RealWelder said:
I use apktool and smali/baksmali...no studio needed. It is also a good idea to have old and new versions of smali/baksmali (I use 1.3.3 and 2.1.3) because some mods you download the smali files will be in old code format. So I smali them into classes.dex with the 1.3.3 and then baksmali with 2.1.3 to convert old code to new before merging with your apk.
Sent from my SM-T210 using Tapatalk
Click to expand...
Click to collapse
Ok, thanks
I have downloaded version 2.2.0 of smali and baksmali and also a zip containing (i hope, smali and balsmali) version 1.3.3 of the same application! Is there any basic tutorials to teach how to start with these applications?
apktool
https://youtu.be/1t5n8rR5hTE
Smali/baksmali
https://forum.xda-developers.com/showthread.php?t=1296802
Sent from my KYOCERA-C6745 using Tapatalk
RealWelder said:
apktool
https://youtu.be/1t5n8rR5hTE
Smali/baksmali
https://forum.xda-developers.com/showthread.php?t=1296802
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
Ok, after I have decompressed/decompiled/whatever the apk file I need to edit a file that is a dll module! It has some like c# or so code. How can I edit these files, change them and compile the file again???? Some use dnSpy and when the dll file is opened, we can see a lot of code, functions and stuff. How can I do that without dnSpy because looks like there is no linux version of dnSpy.
HorusEyE said:
Ok, after I have decompressed/decompiled/whatever the apk file I need to edit a file that is a dll module! It has some like c# or so code. How can I edit these files, change them and compile the file again???? Some use dnSpy and when the dll file is opened, we can see a lot of code, functions and stuff. How can I do that without dnSpy because looks like there is no linux version of dnSpy.
Click to expand...
Click to collapse
I've never had to edit dlls. Are you trying to hack a game? Anyways, on windows I use Notepad++, but on Ubuntu I use Notepadqq.
Sent from my KYOCERA-C6745 using Tapatalk
RealWelder said:
I've never had to edit dlls. Are you trying to hack a game? Anyways, on windows I use Notepad++, but on Ubuntu I use Notepadqq.
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
Yes, I was trying to create my own modded version of a game! I usually use Atom, but I already tried to open DLL files with Atom and it doesn't work!
Do I have that Notepadqq for Debian?
HorusEyE said:
Yes, I was trying to create my own modded version of a game! I usually use Atom, but I already tried to open DLL files with Atom and it doesn't work!
Do I have that Notepadqq for Debian?
Click to expand...
Click to collapse
I`ve been trying to figure out why do you want to "create a modded apk" and according to your last post , you`re trying to bypass functionalities of an original game
This kind of thread / discussion isn`t allowed on XDA according to rule 6
6. Do not post or request warez.
If a piece of software requires you to pay to use it, then pay for it. We do not accept warez nor do we permit members to request, post, promote or describe ways in which warez, cracks, serial codes or other means of avoiding payment, can be obtained or used. This is a site of developers, i.e. the sort of people who create such software. When you cheat a software developer, you cheat us as a community.
Thanks for understanding
Thread closed

Categories

Resources