Java to smali (NOT smali -> java) - Java for Android App Development

Hey! I've been searching around the web very long time now and I haven't found any answer to this.
Sorry if there is an answer, please tell me or link me if so!
I want to converty my .java file to a .smali file, is that possible? If so, how?

addemod said:
Hey! I've been searching around the web very long time now and I haven't found any answer to this.
Sorry if there is an answer, please tell me or link me if so!
I want to converty my .java file to a .smali file, is that possible? If so, how?
Click to expand...
Click to collapse
create a sample android app project on eclipse or android studio -> place your java files in the app src -> build your app -> decompile it with apktool
here you have your smali
seems crazy but it will work
Sent from my GT-S5302 using Tapatalk 2

sak-venom1997 said:
create a sample android app project on eclipse or android studio -> place your java files in the app src -> build your app -> decompile it with apktool
here you have your smali
seems crazy but it will work
Sent from my GT-S5302 using Tapatalk 2
Click to expand...
Click to collapse
I thought of that at first, but then it hit me that it will give me errors as I do not want every file to be smali, only one or two that I select :s

addemod said:
I thought of that at first, but then it hit me that it will give me errors as I do not want every file to be smali, only one or two that I select :s
Click to expand...
Click to collapse
Why exactly do you need files that are compiled for dalvik ?
Let me tell dalvik will soon be obsolate Android will run on ART !
Sent from my GT-S5302 using Tapatalk 2

Dafuq is ART? Never heard of it?
Sent from my GT-N7105 using XDA Premium 4 mobile app

addemod said:
Dafuq is ART? Never heard of it?
Sent from my GT-N7105 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
ART is a VM for java like the DALVIK
but DALVIK uses the JIT - Just in time at runtime for compilation and optimizes hotspots like the JRockit
ART on the other hand uses the AOT - Ahead of time
which optimizes code long before running it thereby greatly reducing startup times !
Sent from my GT-S5302 using Tapatalk 2

sak-venom1997 said:
ART is a VM for java like the DALVIK
but DALVIK uses the JIT - Just in time at runtime for compilation and optimizes hotspots like the JRockit
ART on the other hand uses the AOT - Ahead of time
which optimizes code long before running it thereby greatly reducing startup times !
Sent from my GT-S5302 using Tapatalk 2
Click to expand...
Click to collapse
Oh okay, cool
Thanks

You can convert java to smali by compiling java file using javac and then using DX on the class file generated. This is the simplest direct conversion of java to smali
Sent from 20,000 leagues under the sea

sak-venom1997 said:
ART is a VM for java like the DALVIK
but DALVIK uses the JIT - Just in time at runtime for compilation and optimizes hotspots like the JRockit
ART on the other hand uses the AOT - Ahead of time
which optimizes code long before running it thereby greatly reducing startup times !
Sent from my GT-S5302 using Tapatalk 2
Click to expand...
Click to collapse
So what? ART still uses .dex files, Dalvik bytecode (and therefore smali) will not be obsolete for many years.

Related

[Q] Why almost all Custom ROMs XMLs looks like this?

I use Notepad++ to edit XML. In Stock ROM it is fine. But almost all Custom ROMs have this problem. How can i edit it? Are there any ways to edit it?
emjimadhu said:
I use Notepad++ to edit XML. In Stock ROM it is fine. But almost all Custom ROMs have this problem. How can i edit it? Are there any ways to edit it?
Click to expand...
Click to collapse
You need to decompile it!
Lol! Decompile the apk first using apktool or apkmanager. That's the binary form of xml, on decompiling you'll get the readable form.
Sent from my GT-I9100 using xda app-developers app
anasdcool71 said:
Lol! Decompile the apk first using apktool or apkmanager. That's the binary form of xml, on decompiling you'll get the readable form.
Sent from my GT-I9100 using xda app-developers app
Click to expand...
Click to collapse
Thats not binary.. Its encrypted form I guess
Sent from my GT-S5360 using XDA

[Help] [Pro] Need help to modify Stock Settings.apk properly

