The thing that I seriously missed since I started to use Android Dev Phone 1 was Estonian Mobiil-ID. So in order to visit internet bank I had to use my ID-card again. And as I haven't bothered to set ID-card software up to my Gentoo box, I could only use bank services in Windows.
Android cupcake roadmap says it includes SIM Application Toolkit (STK) 1.0 as a new feature. Mobiil-ID is a SIM application too. This should mean that after upgrading the dev phone to newer SDK with image files provided by HTC I should be able to use my Mobiil-ID again! However, STK application package was not included in the images. Sigh.
BTW, when I look at it, it seems Android consumer phones do not have SIM Application Toolkit either.
So after some googling for solutions and grieving for a while, I decided to do it the hard way: download Android sources and compile STK application package myself.
Before compiling the code blindly, I checked the STK code, just for fun. For some reason, STK's AndroidManifest.xml contains a reference to an activity StkSettings which does not exist anymore (this class did exist before, so it must be a bug in the manifest file). So I simply commented this activity out from the manifest:
sven@galdor ~/mydroid/packages/apps/Stk $ git diff
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b3eae21..ace3fcb 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -61,6 +61,7 @@
</activity>
<!-- SIM Toolkit settings activity -->
+<!--
<activity android:name="StkSettings"
android:label="@string/app_name">
<intent-filter>
@@ -70,6 +71,7 @@
android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
+-->
<receiver android:name="com.android.stk.StkCmdReceiver">
<intent-filter>
Alright, typed make and waited for some time. Then finally the compilation finished and a list of shiny application packages are in out/target/product/generic/system/app/. Er... but not Stk.apk that I expected the most. So apparently it is specified somewhere what individual application packages are built by default. It didn't take long to find that the file target/product/generic.mk contained a list of application names that the default run of make produced. Added Stk to the list of application packages in PRODUCT_PACKAGES:
sven@galdor ~/mydroid/build $ git diff diff --git a/target/product/generic.mk b/target/product/generic.mk index b9bc070..8aac809 100644 --- a/target/product/generic.mk +++ b/target/product/generic.mk @@ -16,7 +16,8 @@ PRODUCT_PACKAGES := \ Updater \ CalendarProvider \ SubscribedFeedsProvider \ - SyncProvider + SyncProvider \ + Stk $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
and then typed make again.
After biting my nails for a short while, the compilation finished and what do I see... Stk.apk in out/target/product/generic/system/app/!
Installed the package with adb install out/target/product/generic/system/app/Stk.apk.
According to AndroidManifest.xml, STK listens to android.intent.action.BOOT_COMPLETED intent in order to start its service. Rebooted the phone to make sure it has started the service and is able to process the incoming messages from my mobile operator.
Let's test how it works. Opened my internet bank web site and chose Mobiil-ID as the login method. The phone was unlocked and home screen displayed. Unfortunately the phone did not react on the Mobiil-ID message, and the web site got a timeout finally. Not good. For the next test, I opened SIM Toolkit application and left its front page open:
![]()
Trying to log in to internet bank again. In a few moments I could see the PIN1 entry dialog!
![]()
Keyed in my PIN1 and in a few more moments I was logged in to internet bank! ![]()
So far I haven't made operations in the bank that require the entry of PIN2, yet. Will do this test probably in a few weeks time. Don't see why this should fail though.
Comments (7)
Nov 24
Sven Filatov says:
As expected, PIN2 worked just fine as well.As expected, PIN2 worked just fine as well.
Nov 30
Anonymous says:
This is just awesome!! Congrats!This is just awesome!! Congrats!
Nov 30
Anonymous says:
Just for the reference, as it was posted "Anonymous".. It was me, AhtiK :)Just for the reference, as it was posted "Anonymous".. It was me, AhtiK :)
Feb 03
Anonymous says:
Hi there ! Any chance I could get some help for enabling mobiil-ID on a Nexus O...Hi there !
Any chance I could get some help for enabling mobiil-ID on a Nexus One ?
allan@smail.ee
Mar 05
Sven Filatov says:
Cannot get it working on Nexus One. When installing the package, I get INSTALL_...Cannot get it working on Nexus One. When installing the package, I get INSTALL_FAILED_UPDATE_INCOMPATIBLE, and in the log there is Package ... has no signatures that match those in shared user android.uid.phone; ignoring!
STK has to have the same user ID as android.uid.phone application. It is needed for accessing each other's data. The problem is that both applications have to be signed by the same certificate, which I cannot do because I only have my own certificate.
I think it would work on one of these cases:
Feb 09
Sven Filatov says:
Here's one more tip for building your own SIM Application Toolkit package. My D...Here's one more tip for building your own SIM Application Toolkit package.
My Dev Phone runs SDK 1.6 – the is the latest image available at the time of this writing. If you download the latest sources from the repository, you have to change a few parameters in order to make it work on a Dev Phone. Without changing the parameters, you will end up with a package that requires SDK 2.0 installed to the phone.
According to the report on the platform SDK versions usage, the lowest SDK in wide use is 1.5. In order to make the application package compatible with SDK versions starting from 1.5, let's change the parameters accordingly:
Recall that platform SDK version 5 means Android SDK 2.0, and 3 means Android SDK 1.5.
Now, compile with
and install with
adb install out/target/product/generic/system/app/Stk.apkThis time I also noticed that it's not necessary to open SIM Application Toolkit before receiving a Mobiil-ID message. You can just have your Home screen open and Mobiil-ID should work.
Feb 23
Anonymous says:
Hi Sven Filatov, I use the stk's source code of Eclair, but it doesn't work. ...Hi Sven Filatov,
I use the stk's source code of Eclair, but it doesn't work.
I found that android would reset the app install state every time the device boots in file Eclair/packages/apps/Stk/src/com/android/stk/BootCompletedReceiver.java
Add Comment