don't click here

Sonic Advance 1 Android Port Decompile

Discussion in 'Engineering & Reverse Engineering' started by evilhamwizard, Jul 21, 2014.

  1. evilhamwizard

    evilhamwizard

    Researcher
    1,392
    455
    63
    A few years a go, Sonic Advance 1 was ported to Android platforms in Japan. The port eventually made it's way to the states I believe by GameLoft. The original Japanese port, however, has symbol names for functions and variables/boolean. The GameLoft versions seems to have been truncated of both data and code. I noticed that there were a multitude of Java/Android decompilers out there. Perhaps we can find use with the knowledge we can get from this version?

    Check this out. I ran AndroChef Java Decompiler on the .dex executable which was converted to a .jar:

    [​IMG]

    We had a link to the Japanese APK when the game just came out, but I can't seem to find the original Japanese APK anywhere. I can provide the files, just not the package. The files themselves are interesting too. All the music is MIDI, either it's the original I have no idea (fun fact: the GameLoft version uses OGGs, and the mobile phone ports of the game use MIDIs. The 1UP midi used in the mobile phone port in particular was actually converted from the original rom using GBA2MID, lel). The sound effects are all ogg files. Tiles were converted to .png.

    You can download the extracted files here, along with the decompiled java stuff. Just open the .jar up in your favorite archive explorer, the decompiled code are in the .java files.
     
  2. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Haha wait, this is the source code to Sonic Advance in Java?
     
  3. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,239
    972
    93
    Long-term happiness
    I'm pretty sure I've got the APK saved somewhere, but it's worth noting it doesn't really run on Western devices. Certainly none I've tried.
     
  4. ICEknight

    ICEknight

    Researcher Researcher
    It runs on my LG Optimus Black, but I don't really remember if I needed to modify something in it...

    I hope this will make it possible to remove that darn framerate limit.
     
  5. Pexs

    Pexs

    Otherwise known as Spex Member
    Whoa. That's the source? Like, the SOURCE source?


    Oh heck. I didn't know how much I wanted this until just now.
     
  6. evilhamwizard

    evilhamwizard

    Researcher
    1,392
    455
    63
    Not really the source code. This is a decompile of the executable from the Japanese version of the Android port with symbol names. Either or not they are the original symbol names I'm not too sure.

    I noticed that some function couldn't be decompiled with the program I used, so I don't think this is entirely useful yet.
     
  7. AkumaYin

    AkumaYin

    Member
    286
    6
    18
    Nice job, I'd probably be able to put some of these MIDIs to good use in some hacks and other projects. =P
     
  8. winterhell

    winterhell

    Member
    1,165
    7
    18
    And then you remember that DIMPS made it and you wake up from the nightmare.
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I would be interested in this, if it used the same formats for sprites/animations and level data, but it probably doesn't.
     
  10. LordOfSquad

    LordOfSquad

    bobs over baghdad Member
    5,201
    243
    43
    Winnipeg, MB
    making cool music no one gives a shit about
    Someone had told me once that Advance used engine assets directly from the original trilogy, or that they had access to said assets while developing it. I've never seen a first-hand source say anything along those lines though. Any truth to it that you guys know about? My quick glance at the wiki didn't dig up much.
     
  11. ICEknight

    ICEknight

    Researcher Researcher
    Other than the similar physics and debug mode coordinates display, I don't think there's been anything concrete that connects the advance and classic engines...

    But if that was the case, perhaps this would allow to... port the game to the Mega Drive? :O
     
  12. evilhamwizard

    evilhamwizard

    Researcher
    1,392
    455
    63
    I checked. It doesn't. The tiles are all png images, and none of the animation/palette/stage collision placement data files seem to be anywhere in the US rom. Unless the original rom compressed stuff though...

    The only thing I remember hearing about long a go about the trilogy/advance game connection were physics related. I'm not too familiar with how the Megadrive games work, though.
     
  13. Hitaxas

    Hitaxas

    Retro 80's themed Twitch streamer ( on hiatus) Member
    While this would be neat, I think a port to the 32x might be easier if that's possible. Porting to the Mega Drive/Genesis would require a lot of recoloring of many objects due to the amount of colors this game used.

    However maybe the music can be ported, I haven't looked through it all yet but some of the simple jingles, like the end of act music uses few enough channels for such a thing.

    Either way this is interesting stuff here. Going to poke around things a bit. :)
     
  14. Montblanc

    Montblanc

    Member
    100
    5
    18
    I have this .apk, it's v.1.0.0:

    http://www76.zippyshare.com/v/86255487/file.html

    When I found it it the file was named sonicadvance_signed so I don't know what was modified. Also it runs awfully on all my devices.
     
  15. Clownacy

    Clownacy

    Tech Member
    1,061
    607
    93
    So, quick question: Was is bad programming or Java that made this run like mud?
     
  16. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    Likely bad programming. It does work properly on a few devices, probably running an older version of Android. (I don't know the specifics.)

    Someone with Android programming experience could probably find what's causing the frame rate issue and fix it.
     
  17. Graxer

    Graxer

    Member
    Just tried out version 1.0.0 on my Xperia SP, it wasn't running perfectly, but it was still playable. Much more enjoyable than the mobile (non-smartphone) version that was ported to Android smartphones in the UK (And presumably US) where they didn't bother to include multi-touch so you had to use diagonal jump buttons. The volume also did strange things where it suddenly turned your device volume up to full at the start of a level and you had to turn it down again quickly.
     
  18. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    So why does the MID directory have Sonic 4 Episode 1 music?

    See bgm_49_boss_f1.mid for instance which is the EGG Station song.
     
  19. evilhamwizard

    evilhamwizard

    Researcher
    1,392
    455
    63
    The original used a bunch of Sonic 1/2 music for X-Zone boss fights. I'm guessing they replaced the music with stuff from Sonic 4 since they knew it was everybody's favorite soundtrack.
     
  20. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    The game used it for the boss medley.

    EDIT: Assassinated silently and without a trace.