<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Flipkart Mobile Engineering Blog - Medium]]></title>
        <description><![CDATA[Flipkart Mobile Engineering Blog - Medium]]></description>
        <link>https://medium.com/flipkart-android-engineering-blog?source=rss----7c43521a0fea---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Flipkart Mobile Engineering Blog - Medium</title>
            <link>https://medium.com/flipkart-android-engineering-blog?source=rss----7c43521a0fea---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:43:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/flipkart-android-engineering-blog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SSL Pinning on android]]></title>
            <link>https://medium.com/flipkart-android-engineering-blog/ssl-pinning-on-android-3f5cacc8f2b5?source=rss----7c43521a0fea---4</link>
            <guid isPermaLink="false">https://medium.com/p/3f5cacc8f2b5</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Mohit Agarwal]]></dc:creator>
            <pubDate>Tue, 21 Jun 2016 11:06:02 GMT</pubDate>
            <atom:updated>2016-05-14T11:40:19.781Z</atom:updated>
            <content:encoded><![CDATA[<p>In modern day Mobile Applications security is one of the most important considerations. App Tampering, Data leakages, SSL issues like Man in the Middle attacks are just a few of the many issues mobile developers have to constantly keep in mind. In this article I would be discussing about a special type of Man-in -the-middle attack wherein though communication between server and client happens over SSL, a third party is still able to intercept and read the traffic. If you need to understand the basics of Man-in-the-middle attack, you may read it <a href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack"><em>here</em></a><em>.</em></p><p>A typical client-server architecture involves the client requesting data over HTTP/HTTPS and server responding with the required data. In order to secure the data, requests are usually sent over HTTPS protocol in which data is encrypted as it is transmitted. Also to ensure data is coming from authorised and recognised server, server will have to produce a valid certificate issued by an authorised <a href="https://en.wikipedia.org/wiki/Certificate_authority">Certificate Authority(CA)</a>.</p><h4>The Problem</h4><p>Problem arises when a malicious attacker owning a valid certificate (<em>issued by a CA</em>) intercepts the requests coming from the client validating himself with his certificate. He can probe the response from the actual server and modify it to his advantage before sending the data back to the client. He will also get access to the user’s private and confidential information contained in requests and responses. <strong>This happens because clients usually only check if the server has a valid certificate without checking if the certificate the server carries is the one owned by server it is supposed to be interacting with.</strong></p><p>This happens because most of the developers tend to register for “<strong>trust all hosts</strong>” in their code something like this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac041a3e0be4def88b4de30e04b235bf/href">https://medium.com/media/ac041a3e0be4def88b4de30e04b235bf/href</a></iframe><h4>Solution — SSL Pinning</h4><p>With SSL Pinning the client not only ensures that the server it is interacting with has a valid certificate but also checks that it is interacting with the server it is supposed to be interacting with. In the next sequence of steps I will explain how to implement this in Android. Similar principle applies for all other clients.</p><p>The first thing to decide is what should be pinned. For this choice, you have two options:</p><ol><li>pin the certificate.</li><li>pin the public key.</li></ol><p>If you choose to pin public keys, you have two additional choices:</p><ul><li>pin the subjectPublicKeyInfo</li><li>pin one of the concrete types such as RSAPublicKey or DSAPublicKey.</li></ul><p>In this article let us discuss how to pin <strong>RSA Public key</strong></p><p><strong>Step-1</strong></p><p>The first step is to get the RSA Public Key. To do that</p><ul><li>Create a PubKeyManager class which implements X509TrustManager and log the RSA Key.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/99cdcace4c549353f40c775a9dd862c9/href">https://medium.com/media/99cdcace4c549353f40c775a9dd862c9/href</a></iframe><ul><li>Remember when we trusted all hosts. Replace it with the following</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d7821bfb9562235204c4b937f2508ba/href">https://medium.com/media/4d7821bfb9562235204c4b937f2508ba/href</a></iframe><p><strong>Step-2</strong></p><ul><li>Run the code and keep an eye on the logs. Replace the &lt;<em>DUMMY RSA KEY</em>&gt; with the RSA Key you see in the logs.</li></ul><h4>Limitations</h4><p>Though SSL pinning might lower the possible changes of security breach, but there are applications like <a href="https://github.com/iSECPartners/Android-SSL-TrustKiller">SSL Trust Killer</a> and <a href="https://github.com/iSECPartners/android-ssl-bypass">Android SSL ByPass</a> by manipulating the application or device during runtime.</p><p>References : <a href="https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning">https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f5cacc8f2b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flipkart-android-engineering-blog/ssl-pinning-on-android-3f5cacc8f2b5">SSL Pinning on android</a> was originally published in <a href="https://medium.com/flipkart-android-engineering-blog">Flipkart Mobile Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to implement Dynamic Views in Android ?]]></title>
            <link>https://medium.com/flipkart-android-engineering-blog/how-to-implement-dynamic-views-in-android-79e527d606d2?source=rss----7c43521a0fea---4</link>
            <guid isPermaLink="false">https://medium.com/p/79e527d606d2</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Swaroop Ps]]></dc:creator>
            <pubDate>Mon, 20 Jun 2016 15:07:12 GMT</pubDate>
            <atom:updated>2016-05-19T06:17:24.202Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the challenges of being an Android developer is to minimise unnecessary app updates . Releasing updates for small UI changes hurts a bit.</p><p>Imagine a situation where</p><p>— A view in your app has to be changed dynamically from time to time.</p><p>— A new component has to be added in a layout.</p><p>The common practice to handle the above situations is to make respective changes and release an update .</p><p><strong>This post will try to throw some light on a technique which can update Android native layouts on the go without releasing any updates.</strong></p><p><a href="https://github.com/Avocarrot/json2view"><strong><em>json2view</em></strong></a><strong> </strong>is the best open source library which aims to solve this problem. It can convert a compatible json file to an Android view which can be loaded dynamically. It also provides a functionality to convert an xml layout to a compatible json file.</p><p>A sample code of a layout before and after converting it to a json.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eP9RrcEg3v8dp4_LIbfAvw.png" /><figcaption>A simple edittext in a linear layout</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QrK-8DjTek5yPggCz9U_dQ.png" /><figcaption>Layout after converting to json</figcaption></figure><p>The library in client side understands the json and converts it to a view. The conversion happens using java reflection. Custom views present in the app can also be loaded with little fuss.</p><pre>if (!widget.contains(&quot;.&quot;)) {<br>    widget = &quot;android.widget.&quot; + widget;<br>}<br>Class viewClass = Class.<em>forName</em>(widget);</pre><pre>view = (View) viewClass.getConstructor(Context.class).newInstance(new Object[]{context});</pre><p>All you need to do is add a couple of lines in your activity/fragment to convert json object to a view and boom the layout can be updated anytime.</p><pre>ViewParent parent = (ViewParent)findViewById(R.id.parent_view_id);<br>JSONObject jsonObject = ... // load from network, sdcard etc<br>View sampleView = DynamicView.createView(this, jsonObject, parent);</pre><p>I would like to <strong>suggest this library for a starter with a basic requirement</strong> and would not like to invest much time to solve this problem.</p><blockquote>If <strong>performance</strong> matters a lot to you and your use case is not just to display views and had to do something with the views,<strong> this library is not a perfect fit</strong>. I will go more detailed into a few solutions to overcome the cons.</blockquote><blockquote>But a lot can be learned from the approach used here —<strong> create a json with view properties , write code in your app which can understand the json and convert it to a view and do what ever else you want.</strong></blockquote><p><strong>Rolling up custom solutions</strong></p><p>One of the main drawback of the library is the performance hit to load a complex layout( Imagine the number of reflections taking place).</p><p>Since each app has its own design mantra and custom views, an ideal solution is to use custom views and avoid reflection while creating these views.</p><p>Adding custom view can also reduce the payload by a huge margin as they generally have default properties.</p><p><strong>What about listeners?</strong></p><p>Adding listeners crosses the mind of a developer after displaying views.This can be solved by creating a listening layer on top of this which can listen to and perform common actions in the app.</p><p>For example <em>“action”:”date” </em>can open a date picker.</p><p>This layer can also take care of data binding between views.</p><p>Understanding the requirements and predicting the use cases will play a huge role to create contracts for actions, data binding and create a custom wrapper to this library which can do magic to your app.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79e527d606d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/flipkart-android-engineering-blog/how-to-implement-dynamic-views-in-android-79e527d606d2">How to implement Dynamic Views in Android ?</a> was originally published in <a href="https://medium.com/flipkart-android-engineering-blog">Flipkart Mobile Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>