Related
Looking for a program to convert .JAR to .APK so I can install programs/games on G1
The progam/app at http://www.netmite.com/android/ automatically converts .JAr to apk, but only does so from the Web, and I've tried to direct its url option to a a .JAR I've web hosted and it doesn't do anything, doesn't download the file or anything.
The sites that it gives you to choice from under its menu option suck, and don't allow files to be uploaded, most of the files don't support touch screen and don't work well with the G1's front soft keys.
J2ME MIDP Explorer just needs an option to install/ convert from the sd card
I've got a bunch of Java midlets on my PC and I want to get them to my G1 or at least play around with them in the emulator.
Any ideas?
Thanks
Maybe this is in the wrong Forum? Mods any thought?
Thanks
Dalamak said:
Maybe this is in the wrong Forum? Mods any thought?
Thanks
Click to expand...
Click to collapse
You can't just convert a jar to an apk. It has to be compiled for android. Android's java library doesn't have all the swing stuff that's in normal java, so the app most likely would have to be re-written to work on android
JesusFreke said:
You can't just convert a jar to an apk. It has to be compiled for android. Android's java library doesn't have all the swing stuff that's in normal java, so the app most likely would have to be re-written to work on android
Click to expand...
Click to collapse
Pretty sure MIDlets (MIDP jars) don't use Swing or awt. They have a separate user interface api under javax.microedition.lcdui
As for converting MIDP programs to runnable APKs, there is certainly a way. Technically it isn't a conversion but the use of a wrapper around the unconverted MIDlet. This is the approach that Opera Mini for Android uses. More info:
http://labs.opera.com/news/2008/04/10/
From the same article:
"The only major task was to replace the AWT/Swing graphics backend of MicroEmulator with Android specific APIs."
Id quite like this to work with bloover, though the blue tooth support needs to be extended in the g1, headset only. I want to send files!!
JesusFreke said:
From the same article:
"The only major task was to replace the AWT/Swing graphics backend of MicroEmulator with Android specific APIs."
Click to expand...
Click to collapse
Right since MicroEmulator is a J2SE program, it uses Swing/awt classes. Since the heavy lifting of porting MicroEmulator to Android has already been completed, you don't have to worry about it. Theoretically, anyway.
Compiling MicroEmu for Android and running a Sudoku game:
http://microemu.blogspot.com/2008/11/running-java-me-applications-on-android.html
i try to use netmite to conver some jar file frome my web site
there is no garanty to aonverted java file work good in android but all of converted jar file all runing and then maybe it (work/crash/or slow)
Try UpOntek - jar to apk conversion service which includes optimization tips for your app.
veda_sticks said:
Id quite like this to work with bloover, though the blue tooth support needs to be extended in the g1, headset only. I want to send files!!
Click to expand...
Click to collapse
use the program blutooth file transfer
Hi All, I am new when it comes to windows mobile apps and I was wondering if anyone could help.
I have an application on my mobile which almost does everything I want. There are a few extra features I would like it to do and would like to have ago at creating them myself. Is there away that you can unpack a windows mobile app (like the exe file) to visual studio for editing or is this not possible?
Many Thanks
Windows Mobile EXEs are like any other windows executable files... These are binary compiled programs that you cannot just "edit" in a text editor.
If the program you want to modify is Open Source and if the software author allows to do so, then you'll have to modify the source, recompile the software and test it.
Basically, it's regular programming...
ok thanks for the help.
if it's .net then you can try giving reflector a go it can make .net exe's to c# code
Yup, but what you'll get won't always be understandable... If the software author obfuscated the code for example..
[Introduction]
So i wanted to poke around some android app and while at it get some idea about android/java reversing.
I've never dealt with java or android to any significant degree, all the more interesting stuff to discover.
I think what i discovered over past couple of day could be usefull to your community so i decided to share it.
Seems like it's a generally accepted fact on android scene that it's impossible to modify .class files at high level, as in by modifying their decompiled .java sources and everyone goes about it through disassembly to dalvik instructions(or perhaps smali is a bit higher level representation) and whatnot and then reassembling, using decompiled code just for reference...
When talking about programming languages/systems that compile to pseudo-code that's later jitted or translated into native code, i've dealt with something similar before
once before when i poked around flash/actionscript 3 reversing, while there were decompilers for actionscript 3 available and particular swf wasn't even obfuscated it wasn't really possible to use decompiled output to make some small changes to significally large project cause of decompiler errors, as in flash you have to compile it all at once or not at all.
There also existed tools that enabled disassembling to as3 AAVM opcodes level, making changes if you can wrap your head around that bytecode language and reassembling back.
But who is fluent in as3 or java or dalvik VM bytecode language except their creators and why would they be? Sure small changes are possible but a pain even at that...
When by some chance i ended up prodding some java i remembered hearing that people are making that Minecraft mods and they don't have original full sources, they just replace/add classfiles to minecraft.jar.
I though "hey that should be possible for android apps" and driven mostly with reverse-engineering curiousity set out to check my hypothesis.
Turns out there's no such thing as "android compiler", since android build process uses javac standard java sdk compiler and java allows compiling single class files and linking against .jar file containing compiled .class files as a library.
Requirements:
1. Dex2jar
2. Android adt bundle
3. Java jdk 1.7
4. Optional : apktool
The guide itself
1. Run dex2jar yourapp.apk
2. Use jd-gui or whatever to get source code of .class file you're interested in inside that apk.
Take note that decompilers don't always produce outright recompilable code
Simplest example jd-gui produces outputs that imports R.strings etc, while javac want it to be a single R import
You can try different java decompilers or fix up the code yourself. Some .class files most decomilers will fail to tackle but those are a minority.
If app is not proguarded it's mostly at your mercy.
3. Modify .java source code of class as you see fit.
4. (optional) You can also do some layout, drawable etc editing(obtained from apktool or whatnot) in a comfortable way if you re-import res folder contents into Eclipse project res.
5. Download android sdk stuff for android api version your app was made for with adt sdk manager tool You're interested particularly in android.jar library, perhaps andorid-support.jar. Maybe you can link against newer library versions, dunno. For my app developer stated minimum required android version so i linked against that jars, but as to how to find out what android version app requires, you can look at android folder in your undexed jar, android\support\v4
v4 = android api 4, android 1.6 version
6. javac -target 1.6(this is not android 1.6, it's java bytecode and source compliance, by default current jdk 1.7 produces "invalid magic cafebabe" error later from dx) -source 1.6 -classpath path_to\classes.jar(obtained from dex2jar);path_to_android_adt\sdk\platforms\android-(required version)\android.jar;(maybe include android-support classpath, worked for me without) path_to\your_modified_class(but named same as originally).java
Like
C:\Program Files\Java\jdk1.7.0_25\bin\javac -target 1.6 -source 1.6 -classpath C:\Users\User\Desktop\testapp\classes.jar;E:\adt-bundle-windows-x86-20130717\sdk\platforms\android-4\android.jar C:\Users\User\Desktop\testapp\someclass.java
If you fed javac valid java code it'll spit out valid .class file, otherwise read it's error output and perform steps to fix that errors.
7. Plug your newly created classfile back into it's jar, use winrar, windows explorer(by renaming it to zip) or whatever.
Javac can produce a differently fragmented classfile than one originally in jar so you may want to delete yourclassname.class
yourclassname$1.class yourclassname$2.class yourclassname$3$1.class ... from jar first.
8. Now it time for our java bytecode to go Dalvik
Dx your updated jar
E:\adt-bundle-windows-x86-20130717\sdk\build-tools\17.0.0\dx.bat --dex --no-optimize --output classes.dex classes.jar
9. Plug your updated classes.dex back into original apk
Delete META-INF folder from apk to "unsign" it while you're at it.
10. Re-sign apk with
C:\Program Files\Java\jdk1.7.0_25\bin\keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
C:\Program Files\Java\jdk1.7.0_25\bin\jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name
11. Zipalign
E:\adt-bundle-windows-x86-20130717\sdk\tools\zipalign\zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
12. Install modified apk
This whole thing relies on the fact that while fully recompilable autmatic decompilation of java project of any complexity isn't feasible like always, decompilers are capable of producing large portion of mostly correct code, and java allows you to recompile exclusively that parts you're interested in which could very well end up being correctly decompiled outright or require just minor fixups and you don't have to deal with the fact that your decompiler produced thousands of errors in OTHER classfiles that your class depends on.
I guess even in case target app is obfuscated/proguarded having ability to deal with it on .java level and not disassemly level could still be of great benefit.
thankfull for your efforts dude ...!!!
You did great job...
I have one problem i know how to convert .dex to .smali
but dont get that how to convert .smali to .java source code
i have read ur post after 4th point i dont get ur post can u please explain it deeply
I m new at xda as well in android I want to modify online game for that i want to convert that apk into java source code and then modify it please help
thankyou....!!!
:good::good::good::good::good::good::good:
---------- Post added at 09:28 PM ---------- Previous post was at 09:24 PM ----------
can u make a video tutorial for this project????
i m pressing thank button for your efforts...!!!!
:laugh::laugh::laugh:
Thanks man! That's what i have been looking for
@aashishb4u It's a bit late to answer this question maybe, but anyways...
I don't think there is a smali to java convertor out there, but anyways, you would not need it.
You can get the .jar with "dex2jar" (and then get the .java file after decompiling it with "jd-gui", for example) directly from the classes.dex file, as for the smali code. Which means converting this outputed .smali to .java would not give you more information than the converting .dex to .java (as we usually do), if not less, since it would just add 1 more intermediate than needed.
By the way, thanks for this post @Wrongusername, it was really what I was looking for.
Hello
I am new to this , how do you extract classes.cdex from zip files of stock rom
Bytecode Viewer is an Advanced Lightweight Java Bytecode Viewer, GUI APK Decompiler, GUI DEX Decompiler, GUI Procyon Java Decompiler, GUI CFR Java Decompiler, GUI FernFlower Java Decompiler, GUI Jar-Jar, Hex Viewer, Code Searcher, Debugger and more.
It's written completely in Java, and it's open sourced. It's currently being maintained and developed by Konloch.
There is also a plugin system that will allow you to interact with the loaded classfiles, for example you can write a String deobfuscator, a malicious code searcher, or something else you can think of.
You can either use one of the pre-written plugins, or write your own. It supports groovy, python and ruby scripting. Once a plugin is activated, it will execute the plugin with a ClassNode ArrayList of every single class loaded in BCV, this allows the user to handle it completely using ASM 3.3.
Key Features:
APK/DEX Support - Using Dex2Jar and Jar2Dex it's able to load and save APKs with ease!
Java Decompiler - It utilizes FernFlower, Procyon and CFR for decompilation.
Bytecode Decompiler - A modified version of CFIDE's.
Hex Viewer - Powered by JHexPane.
Each Decompiler/Viewer is toggleable, you can also select what will display on each pane.
Fully Featured Search System - Search through strings, functions, variables and more!
A Plugin System With Built In Plugins - (Show All Strings, Malicious Code Scanner, String Decrypters, etc)
Fully Featured Scripting System That Supports Groovy, Python And Ruby.
EZ-Inject - Graphically insert hooks and debugging code, invoke main and start the program.
Recent Files & Recent Plugins.
And more! Give it a try for yourself!
Code from various projects has been used, including but not limited to:
J-RET by WaterWolf
JHexPane by Sam Koivu
RSynaxPane by Robert Futrell
Commons IO by Apache
ASM by OW2
FernFlower by Stiver
Procyon by Mstrobel
CFR by Lee Benfield
CFIDE by Bibl
Contributors:
Konloch
Bibl
Fluke
Righteous
sahitya-pavurala
priav03
Afffsdd
Website: https://bytecodeviewer.com
Source Code: https://github.com/konloch/bytecode-viewer
Bin/Archive: https://github.com/konloch/bytecode-viewer/releases
Java Docs: https://the.bytecode.club/docs/bytecode-viewer/
License (Copyleft): https://raw.githubusercontent.com/Konloch/bytecode-viewer/master/LICENSE
Report Bugs (or below): https://github.com/Konloch/bytecode-viewer/issues
__________________________________________________________________________
Thanks for the hardwork, Will try it out...
Congrats!!
A "must-have" tool for sure... Thanks for your hard work!!!
Thanks! If any of you have any questions, or have a suggestion just reply here and I'll answer asap.
2.6.0 is out now! The biggest feature is smali editing. You can download it here https://github.com/Konloch/bytecode-viewer/releases/tag/v2.6.0
2.9.0 is released, contains LOTS of improvements for android APKs! If you've tried BCV in the past I urge you to try it again, you'll love the updates.
Konloch said:
2.9.0 is released, contains LOTS of improvements for android APKs! If you've tried BCV in the past I urge you to try it again, you'll love the updates.
Click to expand...
Click to collapse
I tried the v2.9.2 today, but was unable to make it work properly.
Used OpenJDK/JRE 7, 8, 9 on a ubuntu 14.04 with no success.
I get a blank window - I can open a file with control + o, but each time the app gives a message about not finding the temporary file which is supposed to be created (but isn't) in /home/user/.Bytecode-Viewer/bcv_temp/
I don't have any spaces in my path.
I see dex2jar running on the apk, but nothing gets created in the bcv_temp
I tried with different apks with no success.
I can decompile my apk just fine with jadx & apktool.
adwinp said:
I tried the v2.9.2 today, but was unable to make it work properly.
Used OpenJDK/JRE 7, 8, 9 on a ubuntu 14.04 with no success.
I get a blank window - I can open a file with control + o, but each time the app gives a message about not finding the temporary file which is supposed to be created (but isn't) in /home/user/.Bytecode-Viewer/bcv_temp/
I don't have any spaces in my path.
I see dex2jar running on the apk, but nothing gets created in the bcv_temp
I tried with different apks with no success.
I can decompile my apk just fine with jadx & apktool.
Click to expand...
Click to collapse
would you be able to add kalenkinloch on Skype to help me debug this issue more?
Bytecode Viewer on Android?!
Looks like an amazing tool!
Any chance it could be released as an Apk to run directly on Android devices?
Not having a PC and so using Show Java (com.njlabs.showjava) and AIDE (com.aide.ui).
Would be most interested to add Bytecode Viewer to my tool case!
Thank you!
Is there a quick start guide of sorts for this? Recompiling .java files seems promising as I am trying to disinfect a custom lockscreen APK to no avail.
And would it be possible for this to interface with the Android Studio/SDK, especially in case you're more comfortable with editing .java sources instead of having to decipher lines upon lines of bytecode?
I recommend using version without demo apps, its smaller. But if you want to try demo apps to test if is JRE working, use version with demo apps.
This app provides a complete Java Runtime Environment (JRE) for Android devices. This JRE include a Java Virtual Machine (JVM) and Java SE 7 class library APIs. This enables running standard Java SE 7 desktop applications on Android devices. This includes Java applications that use Swing and/or AWT graphical user interfaces.
You need to be logged in google account to run this app.
The JRE is capable of running any "pure Java" applications. If the Java application includes/requires application JNI libraries then these native libraries will need to be rebuilt (compiled/linked) with the Android Native Development Kit (NDK).
Using this App to successfully run a specific Java application, will require some basic knowledge of using a JRE. For example you will need to copy the application JAR files to the device's file system and then configure a command line to launch the Java Virtual Machine (JVM).
The following is a list of limitations in the current release.
- Java Applets embedded inside Android web browser are not supported. (There is an Applet viewer included that can be used to run Java Applets standalone)
- JavaFX is not supported.
- Only supported on Android devices with an ARMv7 processor.
The following is a subset of Java applications that currently will NOT run on this app due to missing JNI libraries.
- Minecraft for PC
** Java is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Click to expand...
Click to collapse
Java JRE without demo apps
Java JRE with demo apps
Update: links removed. Moderators not allowed this app, because it is moded JRE4A with crack. I will upload it somewhere else, and here will be Tutorials what write to google, to find it.
Sony Xperia Z3 Stock 6.0.1 - Not working :crying:
gouster3 said:
I recommend using version without demo apps, its smaller. But if you want to try demo apps to test if is JRE working, use version with demo apps.
Click to expand...
Click to collapse
While this sounds great, could you give a few more details:
Did you write this yourself?
Why is a Google account required?
How do AWT/Swing work? Don't they usually use native widgets? What does your JRE use instead?
FD_ said:
While this sounds great, could you give a few more details:
Did you write this yourself?
Why is a Google account required?
How do AWT/Swing work? Don't they usually use native widgets? What does your JRE use instead?
Click to expand...
Click to collapse
It is JRE4A with removed trial limit, and moded popups to be more user friendly. For example popup with buy, reedem, tral is modded to: Welcome to JRE, OK button have trial button function, other buttons removed. Then dialog this is trial version and will work only one minute... is changed to press ok to start java app. Title changed from jre4a to java, and icon changed to java icon.
Google account is required because of jre4a licencie checking. You dont need to have buyed jre4a, but without account app crashes. It is a bug.
And please removed links from quotes.
Soon i will post guide how to find this files on google
No you will not. Cracked apps and warez are not allowed in anyway on xda. Nor are you allowed to tell people how to find it.
Thread closed