tag:blogger.com,1999:blog-932432734909225977.post241181819559718108..comments2023-06-08T04:49:02.698-07:00Comments on [Witty Blog Title]: smali/baksmali v1.0JesusFrekehttp://www.blogger.com/profile/12165265467569950886noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-932432734909225977.post-39082660497930785032017-01-17T07:08:40.569-08:002017-01-17T07:08:40.569-08:00This comment has been removed by a blog administrator.Shahzaibhttps://www.blogger.com/profile/16994753604777604304noreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-81172312070320868202009-11-17T10:39:48.000-08:002009-11-17T10:39:48.000-08:00:: applauds :::: applauds ::faddennoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-37191296298867960392009-12-10T14:34:41.000-08:002009-12-10T14:34:41.000-08:00Hi JF, jubeh@xda has posted some stuff regarding f...Hi JF, jubeh@xda has posted some stuff regarding framework de-odexing here: http://forum.xda-developers.com/showpost.php?p=5121020&postcount=14<br><br>Hope it helps :D.Wysienoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-11947886474037188162009-11-28T05:44:44.000-08:002009-11-28T05:44:44.000-08:00hmmmm... it's some time agoIf I remembered rig...hmmmm... it's some time ago<br>If I remembered rigth it was in "CT" wich means Computer Technique but was just a short excurse in how compilers work but not very deep as our teacher said assembler is the highest "high level" language he accepts ;-) and in the discussion about microcontrollers and programming them in C he explained how a compiler works and why programming uC with a high level language other than assembler will not bring a satisfying result (not my opinion).<br>Another was "algorithms and Datastructures" in the part about parsing and how assemblers don't do much different as parsing stuff into another form.<br>It wasn't very deep but I'm more interested in how compiler works and your work on samli, especialy open source it will be a good way to learn with hands on.rachttp://www.2030.tknoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-66160861463831330642009-11-25T22:17:27.000-08:002009-11-25T22:17:27.000-08:00fabulous work JFI just had this subject theoretica...fabulous work JF<br>I just had this subject theoretically in school but I will browse and play a little with your source to see how it's done in real world ;-)rachttp://www.2030.tk/androidnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-78884287367392761592009-11-25T03:11:54.001-08:002009-11-25T03:11:54.001-08:00The usual method is with adb push. You might want ...The usual method is with adb push. You might want to take a look at http://code.google.com/p/smali/wiki/DeodexInstructionsjfnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-7509264136627146832009-11-25T03:11:54.000-08:002009-11-25T03:11:54.000-08:00Who said anything about leaving? :)Who said anything about leaving? :)jfnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-9833156010562870602009-11-26T14:20:59.000-08:002009-11-26T14:20:59.000-08:00Thanks :)What subject? Language design? Compiler c...Thanks :)<br><br>What subject? Language design? Compiler construction?jfnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-87323334575399686132009-12-14T00:50:48.000-08:002009-12-14T00:50:48.000-08:00[...] This post was Twitted by Wysie_Soh [...][...] This post was Twitted by Wysie_Soh [...]Twitted by Wysie_Sohhttp://realurl.org/twitted.php?id=6422256672noreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-30533190123300307122009-12-04T19:09:18.000-08:002009-12-04T19:09:18.000-08:00Hey all. I'm hoping that JF or someone can hel...Hey all. I'm hoping that JF or someone can help me. I am working on smali/baksmali'ing framework.odex on my cdma hero to change a couple of things. The baksmali goes perfectly fine but when I try to smali I get bombarded with errors in every single .smali file:<br><br>c:\test\framework\out\android\app\ActivityManagerProxy.smali[4364,32] no viable<br>alternative at character '}'<br><br>c:\test\framework\out\android\accounts\AccountMonitor$AccountUpdater.smali[73,4]<br> no viable alternative at character ':'<br><br><br>My syntax that I used was: c:\test\framework>java -Xmx512m -jar c:\android\sdk\tools\smali.jar out<br><br>I also tried with -o test.dex and got the same thing. I tried without the memory switch but got a memory error (it's a huge odex). I also tried 0.96 and got the same errors. Any help that you can give is appreciated. :) I am using v1.0. Thanks.flipzhttp://geekfor.menoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-62149199477857723772009-12-13T12:37:00.000-08:002009-12-13T12:37:00.000-08:00Yeah, you can definitely deodex everything in any ...Yeah, you can definitely deodex everything in any order you want, as long as you don't replace any jars/apks on the phone until after you've deodexed everything. I'm 100% certain about that. Don't believe anyone who says otherwise ;)jfnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-9781817437030529082009-11-22T17:10:13.000-08:002009-11-22T17:10:13.000-08:00*golf clap* excellent! another update! you are nev...*golf clap* excellent! another update! you are never going to leave the android world are you? ;-)rikupwnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-33424032481672842322009-11-23T05:01:05.000-08:002009-11-23T05:01:05.000-08:00how u install the deodexterant?how u install the deodexterant?jakenoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-45865515197648019362009-11-28T08:18:33.000-08:002009-11-28T08:18:33.000-08:00"how assemblers don’t do much different as pa..."how assemblers don’t do much different as parsing stuff into another form" - Very true. I designed the smali "assembly language" to be as close to a direct translation of the underlying dex file as possible. With high level compilers, it takes the input language, and generates the low-level assembly output, which is probably significantly different than the high level language. But with an assembler/disassm, there really isn't much modification of the input going on. It's almost a direct translation from the dex binary format to the text smali format.<br><br><br>"why programming uC with a high level language other than assembler will not bring a satisfying result" - depending on the uC, I would tend to agree. I've done some work on a small 8051 uC (I rewrote the firmware for my datahand keyboard from scratch), which has around 20k flash memory and runs at 12mhz, where each instruction takes 12 cycles (or some multiple of 12 cycles). And it has something like 256bytes of memory. With such constraints, it's better to program it directly with assembly, so you have direct control over exactly how the memory and registers are used. Plus you know *exactly* how long everything takes to run, which is often important when you're doing things at that level.jfnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-241832592096652222009-12-13T07:45:49.000-08:002009-12-13T07:45:49.000-08:00I see how that makes sense. I was with the logic w...I see how that makes sense. I was with the logic where, if you create odexes for a build, you first have to follow the boot classpath and then do all the rest because there are dependencies generated (in some way, I don't understand fully how) based not only on the dalvik machine and memory configuration but also the running framework, so if you dexopt-wrapper the apps, then the secondary framework, then the core framework, there will be a lot of broken dependencies since the information written to the original apps odexe's were dependent on the original configuration of the classes for the framework (non-odexed) and when you odex the framework after that, it breaks all that. Again, I'm not entirely sure why that is, but that's what seems to be happening.<br><br> Anyway, I thought this was the same situation, but thinking about it, it makes sense that those dependencies are stripped when you de-odex, and as long as you don't change anything in the current build from which you're running deodexerant, the applet should be able to determine those dependencies, memory configurations, etc and strip those to leave you with the kind of "universal" dex code we all know and love.<br><br> I hope I'm on the right track.Jubehnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-69312604191576514602009-12-12T13:06:23.000-08:002009-12-12T13:06:23.000-08:00The only reason you would need to deodex stuff in ...The only reason you would need to deodex stuff in any particular order is if you deodex one file, and then resmali it and put it back on the phone, and then deodex the next file, etc. But if you just deodex everything before replacing any files on the phone, you don't have to deodex them in any particular order. Much easier :D<br><br>As for the services.odex issue, I'm aware of it, and working on a fix. In the meantime, just replace the goto/16 or goto instructions that it complains about with a goto/32 instruction instead.jfnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-66378057600740450222009-12-05T23:24:34.000-08:002009-12-05T23:24:34.000-08:00Hi, thanks for this! I'm running into issues w...Hi, thanks for this! I'm running into issues with services.odex though. I can deodex it, but when using smali to compile it back, I get the following:<br><br>java -Xmx512M -jar smali.jar -o classes.dex out<br>/home/wysie/Desktop/tempfiles/out/com/android/server/WindowManagerService.smali[25760,4] The offset/label is out of range. The offset is -133 and the range for this opcode is [-128, 127].<br><br>Thanks :)Wysienoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-80809526485400647342009-12-06T08:39:32.000-08:002009-12-06T08:39:32.000-08:00Did you modify that smali file before re-assemblin...Did you modify that smali file before re-assembling it? If so, it's possible you inserted some code between the goto/jump and its target, and made the target out of range.<br><br>BUT, if you didn't modify it at all, that's certainly very strange. If that's the case, what rom did you take the services.odex from? A dl link to the rom would be appreciated - or you could email the odex file to me.jfnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-92101834295199639932009-12-06T13:53:01.000-08:002009-12-06T13:53:01.000-08:00Hey jf, thanks for the reply! Nope, I did not modi...Hey jf, thanks for the reply! Nope, I did not modify the file at all, was simply trying to de-odex services.odex and framework.odex. Had trouble de-odexing framework.odex, and services.odex works but I can't compile it back using smali.<br><br>I'm using it on Amon_RA's ROM here: http://forum.xda-developers.com/showthread.php?t=538645<br><br>Thanks JesusFreke! :)Wysienoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-88303431753697824132009-12-06T14:26:04.000-08:002009-12-06T14:26:04.000-08:00by the way, is your email JesusFreke[at]JesusFreke...by the way, is your email JesusFreke[at]JesusFreke.com? I can email you the odex files later :). thank you.Wysienoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-31893871131926380892009-12-12T10:22:18.000-08:002009-12-12T10:22:18.000-08:00I'm also at the same point as you, though. ser...I'm also at the same point as you, though. services deodexes just fine, but then trying to smali it back will fail.<br>I know now my approach is correct and I should be able to de-odex the core framework by doing it in the reverse order of which it dexopts for the first time, but services.jar happens to be the very last jar to be de-odexed and while the others will de-odex fine (except etc.jar, it will throw a bunch of errors and won't baksmali completely), even if I try to boot with core, framework, and android.policy de-odexed, services and ext will fail verification (ofcourse) and the system will just hang at a boot loop.<br>I'm mentioning it because I'm very sure the problem is with smali/baksmali.<br>My test rom is the adp1 ota image for 1.6. What? you say, that build doesn't have any odexes, does it?.<br>Well, no, it doesn't, but I ran dexopt-wrapper all over it and then baksmali-ed it all back to classes.dex for fun (yeah, i was that bored, research actually). So to replicate, just download the image from developer.htc.com (oh, they're down) and dexopt-wrapper it and then try to deodexerant it back.<br>I have to ask, JF, which build are YOU using. I'd like to test compiling the framework on that.Jubehnoreply@blogger.comtag:blogger.com,1999:blog-932432734909225977.post-40462107527271474042010-01-12T10:05:52.000-08:002010-01-12T10:05:52.000-08:00Hi JF, thanks in advance for any help that you giv...Hi JF, thanks in advance for any help that you give me. I de-odexed my services.odex file on my CLIQ and the program put everything in the out directory. (I am trying to change the color on my notification bar.) I edited my files and am ready to rebuild. Everything that I have read about rebuilding the services.odex file goes something like this...<br><br>java -jar baksmali.jar -o < .dex file<br><br>Now here is where I get confused. Is a .odex file the same as a .dex file? Or do I have to perform another step for an .odex file?<br><br>Thank Youanthonynoreply@blogger.com