Tag-Archive for » coding «

Monday, December 15th, 2008 | Author: Tim

Your Ad Here
Ok - so lately I’ve been tooling around with a few different ideas. As a practical use to my injection ideas and to incorporate my love of asm, well - combine the two! This would result in essentially a dex byte-code translator that could then run on the AndroidOS. The main idea behind it would be to code up a basic structured java file that contains all the higher level functions you would need. Toast, web stuff, etc could all be considered “higher level” functions. Then the main part of the code would be asm that is translated into dex bytecode by DroidASM and injected into the premade dex file.

Ok, so no I don’t think a huge number of people would use it, but heck - it’d be a nice little tool and a good practice at coding. Just dumping this idea into the blog as of right now, since I only have bits and pieces of code that don’t make a whole lot of sense, so it would be useless to post them right now. More to come though, for sure.

Monday, November 24th, 2008 | Author: Tim

Something that you always come across in writing algorithms for devices that you want to lock down is getting a grasp of the actual device it is intended to be on. Sometimes programmers want to lock a registration code not only to a name for registration, but also to a device. This can cut down on “sharing” of serial numbers etc. I was doing some research and looking for device specific information when I stumbled upon a few things. They are right out there in the open, but here they are just in case you have not seen them yet.

In Android.Provider.Settings.System we have some interesting values that could be of use, one specifically is “Android_ID”. From the documentation it is the following;

String ANDROID_ID The Android ID (a unique 64-bit value) as a hex string. “android_id”

Though while this is considered a “unique key”, please keep in mind that if a program has write access to the Settings, which is possible, this could be changed easily. Though it could be a safe assuming that it should not be changed, and upon normal program usage it wouldn’t be changed. Anyway, to retrieve this ID you just use the following snip-it of code;

import Android.Provider.Settings.System;
...
String Android_ID = System.getString(this.getContentResolver(), System.ANDROID_ID);

Also, note that in an emulator this will return “null”, though a real device will return an actual value. The nice thing about this tid-bit of code is that you are not required any special permissions to call it, since it’s essentially a passive call to get information. No write access is (obviously) required.