<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base=""  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Michael Hölzl&#039;s blog</title>
 <link>/blog/2</link>
 <description></description>
 <language>en</language>
<item>
 <title>SEEK adaptations in RIL for Galaxy S3</title>
 <link>/blog/seek-galaxys3</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;&lt;em&gt;-- updated by &lt;a href=&quot;/user/68&quot;&gt;Michael Roland&lt;/a&gt; on 2013-09-04 17:04 +0200&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The project &lt;a href=&quot;http://code.google.com/p/seek-for-android/&quot; target=&quot;_blank&quot;&gt;seek-for-android&lt;/a&gt; aims to add APIs for Android to communicate with secure elements regardless of their form-factor (e.g. &lt;a title=&quot;Universal Integrated Circuit Card&quot; href=&quot;#&quot;&gt;UICC&lt;/a&gt;, &lt;a title=&quot;Secure Digital&quot; href=&quot;#&quot;&gt;SD&lt;/a&gt; card or embedded SE). The SEEK team published patches for &lt;a title=&quot;Android Open Source Project&quot; href=&quot;http://source.android.com/&quot; target=&quot;_blank&quot;&gt;AOSP&lt;/a&gt; that influence the telephony framework, the &lt;a title=&quot;Advanced Security SD card&quot; href=&quot;#&quot;&gt;ASSD&lt;/a&gt; kernel and the NFC framework. Based on those changes the SmartCard API gives developers the possibility to develop security feature enhanced applications that make use of a secure element.&lt;/p&gt;
