Replacing Android core module (Stk.apk)

1,283 views
Skip to first unread message

Tim

unread,
Nov 4, 2011, 12:17:10 PM11/4/11
to Android Building, tim.a...@uk.ithrconsulting.com
I'm doing some work involving SIM Toolkit (Stk). I need to intercept
the STK commands sent from the SIM before they get to the user
interface. I have identified Stk.apk (a core Android app) as a
possible target for modification. I have built the source (v2.3.7) on
a Linux (Ubuntu) virtual machine on my PC - however I have a number of
problems/questions...

1. I cannot find Stk.apk on my build machine's filesystem. I guess
it's hidden in a .jar file - but which one, and shouldn't it exist
somewhere on it's own?

2. Am I going to get problems replacing just this module on my
standard 2.3 build (on a rooted HTC Desire)? I read somewhere about
signing issues (shared UID), also the module appears on my phone's
file system (/system/app) along with Stk.odex which I guess will also
cause problems?

3. I have tried to build the module 'stand alone' using Eclipse, but
it looks like I'm missing several classes in
com.android.internal.telephony.gsm.stk.
Is a 'stand alone' build possible?

Any answers, comments, hints would be greatly appreciated.

Magnus Bäck

unread,
Nov 4, 2011, 2:40:22 PM11/4/11
to Android Building
On Friday, November 04, 2011 at 17:17 CET,
Tim <tima...@gmail.com> wrote:

> I'm doing some work involving SIM Toolkit (Stk). I need to intercept
> the STK commands sent from the SIM before they get to the user
> interface. I have identified Stk.apk (a core Android app) as a
> possible target for modification. I have built the source (v2.3.7) on
> a Linux (Ubuntu) virtual machine on my PC - however I have a number of
> problems/questions...
>
> 1. I cannot find Stk.apk on my build machine's filesystem. I guess
> it's hidden in a .jar file - but which one, and shouldn't it exist
> somewhere on it's own?

.apk files are never put inside .jar files. The problem in your case
is most likely that the app isn't included in PRODUCT_PACKAGES of the
product you've built. You can build it explicitly with "make Stk"
(add -j option to flavor), in which case you'll find the .apk in
$OUT/system/app.

> 2. Am I going to get problems replacing just this module on my
> standard 2.3 build (on a rooted HTC Desire)? I read somewhere about
> signing issues (shared UID), also the module appears on my phone's
> file system (/system/app) along with Stk.odex which I guess will also
> cause problems?

The application needs to be signed with the platform certificate
(LOCAL_CERTIFICATE == platform, see packages/apps/Stk/Android.mk),
so I suppose you need to build and flash the system partition as
a whole to make it play. But signing aside, it shouldn't be a
problem to replace /system/app/Stk.apk and remove the accompanying
.odex file.

> 3. I have tried to build the module 'stand alone' using Eclipse,
> but it looks like I'm missing several classes in
> com.android.internal.telephony.gsm.stk.
> Is a 'stand alone' build possible?

Not with a stock SDK, but I suppose you could steal one of the .jar
files from the platform build (core.jar, or is it framework.jar?) and
add it as an additional library to your Eclipse build.

--
Magnus B�ck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Reply all
Reply to author
Forward
0 new messages