<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Developer World &#187; java</title>
	<atom:link href="http://developer.sonymobile.com/wp/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://developer.sonymobile.com/wp</link>
	<description>Sony Ericsson Developer World</description>
	<lastBuildDate>Wed, 16 May 2012 07:55:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Powerful tool to analyse your APKs now released [open source]</title>
		<link>http://developer.sonymobile.com/wp/2012/04/13/powerful-tool-to-analyse-your-apks-now-released-open-source/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=powerful-tool-to-analyse-your-apks-now-released-open-source</link>
		<comments>http://developer.sonymobile.com/wp/2012/04/13/powerful-tool-to-analyse-your-apks-now-released-open-source/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 15:32:28 +0000</pubDate>
		<dc:creator>Joe Padre</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Portal]]></category>
		<category><![CDATA[analysis tool]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android development]]></category>
		<category><![CDATA[APKAnalyser]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://developer.sonymobile.com/wp/?p=5870</guid>
		<description><![CDATA[Are you an app developer looking for a powerful app analysis tool?  Do you want to get a good view of the architecture and dependencies in your app? Ever tried to disassemble bytecodes in Android™ apps? You can do all this and much more with ApkAnalyser, our new virtual analysis tool that we’re also making [...]]]></description>
			<content:encoded><![CDATA[<p>Are you an app developer looking for a powerful app analysis tool?  Do you want to get a good view of the architecture and dependencies in your app? Ever tried to disassemble bytecodes in Android™ apps? You can do all this and much more with ApkAnalyser, our new virtual analysis tool that we’re also making available as <a title="Sony Developer World GitHub" href="https://github.com/sonyericssondev/" target="_blank">open source</a>. Learn more after the jump.</p>
<p><span id="more-5870"></span></p>
<p>ApkAnalyser is a static, virtual analysis tool for examining and validating the development work of your Android™ app. It&#8217;s a complete tool chain which supports modification of the binary application with more printouts. You are then able to repack, install, run and verify the result from <a title="logcat description" href="http://wiki.cyanogenmod.com/wiki/Logcat" target="_blank">logcat</a>. ApkAnalyser also supports resource analysis, and you can decode XML, look up resource references and detect potential issues in your app. This tool is completely written in Java and requires JRE 1.6 or above. It works on Windows, Linux and Mac OS X. To download and install it, please check out the instructions below.</p>
<p><strong>Key features</strong></p>
<p>ApkAnalyser actually includes a number of useful features in several different areas, such as when you’re <strong>exploring code and XML</strong>, digging deeper in the <strong>architecture and dependencies</strong>, working with <strong>injection and <a title="deodexing overview" href="http://www.android-advice.com/2011/what-is-odex-and-deodex/" target="_blank">deodexing</a></strong>, or when you’re making a <strong>resource analysis</strong>. Other features include:</p>
<ul>
<li>Explore packages, classes, methods and fields, and look up packages, classes, methods, references and read/write accesses.</li>
<li>Disassemble <a title="Dalvik overview" href="http://code.google.com/p/dalvik/" target="_blank">Dalvik</a> bytecode methods with syntaxes highlighted.</li>
<li>Decode Android XML files with syntaxes highlighted.</li>
<li>Display UML packages and class diagrams, and highlight package and class dependencies.</li>
<li>Modify the APK file with predefined Dalvik bytecode injections.</li>
<li>View the logcat with debug level filters.</li>
<li>Support odex applications and libraries.</li>
<li>List resource IDs and its contents.</li>
<li>Find unused resources by resource ID or files.</li>
<li>Find system resource (@android) references.</li>
</ul>
<p>For more information about the different features, check out the <a title="APKAnalyser wiki page" href="https://github.com/sonyericssondev/ApkAnalyser/wiki" target="_blank">APKAnalyser wiki page</a>.</p>
<p><strong>Download ApkAnalyser and get started<br />
</strong>So if you’re an Android™ app developer, ApkAnalyser might speed up your analysis work and give you a lot more insights. Here’s how to download and install it:</p>
<ol>
<li>Download the <a title="ApkAnalyser download" href="https://github.com/sonyericssondev/ApkAnalyser/downloads" target="_blank">ApkAnalyser</a> jar file from the Developer World GitHub.</li>
<li>Copy the jar file to your local disk and execute the following command in the command prompt to start ApkAnalyser: java -Xmx1024m -jar ApkAnalyser.jar</li>
<li>Before you start to analyse your apps, you need to configure the ApkAnalyser. Go to <em>File</em> &gt; <em>Set paths. </em>In the <strong>Classpath</strong> tab, you can select several jar files or odex files to be loaded as reference libraries. Or you can simply pick a platform folder in the <strong>Android SDK</strong> tab, for example <em>C:\android-sdk-windows\platforms\android-15</em>. ApkAnalyser will then import all the jar files in that folder. After that, add the APK file on the right side.</li>
<li>Go to <em>File</em> &gt; <em>Settings. Change </em><strong>adb executable</strong> path to point out the location of adb, for example <em>C:\android-sdk-windows\platform-tools\adb.exe</em>.</li>
<li>Start analysing your app by clicking <em>File</em>&gt; <em>Analyse</em>.</li>
</ol>
<p><strong>The main view of ApkAnalyser<br />
</strong>Now if you’ve downloaded and installed ApkAnalyser, you might want to take a quick look around the UI (to learn more, check out the <a title="APKAnalyser wiki" href="https://github.com/sonyericssondev/ApkAnalyser/wiki" target="_blank">Developer World GitHub APKAanalyser wiki</a>). The main window of ApkAnalyser consists of three areas. In the upper left, the tree lists reference libraries with a numerical reference counter. In the upper right, the tree shows the classes and resources of the targeted APK file.</p>
<div id="attachment_5874" class="wp-caption alignnone" style="width: 600px"><img class="size-large wp-image-5874" src="http://developer.sonymobile.com/wp/files/2012/04/APKAnalyser_UI-590x380.jpg" alt="APKAnalyser UI" width="590" height="380" /><p class="wp-caption-text">ApkAnalyser’s main window.</p></div>
<p>When the fields, methods or resource IDs are expanded in the tree, the method invocations, field accesses or resource references for each item will be listed.</p>
<div id="attachment_5876" class="wp-caption alignnone" style="width: 590px"><img class="size-full wp-image-5876" src="http://developer.sonymobile.com/wp/files/2012/04/APKAnalyser_expandedResIDRef.jpg" alt="APKAnalyser expanded Resource ID Reference" width="580" height="57" /><p class="wp-caption-text">Expanded tree showing the reference of the resource ID.</p></div>
<div id="attachment_5878" class="wp-caption alignnone" style="width: 365px"><img class="size-full wp-image-5878" src="http://developer.sonymobile.com/wp/files/2012/04/APKAnalyser_expandedFieldAccRef.jpg" alt="APKAnalyser expanded Field Access Reference" width="355" height="124" /><p class="wp-caption-text">Expanded tree showing the field access and method invocation references.</p></div>
<p>The area at the bottom of the main view is a preview window. It shows different types of information according to what you select in the right and left trees. In general, there are four kinds of output in the preview window:</p>
<ol>
<li>UML diagrams for packages and classes.</li>
<li>A Dalvik disassembler for methods.
<p><div id="attachment_5894" class="wp-caption alignnone" style="width: 600px"><img class="size-large wp-image-5894" src="http://developer.sonymobile.com/wp/files/2012/04/disassemble-590x323.jpg" alt="Dalvik disassembler" width="590" height="323" /><p class="wp-caption-text">The Dalvik disassembler.</p></div></li>
<li>A resource detail view for resource IDs.</li>
<li>An XML decoder for XML resources.
<p><div id="attachment_5895" class="wp-caption alignnone" style="width: 435px"><img class="size-medium wp-image-5895" src="http://developer.sonymobile.com/wp/files/2012/04/XMLDecoder-425x321.jpg" alt="XML Decoder" width="425" height="321" /><p class="wp-caption-text">The XML decoder.</p></div></li>
</ol>
<p><strong>Verifying resources with ApkAnalyser</strong></p>
<p>Another good use of ApkAnalyser is to make it help you verify resources. Maybe you’re tired of seeing <strong>Resources$NotFoundException</strong> when your apps are crashing? Or maybe you have some text strings missing translation?  Here are some scenarios where ApkAnalyser can help you:</p>
<ul>
<li>When there’s <strong>missing resources in the package</strong>. The resource is registered but the content is missing while Android Asset Packaging Tool (aapt) packs it.</li>
<li>When there’s <strong>no DPI specific resource</strong>. The DPI specific resource is missing, and there is no default value on that resource.</li>
<li>When there’s <strong>no default value</strong> of the resource.</li>
<li>When there’s <strong>missing t</strong><strong>ranslations</strong>. ApkAnalyer will then collect all the language information from the resource file (resources.arsc), and use it to verify the resources one by one. A report will then be generated, showing all the resources that are missing some language configurations.</li>
</ul>
<p>All of this will help you verify all the resources, and list potential problems.</p>
<p>To verify your resources, click <em>Resource</em> &gt; <em>Verify xml resources</em>. All you need to do is to provide the screen pixel density (dpi) of your targeting device. &#8220;ldpi&#8221;, &#8220;mdpi&#8221;, &#8220;hdpi&#8221; or &#8220;xhdpi&#8221; can be selected in the sub menu, and if the application is not a specific DPI build, “nodpi” could be selected.</p>
<p><strong>Bytecode modifications<br />
</strong>ApkAnalyser also makes it possible to create a set of bytecode modifications, which could be applied to the APK file in a batch. This automatically adds printouts of suspicious pieces of code, to support you in investigating the execution flow of the application.</p>
<p>You can do this by using any of the two quick samples below. You can choose to apply them on some packages, classes or even the whole APK. The first sample will print all the input parameters of a method in the ApiDemo application from <a title="Android SDK" href="http://developer.android.com/sdk/index.html" target="_blank">Android SDK</a>. The second sample shows how to get the return value of a method.</p>
<p><em>How to print all the input parameters of a method:</em><em></em></p>
<ol>
<li>In the targeted APK’s tree, navigate to “com.example.android.apis.graphics”.</li>
<li>Select “FingerPaint$MyView.”</li>
<li>Right click “touch_move(float x, float y).”</li>
<li>Apply “Print method entry(with params)”.</li>
</ol>
<p>This will append the following output to the logcat when the method is being invoked:</p>
<p><code>&gt;com.example.android.apis.graphics.FingerPaint$MyView:touch_move(float x, float y)void(0,102)</p>
<p>parameter[0]: float x = 155.0</p>
<p>parameter[1]: float y = 290.0</code></p>
<p><em>How to get the return value of a method:</em></p>
<ol>
<li>In the targeted APK’s tree, navigate to “com.example.android.apis.graphics.”</li>
<li>Select “FingerPaint$MyView.”</li>
<li>Right click “onTouchEvent(android.view.MotionEvent event) boolean.“</li>
<li>Apply “Print method exit(with return value)”.</li>
</ol>
<p>This will append the following output to the logcat when the method returns:</p>
<p><code>&lt; com.example.android.apis.graphics.FingerPaint$MyView:onTouchEvent(android.view.MotionEvent event)boolean(10,137)</p>
<p>return: boolean = true</code></p>
<p>More than twenty types of modifications to create different sets of bytecode are supported. To find out more about these, a complete tutorial is available on the <a title="Developer World GitHub APKAnalyser tutorial wiki page" href="https://github.com/sonyericssondev/ApkAnalyser/wiki" target="_blank">Developer World GitHub APKAnalyser tutorial wiki</a> page.</p>
<p><strong>Use and improve ApkAnalyser<br />
</strong>We hope many of you will have great use of ApkAnalyser – feel free to start <a href="https://github.com/sonyericssondev/ApkAnalyser/downloads">downloading</a> it today! Since ApkAnalyser is open source, we would be really happy if you would work together with us to improve this tool. If you have any ideas, feel free to contact us, either through the comments of this blogpost, or by checking out the <a title="APKAnalyser forum on XDA forum" href="http://forum.xda-developers.com/showthread.php?p=24808717#post24808717" target="_blank">ApkAnalyser forum thread</a> on XDA forum.</p>
<p>So what do you think? Will this tool be useful for you?</p>
<p><strong>More information:</strong></p>
<ul>
<li>Download the <a href="https://github.com/sonyericssondev/ApkAnalyser/downloads">ApkAnalyser jar-file</a> to start using the tool.</li>
<li>Download the <a title="APKAnalyser source code" href="https://github.com/sonyericssondev/ApkAnalyser" target="_blank">ApkAnalyser source code</a> from the Developer World GitHub.</li>
<li>Read more on the <a title="APKAnalyser wiki" href="https://github.com/sonyericssondev/ApkAnalyser/wiki" target="_blank">ApkAnalyser wiki</a> pages.</li>
<li>Check out the <a title="APKAnalyser tutorials" href="https://github.com/sonyericssondev/ApkAnalyser/wiki/Tutorials" target="_blank">ApkAnalyser analysis and injection tutorials</a>.</li>
<li>Learn more in the <a title="APKAnalyser troubleshooting" href="https://github.com/sonyericssondev/ApkAnalyser/wiki/Trouble-shooting" target="_blank">ApkAnalyser troubleshooting section</a>.</li>
<li>Check out other <a title="Sony Ericsson analysis tools" href="http://developer.sonyericsson.com/wportal/devworld/technology/android/analysis-tools/overview?cc=gb&amp;lc=en">Sony Ericsson analysis tools</a> for developers.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.sonymobile.com/wp/2012/04/13/powerful-tool-to-analyse-your-apks-now-released-open-source/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