&lt;p&gt;Samsung included SEEK with support for the UICC and the embedded SE on their Galaxy S3. As a developer you can easily write applications which communicate with the secure element on the UICC or the embedded SE. Unfortunately you can not use the publicly available patch from SEEK to build your own ROM with the SmartCard API and UICC support. While SEEK followed an approach to implement a standardized way to access the UICC through the phone&#039;s &lt;a title=&quot;Radio Interface Layer&quot; href=&quot;#&quot;&gt;RIL&lt;/a&gt;, Samsung decided to use their own proprietary method for communicating with the UICC-based secure element through the RIL. Therefore, the SEEK implementation for accessing the UICC through the RIL won&#039;t work on Samsung&#039;s devices.&lt;/p&gt;
&lt;p&gt;So, if you want to create your customized ROM for the Galaxy S3 that has SEEK with UICC-access, you have to adapt your ROM&#039;s telephony framework to send Samsung&#039;s proprietary command strucutres to the RIL. The main difference in Samsung&#039;s implementation is that they use OEM_HOOK_RAW requests instead of introducing new commands (SIM_*) for secure element communication. This means you have to adapt the three commands &lt;code&gt;iccOpenChannel&lt;/code&gt;, &lt;code&gt;iccCloseChannel&lt;/code&gt; and &lt;code&gt;iccExchangeAPDU&lt;/code&gt; (which are added by SEEK&#039;s UICC patches) in your telephony framework (frameworks/opt/telephony). You can either change the methods in &lt;code&gt;RIL.java &lt;/code&gt;or even better overwrite them in the Galaxy S3 specific implementation – &lt;code&gt;SamsungExynos4RIL.java&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Let&#039;s start with the adaptions for &lt;code&gt;iccOpenChannel&lt;/code&gt;: The main difference of the S3 is that the Samsung RILD implementation does not use specific RIL_REQUEST_SIM_* commands for the secure element access. Instead, you have to use the RIL_REQUEST_OEM_HOOK_RAW request to encapsulate the commands. From what we found, the format of these vendor-specific commands looks like this:&lt;/p&gt;
&lt;pre&gt;[command class (1 byte)] || [command (1 byte)] || [command length (2 bytes)] || [data (N bytes)]&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;command class&lt;/strong&gt; always has the value 21&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;command&lt;/strong&gt; is a 1-byte integer identifying the type of request:
&lt;ul&gt;&lt;li&gt;9 for open channel&lt;/li&gt;
&lt;li&gt;10 for close channel&lt;/li&gt;
&lt;li&gt;11 for sending an APDU&lt;/li&gt;
&lt;li&gt;12 for sending a Case-1 APDU command (no data and no expected response)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;command length&lt;/strong&gt; is a 2-byte integer (MSB first) that contains the length of the whole command including the data field: 4 + N&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;This means for the &lt;code&gt;iccOpenChannel &lt;/code&gt;command we will create a byte array with the values:&lt;/p&gt;
&lt;pre&gt;&amp;gt; [21] [9] [4 + AID.length] [AID]&lt;/pre&gt;&lt;p&gt;In the argument tag of the result parameter we also want to add some information about the type of command so that we are later able to properly decode the response message format. For that purpose we added three constant values to the class:&lt;/p&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;private static final int EVENT_EXCHANGE_APDU_DONE = 1;
private static final int EVENT_OPEN_CHANNEL_DONE  = 2;
private static final int EVENT_CLOSE_CHANNEL_DONE = 3;&lt;/pre&gt;&lt;p&gt;For the &lt;code&gt;iccOpenChannel &lt;/code&gt;command, the expected response format is:&lt;/p&gt;
&lt;pre&gt;&amp;lt; [channel ID length N (1 byte)] [channel ID (N bytes)] [response length M (1 byte)] [response (M bytes)]&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;channel ID length N&lt;/strong&gt; is a 1-byte integer that contains the length of the channel ID field in bytes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;channel ID&lt;/strong&gt; is an N-byte integer (LSB first!) that specified the assigend channel ID&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;response length M&lt;/strong&gt; is a 1-byte integer that contains the length of the response field&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;response&lt;/strong&gt; is a byte array that contains response data received by the UICC in response to opening the channel to the given applet&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Finally, this is what our &lt;code&gt;iccOpenChannel &lt;/code&gt;method looks like:&lt;/p&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;@Override
public void iccOpenChannel(String AID, Message result) {
    if(AID == null) {
        AID = &quot;&quot;;
    }

    final int aidLength = AID.length() / 2;
    byte[] aidBytes = new byte[aidLength];
    for (int i = 0; i &amp;lt; aidLength; ++i) {
        aidBytes[i] = (byte) Integer.parseInt(AID.substring(2 * i, 2 + 2 * i), 16);
    }

    ByteArrayOutputStream commandByteStream = new ByteArrayOutputStream();
    DataOutputStream commandOutputStream = new DataOutputStream(commandByteStream);
    try {
        commandOutputStream.writeByte(21);
        commandOutputStream.writeByte(9);
        commandOutputStream.writeShort(4 + aidLength);
        commandOutputStream.write(aidBytes);
    } catch (IOException e) {
        Log.e(LOG_TAG, &quot;CMD_OPEN_CHANNEL : open fail&quot;, e);
        e.printStackTrace();
    }

    // inform response handler that this is a open channel request
    result.arg1 = EVENT_OPEN_CHANNEL_DONE;

    Log.d(LOG_TAG, &quot;sendRawRequest - open channel: AID: &quot;+ AID);
    invokeOemRilRequestRaw(commandByteStream.toByteArray(), result);
}&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;iccCloseChannel &lt;/code&gt;method looks similiar. The only difference is that instead of the AID we pass the channel ID:&lt;/p&gt;
&lt;pre&gt;&amp;gt; [21] [10] [4 + 4 = 8 (channel ID is a 4-byte integer)] [channel ID (4 bytes, MSB first)]&lt;/pre&gt;&lt;p&gt;Except for the special case of the channel ID zero, where we pass no channel ID at all:&lt;/p&gt;
&lt;pre&gt;&amp;gt; [21] [10] [4]&lt;/pre&gt;&lt;pre class=&quot;brush:java;&quot;&gt;@Override
public void iccCloseChannel(int channel, Message result) {
    ByteArrayOutputStream commandByteStream = new ByteArrayOutputStream();
    DataOutputStream commandOutputStream = new DataOutputStream(commandByteStream);
    try {
        commandOutputStream.writeByte(21);
        commandOutputStream.writeByte(10);
        if (channel != 0) {
            commandOutputStream.writeShort(8);
            commandOutputStream.writeInt(channel);
        } else {
            commandOutputStream.writeShort(4);
        }
    } catch (IOException e) {
        Log.e(LOG_TAG, &quot;CMD_CLOSE_CHANNEL : close fail&quot;, e);
    }

    // inform response handler that this is a close channel request
    result.arg1 = EVENT_CLOSE_CHANNEL_DONE;

    Log.d(LOG_TAG, &quot;sendRawRequest - close channel &quot;+ channel);
    invokeOemRilRequestRaw(commandByteStream.toByteArray(), result);
}&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;iccExchangeAPDU &lt;/code&gt;command looks more complex but is basically just a set of data fields composed from the RIL_REQUEST_OEM_HOOK_RAW command structure and the transmitted APDU command. For a given APDU command (note that extended APDUs are not supported)&lt;/p&gt;
&lt;pre&gt;[cla (1 byte)] [ins (= command) (1 byte)] [p1 (1 byte)] [p2 (1 byte)] [[Lc (1 byte)] [data (Lc bytes)]] [Le (1 byte)]&lt;/pre&gt;&lt;p&gt;the resulting &lt;code&gt;iccExchangeAPDU &lt;/code&gt;command looks like:&lt;/p&gt;
&lt;pre&gt;&amp;gt; [21] [11] [4 + 9 + databytes.length] [cla] [command] [p1] [p2] [p3] [channel ID (4 bytes, MSB first)] [databytes]&lt;/pre&gt;&lt;p&gt;Where &lt;code&gt;p3 &lt;/code&gt;is either the command data length &lt;em&gt;Lc&lt;/em&gt; and &lt;code&gt;databytes &lt;/code&gt;is the concatenation of &lt;code&gt;data &lt;/code&gt;and the expected response data length &lt;em&gt;Le&lt;/em&gt; (if applicable) or &lt;code&gt;p3 &lt;/code&gt;is the expected response data length &lt;em&gt;Le&lt;/em&gt; and the &lt;code&gt;databytes &lt;/code&gt;field is empty. For a Case-1 APDU, the a seperate command without those two fields is used:&lt;/p&gt;
&lt;pre&gt;&amp;gt; [21] [12] [4 + 8 = 12] [cla] [command] [p1] [p2] [channel ID (4 bytes, MSB first)]&lt;/pre&gt;&lt;p&gt;The response to the &lt;code&gt;iccExchangeAPDU &lt;/code&gt;command has the format of a response APDU according to ISO/IEC 7816-4:&lt;/p&gt;
&lt;pre&gt;&amp;lt; [response data (N bytes, optional)] [sw1] [sw2]&lt;/pre&gt;&lt;pre class=&quot;brush:java;&quot;&gt;@Override
public void iccExchangeAPDU(int cla, int command, int channel,
                            int p1, int p2, int p3, String data,
                            Message result) {
    ByteArrayOutputStream commandByteStream = new ByteArrayOutputStream();
    DataOutputStream commandOutputStream = new DataOutputStream(commandByteStream);
    try {
        commandOutputStream.writeByte(21);

        int commandLength = 12;
        if (p3 == -1) {
            commandOutputStream.writeByte(12);
        } else {
            commandOutputStream.writeByte(11);
            ++commandLength;
        }

        byte[] dataBytes = null;
        if (data != null) {
            commandLength += data.length() / 2;

            dataBytes = new byte[data.length() / 2];
            for (int i = 0; i &amp;lt; dataBytes.length; ++i) {
                dataBytes[i] = (byte) Integer.parseInt(data.substring(2 * i, 2 + 2 * i), 16);
            }
        }

        commandOutputStream.writeShort(commandLength);
        commandOutputStream.writeByte(cla);
        commandOutputStream.writeByte(command);
        commandOutputStream.writeByte(p1);
        commandOutputStream.writeByte(p2);
        if (p3 != -1) {
            commandOutputStream.writeByte(p3);
        }
        commandOutputStream.writeInt(channel);
        if (dataBytes != null) {
            commandOutputStream.write(dataBytes);
        }
    } catch (IOException e) {
        Log.e(LOG_TAG, &quot;CMD_ECHANGE_APDU: send failed - &quot;, e);
    }

    Log.e(LOG_TAG, &quot;: sendRawRequest - iccExchangeAPDU: &quot;
                   + &quot;Channel 0x&quot; + Integer.toHexString(channel) + &quot;: &quot;
                   + &quot; 0x&quot; + Integer.toHexString(cla)
                   + &quot; 0x&quot; + Integer.toHexString(command)
                   + &quot; 0x&quot; + Integer.toHexString(p1)
                   + &quot; 0x&quot; + Integer.toHexString(p2)
                   + &quot; 0x&quot; + Integer.toHexString(p3)
    );

    // inform response handler that this is a exchange APDU request
    result.arg1 = EVENT_EXCHANGE_APDU_DONE;
    invokeOemRilRequestRaw(commandByteStream.toByteArray(), result);
}&lt;/pre&gt;&lt;p&gt;Here is a &lt;a href=&quot;/sites/default/files/blog/seekWithRIL_all.diff&quot;&gt;complete diff&lt;/a&gt; containing the necessary changes to get SEEK with UICC access in the Android build for a Samsung Galaxy S3. Most important changes are in the &lt;a href=&quot;/sites/default/files/blog/seekWithRIL_frameworks_opt_telephony.diff&quot;&gt;frameworks/opt/telephony&lt;/a&gt; and the &lt;a href=&quot;/sites/default/files/blog/seekWithRIL_packages_apps_phone.diff&quot;&gt;packages/apps/Phone&lt;/a&gt; repository.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 22 Aug 2013 13:04:29 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">100 at </guid>
 <comments>/blog/seek-galaxys3#comments</comments>