I installed all apk found under system/framework with apktool.
*framework-res.apk & another apk
Then decompiled Settings.apk of Xperia pro stock ics Rom.
After that ,without making any change I compiled the apk. Then I surprisingly noticed that the size compiled apk is 1/3 of original stock settings.apk .
Then I flashed the apk using cwm to my phone to test if it work .after flashing, the setting icon is invisible in launcher menu !
Plz anybody tech me how decompile and re compile stock settings.apk of Xperia pro properly..
----------------****---------------
I'm noob. Help me to be great like U
This is because u have to delete the xml u edited and resources.arc and then compile it. Use apk manager. Its easyy to use.
What exactly u trying to do? May be I can help you out.
For ur last line "Be a beginner, but not a noob"
Sent from my MT11i using Tapatalk 2
i'm trying to add some ektra app linked with setting apk in setting header.xml
i'v done it perfectly in a custom rom's Settings.apk. but in stock rom, i'm getting error.
Sent from my MK16i using xda premium
shouvo said:
i'm trying to add some ektra app linked with setting apk in setting header.xml
i'v done it perfectly in a custom rom's Settings.apk. but in stock rom, i'm getting error.
Sent from my MK16i using xda premium
Click to expand...
Click to collapse
What tool do u use? For settings u edit setting_header.xml where is that present and all u must be knowing?!
After clicking on compiling apk manager asks to delete resources.arc and also the xml you edited. Then compile it should.
Sent from my MT11i using Tapatalk 2
koradiavatsal said:
What tool do u use? For settings u edit setting_header.xml where is that present and all u must be knowing?!
After clicking on compiling apk manager asks to delete resources.arc and also the xml you edited. Then compile it should.
Sent from my MT11i using Tapatalk 2
Click to expand...
Click to collapse
i use apktool provided by google code
plz what tool u'r talking about that asks to delete resource and xml while compile
Sent from my MK16i using xda premium
shouvo said:
i use apktool provided by google code
plz what tool u'r talking about that asks to delete resource and xml while compile
Sent from my MK16i using xda premium
Click to expand...
Click to collapse
He is talking about apk manager... Its just a easier form of apktool...
Sent from my Xperia Neo V using xda app-developers app
plz provide me the download link
Sent from my MK16i using xda premium
shouvo said:
plz provide me the download link
Sent from my MK16i using xda premium
Click to expand...
Click to collapse
Link = No
Search = Yes
Sent from my MT11i using Tapatalk 2
Guys can anybody please tell me how can i edit the default settings of the rom which load up after the first boot....
I looked into all xml files of Settings.apk but couldn't find any..
Eg: I want to disable the auto brightness mode by default when i flash my rom.
I have a Xperia P running with stock JB.
Thanks in advance...!!! :fingers-crossed:
koradiavatsal said:
Link = No
Search = Yes
Sent from my MT11i using Tapatalk 2
Click to expand...
Click to collapse
I've searched and downloaded. will try it today....hope it will work perfectly
Sent from my MK16i using xda premium
Note for next time: This is not the place for questions. Questions go to Q&A section.

[REQ] Moto X NavBar

Does anybody knows about a mod of Transparen NavBar like tihs http://www.gizbot.com/img/2013/07/24-motoxleak.jpg???
or anybody who can compile this http://forum.xda-developers.com/showthread.php?t=2361902 for android 4.3
And share please.
Thanks
Hope they can port the rom! Specs are pretty much the same as the nexus 4 plus moto isn't as heavy as sense or tw
Sent from my Nexus 4 using xda premium
If someone could do this, will thank him forever, transparent navbar is the feature that i want the most, not a total transparent one, but something like 70% or 60% transparent. PLEASE SOMEONE DO THIS!
aleespa said:
Does anybody knows about a mod of Transparen NavBar like tihs http://www.gizbot.com/img/2013/07/24-motoxleak.jpg???
or anybody who can compile this http://forum.xda-developers.com/showthread.php?t=2361902 for android 4.3
And share please.
Thanks
Click to expand...
Click to collapse
But your link is already supported by 4.3
rcoliveirajr said:
But your link is already supported by 4.3
Click to expand...
Click to collapse
Yes but I don't know decomplie and compile please anybody who know do it!!!
Sent from my Nexus 4 using xda app-developers app
Why not use PA ??
Sent from my Nexus 4 using Tapatalk 4 Beta
daferrill said:
Why not use PA ??
Sent from my Nexus 4 using Tapatalk 4 Beta
Click to expand...
Click to collapse
PA??? Is 4.3??
Sent from my Nexus 4 using xda app-developers app
daferrill said:
Why not use PA ??
Sent from my Nexus 4 using Tapatalk 4 Beta
Click to expand...
Click to collapse
I work as app developer, so i need my phone to be on stock to test the apps.
guigadourado said:
I work as app developer, so i need my phone to be on stock to test the apps.
Click to expand...
Click to collapse
Yes sometines we don't need a custom Rom, just some mods
http://forums.androidcentral.com/moto-x/302045-moto-x-system-dump-wallpapers.html#post2968829
Sent from my Nexus 7 using Tapatalk HD
aleespa said:
PA??? Is 4.3??
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=2020336
How I can decompile this file???
Please search before posting. There are tons of tut that will help you
Wayne Tech Nexus
zelendel said:
Please search before posting. There are tons of tut that will help you
Wayne Tech Nexus
Click to expand...
Click to collapse
Well I Read this thread: http://forum.xda-developers.com/showthread.php?t=2251719 but when I try to open .jar file I don't get classes.dex file.
- Copy *.jar file to apktool folder (make sure is the same folder). for example : android.policy.jar
- Open android.policy.jar using Winrar or 7zip and extract classes.dex file
- Drag & drop classes.dex to Quick-Baksmali.cmd (decompile process)
- wait and you will see a folder with the name "classout"
- now you can start editing smali file on classout folder (use Notepad++ for editing it)
- After editing is complete, Drag & drop classout folder to Quick-Smali.cmd (recompile process)

