Accessing the Android Internal Classes

As part of our mobile work I have been peering into the Android source and Kernel, which is great, but we also wanted to see what we could get access to without making our own ROM and/or Kernel.

This provides a middle ground between more functionality and less compatibility when we want to offer some of our items for download to any old phone.

I found this posting Using com.android.internal classes from DevMaze. It was way helpful and in the final sections he discusses how the ADT Eclipse plugin restricts use of the internal classes, even if you can access them via the custom platform creations.

Well, I manually carried out the hex edit and it is all working, but I was concerned that if I let eclipse update I have to go and do it again. So, I give you http://code.google.com/p/adthiddentweak/ a very simple application that carries out the ‘hard work’ of doing the modification.

It just:

  • Copies the plugin to a folder under your documents to work on
  • Unpacks using DotNetZip (http://dotnetzip.codeplex.com/) to a folder
  • Maps the file that needs to be modified into memory (first time using memory mapped files in .NET, frankly not as useful as in C/C++) for alteration
  • Copies the plugin as <file>.bkp just in case
  • Creates the Jar (a zip file)
  • Copies back over the original Jar plugin file

Nothing really amazing but it did allow me to mess with two things.

Visual Studio 2012.

Yesssss….. Not bowled over by this experience. I wasn’t asked what developer profile I prefer, so ended up with a .NET profile, I’ve always used C++ (I’ve been using VS since v6) and got used to the layout.

Color scheme, blinded by the light, though thankfully I found the dark mode.

Icons.. I’ve only had 15 years to get used to the old ones, so I guess making me learn new ones might cause a bit of frustration…

I don’t feel especially disposed to upgrading right away.

Memory Mapped Files

I was keen to see these in .NET as the application here was a text book example of their use.

In C++ you map the file, get a pointer and get to treat it like a big block of memory. It makes the C programmer in me happy :).

In C# I thought I would get a massive array of bytes that I could mess with, instead I got what really looked like a stream. I might as well have just opened the file R/W via File IO and worked on it.

Today was a day to want my pointers back :-p

0 Responses to “Accessing the Android Internal Classes”


Comments are currently closed.