</item>
<item>
 <title>Latest futurezone report</title>
 <link>/blog/futurezone-on-jrc-usmile</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;Check out the latest report about our research center at futurezone (in German):&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://futurezone.at/future/16894-fh-hagenberg-forscht-zu-smartphone-sicherheit.php&quot; target=&quot;_blank&quot;&gt;http://futurezone.at/future/16894-fh-hagenberg-forscht-zu-smartphone-sicherheit.php&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Wed, 07 Aug 2013 09:50:06 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">93 at </guid>
 <comments>/blog/futurezone-on-jrc-usmile#comments</comments>
</item>
<item>
 <title>How to build AOSP Kernel for Galaxy Nexus</title>
 <link>/blog/how-to-build-aosp-kernel-for-galaxy-nexus</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;strong&gt;Building an AOSP Kernel Galaxy Nexus GT-I9520 Version 4.2.2&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Generate Folder:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;generate a folder of you choice on your file system. In This case it is KERNEL_AOSP&lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Download Sources:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;switch into the KERNEL_AOSP folder&lt;/p&gt;
&lt;p&gt;&lt;em&gt;git clone &lt;a href=&quot;https://android.googlesource.com/kernel/omap.git&quot;&gt;https://android.googlesource.com/kernel/omap.git&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This will give you a git repository with all actual branches of the omap Kernels.&lt;/p&gt;
&lt;p&gt;omap is the corresponding Kernel Source for Maguro Devices (Galaxy Nexus)&lt;/p&gt;
&lt;p&gt;After the download you have a omap folder. &lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Show the branches:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;in your KERNEL_AOSP/omap Folder type &lt;/p&gt;
&lt;p&gt;&lt;em&gt;git branch -a&lt;/em&gt; (shows you all branches)&lt;/p&gt;
&lt;p&gt;This will list you a list of all branches available&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Hint: after checkout you can look up you actual branch with git branch&lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Checkout branch:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For the actual JB Version checkout the following branch: &lt;/p&gt;
&lt;p&gt;&lt;em&gt;git checkout android-omap-tuna-3.0-jb-mr1.1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;After the checkout you have all files available &lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Preparing the prebuilt GCC&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;For Kernel built prebuilt GCC is necessary. If you have already a AOSP Rom Source on your Filesystem you need not to Download it.&lt;/p&gt;
&lt;p&gt;Just set the Path:&lt;/p&gt;
&lt;p&gt;&lt;em&gt; export PATH=$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin: &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;(pwd)...Path of you AOSP Rom Source&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If you don&#039;t have an Android source tree, you can download the prebuilt toolchain from:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;git clone &lt;a href=&quot;https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6&quot;&gt;https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/ar...&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Don&#039;t forget to set the Path of where you have downloaded the prebuilt to.&lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt; Set some Variables:&lt;/strong&gt;&lt;em&gt; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;export ARCH=arm&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;export SUBARCH=arm&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;export CROSS_COMPILE=arm-eabi-&lt;/em&gt;&lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Cleaning the Source&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To ensure that you generate a really new Kernel type:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;make clean&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;make mrproper&lt;/em&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;text-decoration: underline; font-size: small;&quot;&gt;!!!Do this everytime before starting a new make process!!! &lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;&lt;p&gt; &lt;strong&gt;Config&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;make tuna_defconfig&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This prepares the make configuration &lt;/p&gt;
&lt;p&gt;&lt;em&gt;make menuconfig&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Opens the visaulisation for the def config&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Goto General setup ---&amp;gt; Local version-append to kernel release&lt;/p&gt;
&lt;p&gt;type in whatever you want to name your Kernel &lt;/p&gt;
&lt;p&gt;This text is shown in the about diaglog of the Phone and helps you to find out if the Kernel Source is your custom source.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;After this we start the make process: &lt;/p&gt;
&lt;p&gt;&lt;em&gt;make -j16&lt;/em&gt; (-jx) the higher the number the more core power is used and will speed up the make&lt;/p&gt;
&lt;p&gt;When make is finished you should have the message &quot;Creating zImage successfully&quot; &lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Flash your Kernel to device:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Go into the folder arm/arch/boot. There you should find the zImage.img file.&lt;/p&gt;
&lt;p&gt;Check if the date of the file is correct with the time of building and also if the size is about 4,2MB.&lt;/p&gt;
&lt;p&gt;If all thing are OK, we can flash the zImage to the device. Make sure that the device is available&lt;/p&gt;
&lt;p&gt;&lt;em&gt;adb devices&lt;/em&gt; (if the device is not shown do adb kill-server and adb start-server)&lt;/p&gt;
&lt;p&gt;Go into fastboot mode&lt;/p&gt;
&lt;p&gt;&lt;em&gt;adb reboot bootloader&lt;/em&gt;&lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Flash it:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;fastboot flash zimage zImage&lt;/em&gt; (Match Case!!)&lt;/p&gt;
&lt;hr /&gt;&lt;p&gt;&lt;strong&gt;Reboot the device:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;either you press the START button on your device or you type fastboot reboot&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;After rebooting the device you should find your Kernel name in the About Phone page!&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;CONGRATS YOU ARE DONE!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 01 Aug 2013 13:59:01 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">119 at </guid>
 <comments>/blog/how-to-build-aosp-kernel-for-galaxy-nexus#comments</comments>