how to enable long press back to kill in stock

how to enable long press to kill in stock just like cyanogenmod 7.
Sent from my GT-S5360 using Tapatalk 2
sanchit0403 said:
how to enable long press to kill in stock just like cyanogenmod 7.
Sent from my GT-S5360 using Tapatalk 2
Click to expand...
Click to collapse
please search - took me less than two seconds to find this
http://forum.xda-developers.com/showthread.php?t=2254187
click the show button for the guide in the thread - you will have to test it to see if the smali is compatitble with our phone
if not there are sources on github - if you know how to edit and compile smali files
marcussmith2626 said:
please search - took me less than two seconds to find this
http://forum.xda-developers.com/showthread.php?t=2254187
click the show button for the guide in the thread - you will have to test it to see if the smali is compatitble with our phone
if not there are sources on github - if you know how to edit and compile smali files
Click to expand...
Click to collapse
its not working can u tell any other way
Sent from my GT-S5360 using Tapatalk 2
That guide is not compatible with galaxy y
Sent from my GT-S5360 using xda app-developers app
any other guide please i want this feature
Sent from my A15 using xda app-developers app

Updated to 4.4.2 on tmobile. How to switch to ART?

I don't see the option anywhere. Not even under the developer options. What are the steps necessary to make the switch on the g2?
Sent from my LG-D801 using xda app-developers app
DFG87 said:
I don't see the option anywhere. Not even under the developer options. What are the steps necessary to make the switch on the g2?
Sent from my LG-D801 using xda app-developers app
Click to expand...
Click to collapse
We need root...
Then we could probably edit the build.prop and change:
Code:
persist.sys.dalvik.vm.lib=libdvm.so
to
Code:
persist.sys.dalvik.vm.lib=libart.so
Make sure the permissions of build.prop are rw-r--r--, reboot and see what happens
DFG87 said:
I don't see the option anywhere. Not even under the developer options. What are the steps necessary to make the switch on the g2?
Sent from my LG-D801 using xda app-developers app
Click to expand...
Click to collapse
I was under the impression that ART is the default runtime on 4.4.2 and that if you wanted dalvik it had to be tweaked via build.prop
djvoleur said:
We need root...
Then we could probably edit the build.prop and change:
Code:
persist.sys.dalvik.vm.lib=libdvm.so
to
Code:
persist.sys.dalvik.vm.lib=libart.so
Make sure the permissions of build.prop are rw-r--r--, reboot and see what happens
Click to expand...
Click to collapse
Apparently not ?. Kit Kat in tmobile is missing the only things I was looking forward to: ART and tap to pay on google wallet.
Sent from my LG-D801 using xda app-developers app
BreakingVZW said:
I was under the impression that ART is the default runtime on 4.4.2 and that if you wanted dalvik it had to be tweaked via build.prop
Click to expand...
Click to collapse
No, ART is still in the developmental phase with Google. Maybe when Android 5.0 comes out than it will be the default, but right now it is not all universal with apps and other stuff so still in the testing phase.
easyguy said:
No, ART is still in the developmental phase with Google. Maybe when Android 5.0 comes out than it will be the default, but right now it is not all universal with apps and other stuff so still in the testing phase.
Click to expand...
Click to collapse
Well then what in the balls has everyone made such a big hooplah about ART in reference to KK for? "Check out this awesomeness that you can't have for another year! - Love, Google."

Categories

Resources