</item>
<item>
 <title>Official introduction of u&#039;smile</title>
 <link>/blog/official-introduction-of-jrc-usmile</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;Last week on Friday we had the official introduction event of our research center. Together with several representatives from politics, business and science we discussed about the future of mobile phones and the importance of user-friendly security functionalities.&lt;/p&gt;
&lt;p&gt;More information about the successful event in official press releases:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.nachrichten.at/oberoesterreich/muehlviertel/FH-Studenten-machen-Smartphones-noch-klueger;art69,1145318&quot; target=&quot;_blank&quot;&gt;OÖ Nachrichten Report&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.facebook.com/permalink.php?story_fbid=10151506484662029&amp;amp;id=313146097028&amp;amp;_fb_noscript=1&quot; target=&quot;_blank&quot;&gt;FH OÖ Campus Hagenberg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.cdg.ac.at/forschungseinheiten/labor/user-friendly-secure-mobile-environments/?tx_cdglabors_labors[action]=show&amp;amp;tx_cdglabors_labors[controller]=Labor&amp;amp;cHash=c8ed42d26ab538033e40cfca19452144&quot; target=&quot;_blank&quot;&gt;CDG Press Release&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;img title=&quot;Representatives from politics, business and science. From left to right: Dipl.-Ing. Michael Jerne (NXP Semiconductors Austria GmbH), Dr. Wolfgang Schwabl (Telekom Austria Group Information Security &amp;amp; Emergency), Dr. René Mayrhofer (JR-Zentrum u’smile), Landesrätin Mag. Doris Hummer, Dr. Hartmut Kahlert (Christian Doppler Forschungsgesellschaft), FH OÖ-Geschäftsführer Dr. Gerald Reisinger, Dr. Witold Jacak (FH OÖ), DI (FH) Thomas Kern (FH OÖ Research Center Hagenberg) -- Foto: FH OÖ&quot; src=&quot;/sites/default/files/page/grouppicture.jpg&quot; alt=&quot;&quot; width=&quot;800&quot; height=&quot;529&quot; /&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 25 Jun 2013 10:09:11 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">92 at </guid>
 <comments>/blog/official-introduction-of-jrc-usmile#comments</comments>
</item>
<item>
 <title>How to flash SuperSmile</title>
 <link>/blog/supernexus-flash</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;This is a tutorial on how to install our SuperSmile ROM to your Android device. You can find the ROM for all supported devices (currently S2 and S3) in the &lt;a href=&quot;/downloads&quot;&gt;downloads section&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Before you flash SuperSmile you should backup all your data. In the process of installing this ROM you will have to make a factory reset with a data wipe. To backup your data you can use tools like &quot;Titanium Backup&quot; or &quot;App Backup&amp;amp;Restore&quot; which will store apps and also app data to your SD card. Just look for them in the Android Play Store.&lt;/p&gt;
&lt;p&gt;Requirements for this build:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;A custom recovery on your phone (e.g. clockworkmod recovery - &lt;a href=&quot;http://forum.xda-developers.com/wiki/ClockworkMod_Recovery&quot; target=&quot;_blank&quot;&gt;tutorial&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Instructions:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Download SuperSmile ROM (&lt;a href=&quot;/downloads&quot;&gt;download section&lt;/a&gt;) and a Google Apps package (available &lt;a href=&quot;http://goo.im/gapps/gapps-jb-20120726-signed.zip&quot;&gt;here)&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Copy both zip files to your SD Card&lt;/li&gt;
&lt;li&gt;Enter Recovery&lt;/li&gt;
&lt;li&gt;Do a data wipe/factory reset (Necessary if coming from a different ROM)&lt;/li&gt;
&lt;li&gt;Flash the ROM&lt;/li&gt;
&lt;li&gt;Flash Google Apps&lt;/li&gt;
&lt;li&gt;Restart your phone&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;That&#039;s it! If you have any issues installing the ROM or if you find bugs in our system, just &lt;a href=&quot;/contact&quot;&gt;contact us&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 06 May 2013 14:45:55 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">91 at </guid>
 <comments>/blog/supernexus-flash#comments</comments>
</item>
<item>
 <title>How to build SuperNexus for Galaxy S3 on Linux</title>
 <link>/blog/supernexus-build</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;SuperNexus is a project that focusses on providing Google Nexus experience on Samsung devices. The ROM is based on AOSP code with slight improvements and optimizations (e.g. battery life time). It is great ROM if you want the basic Google layout without modifications from the operator or manufacturer on your mobile phone.&lt;/p&gt;
&lt;p&gt;You can download the prebuilt ROM from xda (&lt;a href=&quot;http://forum.xda-developers.com/showthread.php?t=2076672&quot;&gt;http://forum.xda-developers.com/showthread.php?t=2076672&lt;/a&gt;). If you want to build it yourself, you will have to checkout the source code from github (&lt;a href=&quot;https://github.com/SuperNexus&quot;&gt;https://github.com/SuperNexus&lt;/a&gt;) and go through this styp by step tutorial.&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;1. Build Environment&lt;/h4&gt;
&lt;p&gt;If you haven&#039;t done this already, you have to initialize your build environment for android source code building. I don&#039;t want to describe that again as there is a great tutorial for this on android developer pages:&lt;br /&gt;&lt;a href=&quot;http://source.android.com/source/initializing.html&quot;&gt;http://source.android.com/source/initializing.html&lt;/a&gt;&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;2. Download the code&lt;/h4&gt;
&lt;p&gt;The source code which you will have to download is a combination of three source code projects. Fortunately, you won&#039;t have to care much about where you download the code from. SuperNexus provides a manifest file which helps you to download all neccessary files:&lt;/p&gt;
&lt;pre&gt;$ mkdir SuperNexusJB&lt;br /&gt;$ cd SuperNexusJB&lt;br /&gt;$ repo init -u https://github.com/SuperNexus/android_manifest.git -b jellybean&lt;br /&gt;$ repo sync -j8
&lt;/pre&gt;&lt;p&gt;This can take some time (for me it took around 2 hours depending on the connection).&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;3. Set the build configuration&lt;/h4&gt;
&lt;p&gt;Now you have the source. First thing you have to do is to set the build environment.&lt;/p&gt;
&lt;pre&gt;$ . build/envsetup.sh&lt;br /&gt;$ . vendor/supernexus/vendorsetup.sh&lt;br /&gt;$ lunch i9300-userdebug&lt;/pre&gt;&lt;p&gt;The last command sets the configurations for the samsung galaxy s3. If you want to build for a different platform you can check the list by typing lunch without parameter.&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;4. Get proprietary drivers&lt;/h4&gt;
&lt;p&gt;Unfortunately we did not find a way to reliably retrieve the proprietary drivers for different stock ROM. The location of the driver often changes between versions and therefore the script to extract the binaries will not find all files. The most reliable way to get the drivers is to install SuperNexus on your device first and extract it from there.&lt;/p&gt;
&lt;p&gt;Go to the developer page of SuperNexus at&lt;a href=&quot;http://forum.xda-developers.com/showthread.php?t=2076672&quot; target=&quot;_blank&quot;&gt; xda-developers&lt;/a&gt;. There you can download the current otapackage of SuperNexus which you will have to install using ClockWorkMod (Tutorial to install CWM at &lt;a href=&quot;http://www.youtube.com/watch?v=wWMlU10ir3I&quot; target=&quot;_blank&quot;&gt;youtube&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;If this is done, connect the Galaxy S3 to your machine and extract the proprietary drivers with the script file that comes with SuperNexus:&lt;/p&gt;
&lt;pre&gt;$ cd device/samsung/smdk4412-common&lt;br /&gt;$ ./extract-files.sh&lt;/pre&gt;&lt;h4 class=&quot;header&quot;&gt;5. Build SuperNexus&lt;/h4&gt;
&lt;p&gt;Now go back to the root directory and start the build.&lt;/p&gt;
&lt;pre&gt;$ make update-api&lt;br /&gt;$ make -j#&lt;/pre&gt;&lt;p&gt;where # is the number of processors which you want to use for your build. Now you can flash the build with heimdall or you make an otapackage (execute the command &quot;make otapackage&quot;) which you can install using ClockWorkMod.&lt;/p&gt;
&lt;p&gt;Flashing with heimdall:&lt;br /&gt;Goto your output directory &quot;out/target/product/i9300/&quot;. Here you will find all finished images of your build. Bring your Samsung Galaxy S3 in to download mode by pressing the Buttons &quot;Vol. down&quot; + &quot;Power&quot; + &quot;Home Button&quot; for around 15 seconds. Press Volume Up again to come into download mode. Now you can flash your phone with heimdall:&lt;/p&gt;
&lt;pre&gt;$ sudo heimdall flash --primary-boot boot.img --system system.img --user-data userdata.img&lt;/pre&gt;&lt;h4 class=&quot;header&quot;&gt;6. Adapt the build&lt;/h4&gt;
&lt;p&gt;You can adapt your SuperNexus build now. But before you do that you should make a new branch with your repo command:&lt;/p&gt;
&lt;pre&gt;$ repo start &amp;lt;BRANCHNAME&amp;gt; --all&lt;/pre&gt;&lt;h4 class=&quot;header&quot;&gt;Links&lt;/h4&gt;
&lt;p&gt;XDA-developer page of the SuperNexus team: &lt;a href=&quot;http://forum.xda-developers.com/showthread.php?t=2076672&quot;&gt;http://forum.xda-developers.com/showthread.php?t=2076672&lt;/a&gt;&lt;br /&gt;SuperNexus GitHub page: &lt;a href=&quot;https://github.com/SuperNexus&quot;&gt;https://github.com/SuperNexus&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Wed, 20 Mar 2013 09:04:00 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">89 at </guid>
 <comments>/blog/supernexus-build#comments</comments>
</item>
<item>
 <title>How to build an Android Kernel</title>
 <link>/blog/how-to-build-android-kernel</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;Step by step (similar to xda developer page &lt;a href=&quot;http://forum.xda-developers.com/showthread.php?t=1538580&quot;&gt;http://forum.xda-developers.com/showthread.php?t=1538580&lt;/a&gt;)&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;1. Download Kernel source&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;http://opensource.samsung.com/&quot;&gt;http://opensource.samsung.com/&lt;/a&gt;&lt;br /&gt;&amp;gt;&amp;gt; Mobile &amp;gt;&amp;gt; Mobile Phone&amp;gt;&amp;gt;   &lt;br /&gt;Search for GT-I9300 and download latest JB zip&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;2. Extract Kernel from zip file&lt;/h4&gt;
&lt;h4 class=&quot;header&quot;&gt;3. Install gcc toolchain for building arm kernels&lt;/h4&gt;
&lt;p&gt;# sudo apt-get install gcc-arm-linux-gnueabi  &lt;br /&gt; &lt;br /&gt;download prebuilt toolchain (see &lt;a href=&quot;http://source.android.com/source/building-kernels.html&quot;&gt;http://source.android.com/source/building-kernels.html&lt;/a&gt; ) &lt;br /&gt;# git clone &lt;a href=&quot;https://android.googlesource.com/platform/prebuilt&quot;&gt;https://android.googlesource.com/platform/prebuilt&lt;/a&gt; &lt;br /&gt; &lt;br /&gt;if you get an error like &quot;undefined reference to `wrefresh&#039;&quot;, install these packages: &lt;br /&gt;# sudo apt-get install libncurses5 libncurses5-dev&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;4. set environment variables&lt;/h4&gt;
&lt;p&gt;# export ARCH=arm &lt;br /&gt;# export SUBARCH=arm &lt;br /&gt;# export CROSS_COMPILE=&amp;lt;path to toolchain from googlesource&amp;gt;/toolchains/arm-eabi-4.4.3/bin/arm-eabi-&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;5. configure build for Samsung galaxy S3&lt;/h4&gt;
&lt;p&gt;Switch to kernel source directory &lt;br /&gt;# make m0_00_defconfig &lt;br /&gt; &lt;br /&gt;//optional for configuration of the kernel &lt;br /&gt;# make menuconfig&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;6. Start build&lt;/h4&gt;
&lt;p&gt;# make -j&amp;lt;X&amp;gt; //&amp;lt;X&amp;gt; number of cpu cores&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;7. create boot.img from the new zImage&lt;/h4&gt;
&lt;p&gt;For flashing the new kernel you will need a ramdisk image file from a working build (e.g. nandroid backup or own android source code build). To extract the ramdisk image use the attached perl script (./split_bootimg.pl ) by executing the command: &lt;br /&gt;# perl split_bootimg.pl &amp;lt;boot image file with working ramdisk&amp;gt; &lt;br /&gt; &lt;br /&gt;Copy the ramdisk image and your zImage in a separate directory together with the attached mkbootimg binary ./mkbootimg . Combine those files to a new boot.img by executing following command in the newly created directory: &lt;br /&gt;# ./mkbootimg --kernel &amp;lt;zImage&amp;gt; --ramdisk &amp;lt;ramdisk image&amp;gt; --output boot.img&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;8. Flash the kernel&lt;/h4&gt;
&lt;p&gt;For flashing we used the open source tool heimdall version 1.3.1 for linux_x64 command line &lt;a href=&quot;http://www.glassechidna.com.au/products/heimdall/&quot;&gt;http://www.glassechidna.com.au/products/heimdall/&lt;/a&gt; (! using 1.3.2 is not working on galaxy s3!).  &lt;br /&gt;First bring the device into download mode by pressing volume down+menu+power key. Then check if heimdall detects the device: &lt;br /&gt;# heimdall detect &lt;br /&gt;you should see the message &quot;Device detected&quot;. If the device is not detected (&quot;Failed to detect compatible download-mode device.&quot;) try to restart the device and put it into download mode again.  &lt;br /&gt; &lt;br /&gt;If this is working, flash it! &lt;br /&gt;# heimdall flash --primary-boot boot.img&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 04 Mar 2013 15:36:35 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">87 at </guid>
 <comments>/blog/how-to-build-android-kernel#comments</comments>
</item>
<item>
 <title>How to customize your Android boot animation</title>
 <link>/blog/how-to-customize-your-android-boot-animation</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;This short tutorial helps you to create your own custom boot animation for Android. It requires an existing animation in form of several png files where each file represents one frame. To make an animation in linux you can use one of these editing applications: &lt;a href=&quot;http://www.cyberciti.biz/faq/top5-linux-video-editing-system-software/&quot; target=&quot;_blank&quot;&gt;http://www.cyberciti.biz/faq/top5-linux-video-editing-system-software/&lt;/a&gt;. Most of those applications are also able to export to png file series.&lt;/p&gt;
&lt;p&gt;Further details on this topic can be found at the xda-developers page: &lt;a href=&quot;http://forum.xda-developers.com/showthread.php?t=1852621&quot; target=&quot;_blank&quot;&gt;http://forum.xda-developers.com/showthread.php?t=1852621&lt;/a&gt;&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;1. Create a new directory &quot;bootanimation&quot;&lt;/h4&gt;
&lt;h4 class=&quot;header&quot;&gt;2. Insert the parts of your animation in sub-directories (e.g. part0 part1 ...)&lt;/h4&gt;
&lt;h4 class=&quot;header&quot;&gt;3. Create an empty document named &quot;desc.txt&quot;&lt;/h4&gt;
&lt;p&gt;Write the description of your animation in there. Format:&lt;br /&gt; &amp;lt;width in px&amp;gt; &amp;lt;height in px&amp;gt; &amp;lt;fps&amp;gt;&lt;br /&gt; ( (p|c) &amp;lt;no of repeat (0=inf)&amp;gt; &amp;lt;pause in seconds&amp;gt; &amp;lt;folder name&amp;gt; )+&lt;/p&gt;
&lt;p&gt;&amp;lt;folder name&amp;gt; ... one of the sub-directories you created in step 2&lt;/p&gt;
&lt;p&gt;example file&lt;br /&gt;&lt;em&gt;480 180 10&lt;/em&gt;&lt;br /&gt;&lt;em&gt;p 1 0 part0&lt;/em&gt;&lt;br /&gt;&lt;em&gt;c 0 0 part1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This example animation consists of three parts and runs on a rate of 10 frames per second. The first part of the animation runs only once at the beginning. Part1 will start afterwards and runs during the complete boot up phase.&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;4. Zip file&lt;/h4&gt;
&lt;p&gt;Create a uncompressed zip file from all files inside the &quot;bootanimation&quot; directory:&lt;br /&gt; $ zip -r -0 bootanimation.zip desc.txt part0 part1 part2&lt;/p&gt;
&lt;h4 class=&quot;header&quot;&gt;5. Put the bootanimation.zip file to your phone&lt;/h4&gt;
&lt;p&gt;The animation is located on the system partition under /system/media/bootanimation.zip. To change the existing bootanimation with your newly created zip file you require root access to your device as you will have to remount the system partition (system partition is mounted as a read-only filesystem in the standard configuration). Remount it first as read-write:&lt;br /&gt; $ adb shell&lt;br /&gt; $ su&lt;br /&gt; $ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system&lt;/p&gt;
&lt;p&gt;Now you can push it to the device:&lt;br /&gt; $ adb push bootanimation.zip system/media/&lt;/p&gt;
&lt;p&gt;5.1 (Optional) Add it to your build system &lt;br /&gt; In certain build systems (cm) you can copy the bootanimation.zip to your source build folder under:&lt;br /&gt; vendor/&amp;lt;vendor&amp;gt;/prebuilt/bootanimations/&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 04 Mar 2013 15:31:02 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">88 at </guid>
 <comments>/blog/how-to-customize-your-android-boot-animation#comments</comments>
</item>
<item>
 <title>Kick-Off meeting</title>
 <link>/blog/kick-off-meeting</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;Last friday was our kick-off meeting in Hagenberg. The whole consortium took part and we had very interesting discussions about the future of our research group.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 26 Nov 2012 08:02:59 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">162 at </guid>
 <comments>/blog/kick-off-meeting#comments</comments>
</item>
<item>
 <title>Security leak in Google Wallet</title>
 <link>/blog/security-leak-in-google-wallet</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot; property=&quot;content:encoded&quot;&gt;&lt;p&gt;Michael Roland, a colleague at the research facilities, found a major security bug in the Google Wallet. With a men in the middle attack an intruder was able to monitor and access credit card transfers. Check out the details on &lt;a title=&quot;futurezone&quot; href=&quot;http://futurezone.at/science/oesterreicher-deckt-nfc-luecke-bei-google-auf/24.586.384&quot; target=&quot;_blank&quot;&gt;futurezone&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 25 Oct 2012 11:54:54 +0000</pubDate>
 <dc:creator>mihoelzl</dc:creator>
 <guid isPermaLink="false">161 at </guid>
 <comments>/blog/security-leak-in-google-wallet#comments</comments>
</item>
</channel>
</rss>
