<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Chirashi Security</title>
	
	<link>http://chirashi.zensay.com</link>
	<description>a blog with scattered thoughts on security.</description>
	<lastBuildDate>Sun, 25 Jul 2010 05:25:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/chirashisec" /><feedburner:info uri="chirashisec" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Everything can be reversed.  Everything.</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/oSes4lPUI94/</link>
		<comments>http://chirashi.zensay.com/2010/07/everything-can-be-reversed-everything/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 05:25:30 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[decompiler]]></category>
		<category><![CDATA[disassembler]]></category>
		<category><![CDATA[license keys]]></category>
		<category><![CDATA[registration keygen]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=533</guid>
		<description><![CDATA[ I recently started reverse engineering BlackBerry applications.  I have done it before, but this time around, I focused a lot more effort and energy on it.  In short, BlackBerry apps can be decompiled; enough to the point where you can begin to write keygens for them.  Yes, much like back in the good old [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Reversing" src="http://imgs.xkcd.com/comics/reverse_euphemisms.png" alt="" width="210" height="275" /> I recently started reverse engineering BlackBerry applications.  I have done it before, but this time around, I focused a lot more effort and energy on it.  In short, BlackBerry apps can be decompiled; enough to the point where you can begin to write keygens for them.  Yes, much like back in the good old days.  I&#8217;ll spare everyone the details suffice it to say that I took the BlackBerry compiler that converts .java files to .cod files and I made it reverse its core task and spit out the BlackBerty bytecode instead of .cod files.  Bytecode that runs on the BlackBerry specific JVM.</p>
<p>The fundamental thing about reverse engineering is that you absolutely need to know how things work in forward first.  You cannot reverse without knowing how things go forwards.  So I studied the compilation process in depth and discovered that the compilation is a three-step process.  The BlackBerry compile process is not, in actuality, something magical.  It first runs javac on a plain old .java file.  The resulting .class file is then <a href="http://docs.blackberry.com/en/developers/deliverables/5580/Preverifying_BB_java_applications_447176_11.jsp" target="_blank">preverified</a> (a process by which you alter the class file in a way that you save the device JVM significant processing time).  After this, the BlackBerry compiler (rapc.jar) is executed to covert the .class file into a .cod file.  This .cod file is significantly smaller than the .class file.  It also appears to be compressed.  It is not a simple task to reverse this process.  Primarily because rapc.jar is obfuscated like a mofo and you need to spend countless hours refactoring and getting things to play well together.  But you don&#8217;t want to hear that do you?  No, instead you want to hear that I am able to reverse .cod files to the point at which I have pristine .java source code, right?  Well, yes.  I can do that.</p>
<p>As I often need to appease my evil personality, I did what most anyone else in my position would do.  I looked at a few programs out there to see if I can bypass their license key requirements.  The result?  Can you say &#8220;Shooting fish in a barrel&#8221;?  Ordinarily, I would take this moment to chide all the developers out there to use better protection, I am not going to do this today.  These days, any capable person with a laptop can write and sell applications for the iPhone or the BlackBerry.  Gone are the days where you see only larger software houses publishing commercial applications.  Now just about anyone can do it.  What each individual is willing to lose to piracy and the amount of effort they wish to spend on writing software protection is entirely up to them.  All I&#8217;m going to do today is say this: Everything can be reversed.  Everything.</p>
<p>Don&#8217;t be lulled into a false sense of security that when you write an app for the BlackBerry, your code is safe; it is not.  Your commercial protections CAN and WILL be broken.  Unless you want to lose money to this problem, the only suggestion I can offer is to consider spending more effort in designing better protections.  If not, then just forget it and go about your business as you normally would.  But be aware that an increasing number of people have the means to reverse your code.  It will only be a matter of time before sites will pop up with real working keygens that you can run on your BlackBerry device.  It will be like the second coming of the PC era where good old DOS games had keygens and keygenning groups flourished.  For those interested, what would good protection consist of?</p>
<ul>
<li>Don&#8217;t do any calculations within your app that you can compare to.</li>
<li>Consider activating your app over the internet.</li>
<li>When activating your app over the internet, use SSL, and more important, VERIFY your server certificate.</li>
<li>If you need to offer trials, write two separate programs: 1 less functional trial and 1 full featured version.</li>
</ul>
<p>To sum up, make sure that you protect what is important to you.  If your application generates revenue for you, then you will want to protect it.  Spend a little extra effort on designing a better software protection framework.  To everyone those who don&#8217;t know where to start, the company I work for offers consulting on this subject.  Get in touch with me if you&#8217;re serious about it.</p>



Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F&amp;title=Everything%20can%20be%20reversed.%20%20Everything.&amp;bodytext=%20I%20recently%20started%20reverse%20engineering%20BlackBerry%20applications.%20%C2%A0I%20have%20done%20it%20before%2C%20but%20this%20time%20around%2C%20I%20focused%20a%20lot%20more%20effort%20and%20energy%20on%20it.%20%C2%A0In%20short%2C%20BlackBerry%20apps%20can%20be%20decompiled%3B%20enough%20to%20the%20point%20where%20you%20can%20begin%20to%20wr" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F&amp;title=Everything%20can%20be%20reversed.%20%20Everything.&amp;notes=%20I%20recently%20started%20reverse%20engineering%20BlackBerry%20applications.%20%C2%A0I%20have%20done%20it%20before%2C%20but%20this%20time%20around%2C%20I%20focused%20a%20lot%20more%20effort%20and%20energy%20on%20it.%20%C2%A0In%20short%2C%20BlackBerry%20apps%20can%20be%20decompiled%3B%20enough%20to%20the%20point%20where%20you%20can%20begin%20to%20wr" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F&amp;t=Everything%20can%20be%20reversed.%20%20Everything." title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F&amp;title=Everything%20can%20be%20reversed.%20%20Everything.&amp;annotation=%20I%20recently%20started%20reverse%20engineering%20BlackBerry%20applications.%20%C2%A0I%20have%20done%20it%20before%2C%20but%20this%20time%20around%2C%20I%20focused%20a%20lot%20more%20effort%20and%20energy%20on%20it.%20%C2%A0In%20short%2C%20BlackBerry%20apps%20can%20be%20decompiled%3B%20enough%20to%20the%20point%20where%20you%20can%20begin%20to%20wr" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F&amp;title=Everything%20can%20be%20reversed.%20%20Everything." title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F&amp;title=Everything%20can%20be%20reversed.%20%20Everything." title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F&amp;t=Everything%20can%20be%20reversed.%20%20Everything.&amp;s=%20I%20recently%20started%20reverse%20engineering%20BlackBerry%20applications.%20%C2%A0I%20have%20done%20it%20before%2C%20but%20this%20time%20around%2C%20I%20focused%20a%20lot%20more%20effort%20and%20energy%20on%20it.%20%C2%A0In%20short%2C%20BlackBerry%20apps%20can%20be%20decompiled%3B%20enough%20to%20the%20point%20where%20you%20can%20begin%20to%20wr" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Everything%20can%20be%20reversed.%20%20Everything.%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Everything%20can%20be%20reversed.%20%20Everything.&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Feverything-can-be-reversed-everything%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/oSes4lPUI94" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2010/07/everything-can-be-reversed-everything/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2010/07/everything-can-be-reversed-everything/</feedburner:origLink></item>
		<item>
		<title>Ligatt’s Lawsuits</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/Oo5K57uhyUU/</link>
		<comments>http://chirashi.zensay.com/2010/07/ligatts-lawsuits/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 03:09:51 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Lawsuit]]></category>
		<category><![CDATA[Ligatt]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=509</guid>
		<description><![CDATA[I usually follow the Ligatt saga from afar and typically take on the role of a partially interested observer.  This latest development, however, has made me want to do a little research myself.
So what&#8217;s the deal?  It appears that Greg Evans and Ligatt are suing a number of people for &#8220;stock bashing&#8221;.  The blog post [...]]]></description>
			<content:encoded><![CDATA[<p>I usually follow the Ligatt saga from afar and typically take on the role of a partially interested observer.  This <a href="http://www.ligattsecurity.com/lawsuit/" target="_blank">latest development</a>, however, has made me want to do a little research myself.</p>
<p>So what&#8217;s the deal?  It appears that Greg Evans and Ligatt are suing a number of people for &#8220;stock bashing&#8221;.  The blog post goes on to detail that a group of people have posted comments on various investor websites in the hopes of influencing the Ligatt stock price.  Apparently, they were doing this for &#8220;their own personal reasons&#8221;.  Among the people who engaged in this activity are Chris Riley, Nisha Kappor, Ben Rothke, Randolph Morris.  On the blog post, a tiny image of the document filed in courts is provided.  While the document is indeed small, it was easy to make out the case number: <a href="http://www.gwinnettcourts.com/#casedetail/case:10%2da%2d06012%2d5/" target="_blank">10-A-06012-5</a>.  Further, the post says that the suit was filed in the Gwinnet Courts of Georgia.  A quick run to <a href="http://www.gwinnettcourts.com" target="_blank">http://www.gwinnettcourts.com</a> and a search for the case number reveals a bit more information.</p>
<p>The defendants in this case are filed as John Doe 1-25 and Grey McKenzie.  The John Doe&#8217;s are presumably to indicate that the real name of the defendant is unknown.  It would be likely though, that they use aliases or a.k.a&#8217;s in the court document.</p>
<p>Ligatt&#8217;s retained attorney is also from Georgia &#8211; John A. Moore from <a href="http://moorelawllc.com/" target="_blank">The Moore Law Group LLC</a>.  Mr. Moore represents Ligatt in most of its cases in Gwinnet Courts.</p>
<p>What is most interesting to me is the <a href="http://www.gwinnettcourts.com/#partycasesearch/pnamelast:ligatt/qfields:8199/pcsform:1/" target="_blank">other cases</a> that come up when searching the court records.  The categories include &#8220;General Civil-Other&#8221;, &#8220;Small Claims General Civil&#8221; and &#8220;Contract&#8221;.  Looking at the cases, 1 has been filed in 2008, 4 in 2009 and 2 in 2010.  The cases for 2010 include the recent one against 25 John Doe&#8217;s and Grey McKenzie and another interesting case:  One against LaKesha Wilson.  Why interesting?  <a href="http://www.gwinnettcourts.com/#casedetail/case:10%2da%2d05335%2d2/" target="_blank">LaKesha Wilson</a> was the President &amp; COO of Ligatt Security International and <a href="http://www.youtube.com/no1hacker#p/u/19/YnzLf-0Doy4" target="_blank">posted an investor video blog</a> on YouTube.  Guess what? Lakesha had already filed a case of her own against Gregory D Evans for <a href="http://www.gwinnettcourts.com/#casedetail/case:09w%2d27056%2d00/" target="_blank">Stalking</a>.  Search through the cases with first name Gregory and last name Evans for some more fun.</p>
<p>Other people Ligatt has filed cases against include: <a href="http://www.gwinnettcourts.com/#casedetail/case:08%2dc%2d15100%2ds4/" target="_blank">John Doe</a> in 2008, <a href="http://www.gwinnettcourts.com/#casedetail/case:09%2dc%2d03896%2ds5/" target="_blank">Joseph Nemetz</a>, <a href="http://www.gwinnettcourts.com/#casedetail/case:09%2dc%2d03897%2ds5/" target="_blank">Paul S Radich</a>, <a href="http://www.gwinnettcourts.com/#casedetail/case:09%2dc%2d00425%2ds6/" target="_blank">John Doe</a>, <a href="http://www.gwinnettcourts.com/#casedetail/case:09%2dm%2d03823/" target="_blank">Jason Perry</a> in 2009.</p>
<p>Sadly, I can&#8217;t seem to access any of the documents that are filed online.  I would need to visit the court records office physically to do so.  Also, in most of the cases, either there is an order for dismissal or cases have been dismissed.  I&#8217;m not a lawyer, so I cannot comment any further than what I see.  I guess we&#8217;ll just see where this latest case goes.  I dunno, but to me it looks like a colossal waste of the court&#8217;s time and resources in hearing these cases.  Just sayin&#8217;.</p>
<p><strong>Update</strong>: If you want to contribute more information regarding the lawsuits related to Evans and Ligatt, please mail errata[at]attrition.org.  They are working on a summary.</p>



Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F&amp;title=Ligatt%27s%20Lawsuits&amp;bodytext=I%20usually%20follow%20the%20Ligatt%20saga%20from%20afar%20and%20typically%20take%20on%20the%20role%20of%20a%20partially%20interested%20observer.%20%C2%A0This%20latest%20development%2C%20however%2C%20has%20made%20me%20want%20to%20do%20a%20little%20research%20myself.%0D%0A%0D%0ASo%20what%27s%20the%20deal%3F%20%C2%A0It%20appears%20that%20Greg%20Evans%20and" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F&amp;title=Ligatt%27s%20Lawsuits&amp;notes=I%20usually%20follow%20the%20Ligatt%20saga%20from%20afar%20and%20typically%20take%20on%20the%20role%20of%20a%20partially%20interested%20observer.%20%C2%A0This%20latest%20development%2C%20however%2C%20has%20made%20me%20want%20to%20do%20a%20little%20research%20myself.%0D%0A%0D%0ASo%20what%27s%20the%20deal%3F%20%C2%A0It%20appears%20that%20Greg%20Evans%20and" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F&amp;t=Ligatt%27s%20Lawsuits" title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F&amp;title=Ligatt%27s%20Lawsuits&amp;annotation=I%20usually%20follow%20the%20Ligatt%20saga%20from%20afar%20and%20typically%20take%20on%20the%20role%20of%20a%20partially%20interested%20observer.%20%C2%A0This%20latest%20development%2C%20however%2C%20has%20made%20me%20want%20to%20do%20a%20little%20research%20myself.%0D%0A%0D%0ASo%20what%27s%20the%20deal%3F%20%C2%A0It%20appears%20that%20Greg%20Evans%20and" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F&amp;title=Ligatt%27s%20Lawsuits" title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F&amp;title=Ligatt%27s%20Lawsuits" title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F&amp;t=Ligatt%27s%20Lawsuits&amp;s=I%20usually%20follow%20the%20Ligatt%20saga%20from%20afar%20and%20typically%20take%20on%20the%20role%20of%20a%20partially%20interested%20observer.%20%C2%A0This%20latest%20development%2C%20however%2C%20has%20made%20me%20want%20to%20do%20a%20little%20research%20myself.%0D%0A%0D%0ASo%20what%27s%20the%20deal%3F%20%C2%A0It%20appears%20that%20Greg%20Evans%20and" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Ligatt%27s%20Lawsuits%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Ligatt%27s%20Lawsuits&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fligatts-lawsuits%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/Oo5K57uhyUU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2010/07/ligatts-lawsuits/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2010/07/ligatts-lawsuits/</feedburner:origLink></item>
		<item>
		<title>You want the BlackBerry Event Log? beg damnit!</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/zYPptt_JYQ8/</link>
		<comments>http://chirashi.zensay.com/2010/07/you-want-the-blackberry-event-log-beg-damnit/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 07:03:41 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=486</guid>
		<description><![CDATA[It&#8217;s been quite a while since my last post.  I&#8217;ve been a bit on the busy side with work, family and a bit of research.  Inspired by a friend and fellow researcher &#8211; Cst. Shafik Punja, I decided to look deeper into BlackBerry connectivity via USB.  If I succeeded at understanding this topic, I would [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chirashi.zensay.com/wp-content/uploads/2010/07/forensics.png"><img class="alignnone size-full wp-image-500" title="forensics" src="http://chirashi.zensay.com/wp-content/uploads/2010/07/forensics.png" alt="" width="120" height="61" /></a>It&#8217;s been quite a while since my last post.  I&#8217;ve been a bit on the busy side with work, family and a bit of research.  Inspired by a friend and fellow researcher &#8211; Cst. Shafik Punja, I decided to look deeper into BlackBerry connectivity via USB.  If I succeeded at understanding this topic, I would be able to directly connect to a BlackBerry device and collect all the information that I wanted.  I wouldn&#8217;t be bound by tools like JavaLoader or the Desktop Manager and would have the freedom to write my own tools.  Well, I succeeded at understanding this and went a step further, I&#8217;m releasing a tool today.</p>
<div id="_mcePaste">I know that many forensic analysts are always looking at ways to pull data off mobile devices without installing invasive tools.  So I set about coding a tool to do something simple &#8212; pull the BlackBerry Event Log (you can open the event log from a BlackBerry device by holding down &#8220;ALT&#8221; and typing &#8220;LGLG&#8221;) from a BlackBerry device.  Sure, JavaLoader does this, so to differentiate the tool from JavaLoader, I made it a little more intelligent.  I called it <a href="http://chirashi.zensay.com/Resources">beg &#8211; BlackBerry Eventlog Grepper</a>.  beg can add a little bit of sanity to the madness that is the BlackBerry event log.  In other words, it translates the seemingly gibberish looking data to a more human friendly format.</div>
<h4>Example Event Log Output:</h4>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">guid:0x3B91E1630F0745BC time:2010/06/30 22:45:40.0 severity:Always Log type:String app:net.rim.tunnel data:Clos-MagicRudyAPN.rim
guid:0x316C1626A9DDC375 time:2010/06/30 22:45:40.0 severity:Always Log type:String app:net.rim.tcp data:clos
guid:0xB2EC7A712090AD8F time:2010/06/30 22:45:46.0 severity:Always Log type:String app:net.rim.smsui data:UTSC
guid:0xB2EC7A712090AD8F time:2010/06/30 22:45:46.0 severity:Always Log type:String app:net.rim.smsui data:UTSC
guid:0xB2EC7A712090AD8F time:2010/06/30 22:45:54.0 severity:Always Log type:String app:net.rim.smsui data:UTSC
guid:0xB2EC7A712090AD8F time:2010/06/30 22:45:54.0 severity:Always Log type:String app:net.rim.smsui data:UTSC
guid:0xB2EC7A712090AD8F time:2010/06/30 22:45:57.0 severity:Always Log type:String app:net.rim.smsui data:UTSC
guid:0x647E5DBBC34B5549 time:2010/06/30 22:46:09.0 severity:Always Log type:String app:net.rim.clock data:+CHG
guid:0xDAA64EAD4E49C5D5 time:2010/06/30 22:46:09.0 severity:Always Log type:String app:net.rim.usb.pwd data:CbCn
guid:0x5D41D4729582C2DA time:2010/06/30 22:46:09.0 severity:Always Log type:String app:RootRegister data:usbConnectionStateChange:1</pre></div></div>

<div id="_mcePaste">I started by looking at the phone calls that are written to the event log.  One thing you may notice from the event log is this:  If you delete a call from your call history, the event log does not delete it.  So if you pull the event logs, you will be caught in a lie.  I know that my friend in Law Enforcement would find this invaluable, so I started there.  For now, beg is able to dump the event logs, dump only the phone event logs and translate the phone event logs into something more readable.  The output looks something like this:</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sheran<span style="color: #000000; font-weight: bold;">@</span>devbox:~<span style="color: #000000; font-weight: bold;">/</span>progs$ .<span style="color: #000000; font-weight: bold;">/</span>beg <span style="color: #660033;">-p</span> <span style="color: #660033;">-r</span>
Connected to 20fe2f60
<span style="color: #000000;">2010</span><span style="color: #000000; font-weight: bold;">/</span>06<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">30</span> <span style="color: #000000;">21</span>:07:<span style="color: #000000;">55.0</span>: Incoming Call from +<span style="color: #000000;">622157939018</span>
<span style="color: #000000;">2010</span><span style="color: #000000; font-weight: bold;">/</span>06<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">30</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">29</span>:<span style="color: #000000;">19.0</span>: Outgoing Call to 02114045
<span style="color: #000000;">2010</span><span style="color: #000000; font-weight: bold;">/</span>06<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">30</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">30</span>:<span style="color: #000000;">37.0</span>: Outgoing Call to +<span style="color: #000000;">628119917931</span>
<span style="color: #000000;">2010</span><span style="color: #000000; font-weight: bold;">/</span>06<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">30</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">41</span>:<span style="color: #000000;">54.0</span>: Outgoing Call to +<span style="color: #000000;">6281219684934</span>
<span style="color: #000000;">2010</span><span style="color: #000000; font-weight: bold;">/</span>06<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">30</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">53</span>:<span style="color: #000000;">27.0</span>: Outgoing Call to +<span style="color: #000000;">6281219684934</span>
sheran<span style="color: #000000; font-weight: bold;">@</span>devbox:~<span style="color: #000000; font-weight: bold;">/</span>progs$</pre></div></div>

<h3>Inner workings</h3>
<div>First, I&#8217;d like to quickly go over the two main ways that you can connect to your BlackBerry device.  One of the initial methods I used was to write a Python script to take advantage of the libusb and PyUSB libraries.  I would then send raw commands back and forth.  These commands were sniffed from legitimate connections made between the BlackBerry and either JavaLoader or Desktop Manager.  The second method was to use an already existing library called Barry.  <a href="http://netdirect.ca/barry" target="_blank">Barry</a> was developed to allow Linux users to sync their BlackBerry devices on .  Since most of the work was already done, I decided to go with method 2 &#8211; using the Barry library.  So bear in mind that you will need to install the Barry library and it&#8217;s pre-requisites first.</div>
<div>To use beg, just download it and untar/gzip it to a folder.  Then, have a look through the README file.  It contains everything you would ever need to know.  For the moment, beg <strong>only works on Linux</strong> distributions and does require the Barry library and libusb library.  Support can always be found by getting in touch via the <a href="http://chirashi.zensay.com/Contact/" target="_blank">Contact page</a>.</div>



Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F&amp;title=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21&amp;bodytext=It%27s%20been%20quite%20a%20while%20since%20my%20last%20post.%20%C2%A0I%27ve%20been%20a%20bit%20on%20the%20busy%20side%20with%20work%2C%20family%20and%20a%20bit%20of%20research.%20%C2%A0Inspired%20by%20a%20friend%20and%20fellow%20researcher%20-%20Cst.%20Shafik%20Punja%2C%20I%20decided%20to%20look%20deeper%20into%20BlackBerry%20connectivity%20via%20USB.%20%C2" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F&amp;title=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21&amp;notes=It%27s%20been%20quite%20a%20while%20since%20my%20last%20post.%20%C2%A0I%27ve%20been%20a%20bit%20on%20the%20busy%20side%20with%20work%2C%20family%20and%20a%20bit%20of%20research.%20%C2%A0Inspired%20by%20a%20friend%20and%20fellow%20researcher%20-%20Cst.%20Shafik%20Punja%2C%20I%20decided%20to%20look%20deeper%20into%20BlackBerry%20connectivity%20via%20USB.%20%C2" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F&amp;t=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21" title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F&amp;title=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21&amp;annotation=It%27s%20been%20quite%20a%20while%20since%20my%20last%20post.%20%C2%A0I%27ve%20been%20a%20bit%20on%20the%20busy%20side%20with%20work%2C%20family%20and%20a%20bit%20of%20research.%20%C2%A0Inspired%20by%20a%20friend%20and%20fellow%20researcher%20-%20Cst.%20Shafik%20Punja%2C%20I%20decided%20to%20look%20deeper%20into%20BlackBerry%20connectivity%20via%20USB.%20%C2" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F&amp;title=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21" title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F&amp;title=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21" title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F&amp;t=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21&amp;s=It%27s%20been%20quite%20a%20while%20since%20my%20last%20post.%20%C2%A0I%27ve%20been%20a%20bit%20on%20the%20busy%20side%20with%20work%2C%20family%20and%20a%20bit%20of%20research.%20%C2%A0Inspired%20by%20a%20friend%20and%20fellow%20researcher%20-%20Cst.%20Shafik%20Punja%2C%20I%20decided%20to%20look%20deeper%20into%20BlackBerry%20connectivity%20via%20USB.%20%C2" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=You%20want%20the%20BlackBerry%20Event%20Log%3F%20beg%20damnit%21&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F07%2Fyou-want-the-blackberry-event-log-beg-damnit%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/zYPptt_JYQ8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2010/07/you-want-the-blackberry-event-log-beg-damnit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2010/07/you-want-the-blackberry-event-log-beg-damnit/</feedburner:origLink></item>
		<item>
		<title>Data exfiltration via email</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/_VoIMA-D5Ms/</link>
		<comments>http://chirashi.zensay.com/2010/04/data-exfiltration-via-email/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 03:42:50 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[BlackBerry]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=479</guid>
		<description><![CDATA[In an older version of my Bugs program, I used to forward a copy of all the user&#8217;s emails, whether inbound or outbound, to an address of my choosing.  The problem with this is that the message still remains in the sent folder of the user&#8217;s handheld.  Using email to exfiltrate data from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chirashi.zensay.com/wp-content/uploads/2010/04/Screen-shot-2010-07-02-at-9.38.49-AM.png"><img class="alignnone size-thumbnail wp-image-503" title="Screen shot 2010-07-02 at 9.38.49 AM" src="http://chirashi.zensay.com/wp-content/uploads/2010/04/Screen-shot-2010-07-02-at-9.38.49-AM-150x150.png" alt="" width="63" height="63" /></a>In an older version of my Bugs program, I used to forward a copy of all the user&#8217;s emails, whether inbound or outbound, to an address of my choosing.  The problem with this is that the message still remains in the sent folder of the user&#8217;s handheld.  Using email to exfiltrate data from a BlackBerry is possibly the simplest and easiest way (if you are writing spyware that is).  Almost all users will have at least one email address configured on their handhelds &#8211; I mean, this was the whole idea for BlackBerries after all: messaging.  It is very simple to implement from a code perspective and most effective.  I say simple because if you ask any BlackBerry developer about using a Connection to get data out of a BlackBerry, they&#8217;re probably going to sit you down for an hour and talk you through their war-stories of trying to get a reliable connection to the outside world.</p>
<p>So the best way to still continue to use email as a viable form of exfiltration is to make sure your exfiltration emails are deleted from the sent folder (thus not alerting the user to the fact that his emails are going elsewhere).  So we could in theory pull a Folder.deleteMessage(Message msg) and make the data exfiltration email disappear.  There&#8217;s still just one issue.  When you send a message and call this &#8220;deleteMessage&#8221;, there is not so much time for the message to get delivered.  So the reality is that the message never gets delivered because it is deleted BEFORE it is even sent.  So what do we do?  Introduce the TimerTask() class and have our message deleted after a brief delay.  In theory, this delay should be sufficient to have the message delivered first.  Thus was born the following piece of code:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">final</span> Message msg <span style="color: #339933;">=</span> event.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">final</span> Folder folder <span style="color: #339933;">=</span> msg.<span style="color: #006633;">getFolder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">Timer</span> timer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Timer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
timer.<span style="color: #006633;">schedule</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">TimerTask</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        folder.<span style="color: #006633;">deleteMessage</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>, <span style="color: #cc66cc;">10000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This code will give your exfiltration email about 10 seconds before deleting it from the folder.  More than enough for it to get delivered.  So how do we mitigate this?  Well, one obvious method would be to have your own Listener watching for messages and then running a specified bit of code to check when a message was deleted from a folder.  This can then serve as a basis for alerting a user that something &#8220;hinky&#8221; is going on with his email.</p>



Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F&amp;title=Data%20exfiltration%20via%20email%20&amp;bodytext=In%20an%20older%20version%20of%20my%20Bugs%20program%2C%20I%20used%20to%20forward%20a%20copy%20of%20all%20the%20user%27s%20emails%2C%20whether%20inbound%20or%20outbound%2C%20to%20an%20address%20of%20my%20choosing.%20%20The%20problem%20with%20this%20is%20that%20the%20message%20still%20remains%20in%20the%20sent%20folder%20of%20the%20user%27s%20handheld.%20" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F&amp;title=Data%20exfiltration%20via%20email%20&amp;notes=In%20an%20older%20version%20of%20my%20Bugs%20program%2C%20I%20used%20to%20forward%20a%20copy%20of%20all%20the%20user%27s%20emails%2C%20whether%20inbound%20or%20outbound%2C%20to%20an%20address%20of%20my%20choosing.%20%20The%20problem%20with%20this%20is%20that%20the%20message%20still%20remains%20in%20the%20sent%20folder%20of%20the%20user%27s%20handheld.%20" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F&amp;t=Data%20exfiltration%20via%20email%20" title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F&amp;title=Data%20exfiltration%20via%20email%20&amp;annotation=In%20an%20older%20version%20of%20my%20Bugs%20program%2C%20I%20used%20to%20forward%20a%20copy%20of%20all%20the%20user%27s%20emails%2C%20whether%20inbound%20or%20outbound%2C%20to%20an%20address%20of%20my%20choosing.%20%20The%20problem%20with%20this%20is%20that%20the%20message%20still%20remains%20in%20the%20sent%20folder%20of%20the%20user%27s%20handheld.%20" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F&amp;title=Data%20exfiltration%20via%20email%20" title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F&amp;title=Data%20exfiltration%20via%20email%20" title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F&amp;t=Data%20exfiltration%20via%20email%20&amp;s=In%20an%20older%20version%20of%20my%20Bugs%20program%2C%20I%20used%20to%20forward%20a%20copy%20of%20all%20the%20user%27s%20emails%2C%20whether%20inbound%20or%20outbound%2C%20to%20an%20address%20of%20my%20choosing.%20%20The%20problem%20with%20this%20is%20that%20the%20message%20still%20remains%20in%20the%20sent%20folder%20of%20the%20user%27s%20handheld.%20" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Data%20exfiltration%20via%20email%20%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Data%20exfiltration%20via%20email%20&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F04%2Fdata-exfiltration-via-email%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/_VoIMA-D5Ms" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2010/04/data-exfiltration-via-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2010/04/data-exfiltration-via-email/</feedburner:origLink></item>
		<item>
		<title>InputStream to ByteArray on a BlackBerry</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/H_vrUrM6w7o/</link>
		<comments>http://chirashi.zensay.com/2010/01/inputstream-to-bytearray-on-a-blackberry/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 03:53:05 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=473</guid>
		<description><![CDATA[A quick and easy method to read an InputStream to a byte array is available in the IOUtilities class of the BlackBerry API.  I didn&#8217;t check if this is available pre 4.6 or not, but it does exist in 4.6
To read an InputStream directly to a byte array you can do something like this:

1
2
3
FileConnector fconn [...]]]></description>
			<content:encoded><![CDATA[<p>A quick and easy method to read an InputStream to a byte array is available in the <a href="http://www.blackberry.com/developers/docs/4.6.0api/net/rim/device/api/io/IOUtilities.html">IOUtilities</a> class of the BlackBerry API.  I didn&#8217;t check if this is available pre 4.6 or not, but it does exist in 4.6</p>
<p>To read an InputStream directly to a byte array you can do something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">FileConnector fconn <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>FileConnector<span style="color: #009900;">&#41;</span>Connector.<span style="color: #006633;">open</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;testfile.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">InputStream</span> inStream <span style="color: #339933;">=</span> fconn.<span style="color: #006633;">openInputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> byteData <span style="color: #339933;">=</span> IOUtilities.<span style="color: #006633;">streamToBytes</span><span style="color: #009900;">&#40;</span>inStream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>




Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F&amp;title=InputStream%20to%20ByteArray%20on%20a%20BlackBerry&amp;bodytext=A%20quick%20and%20easy%20method%20to%20read%20an%20InputStream%20to%20a%20byte%20array%20is%20available%20in%20the%20IOUtilities%20class%20of%20the%20BlackBerry%20API.%20%C2%A0I%20didn%27t%20check%20if%20this%20is%20available%20pre%204.6%20or%20not%2C%20but%20it%20does%20exist%20in%204.6%0D%0A%0D%0ATo%20read%20an%20InputStream%20directly%20to%20a%20byte%20ar" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F&amp;title=InputStream%20to%20ByteArray%20on%20a%20BlackBerry&amp;notes=A%20quick%20and%20easy%20method%20to%20read%20an%20InputStream%20to%20a%20byte%20array%20is%20available%20in%20the%20IOUtilities%20class%20of%20the%20BlackBerry%20API.%20%C2%A0I%20didn%27t%20check%20if%20this%20is%20available%20pre%204.6%20or%20not%2C%20but%20it%20does%20exist%20in%204.6%0D%0A%0D%0ATo%20read%20an%20InputStream%20directly%20to%20a%20byte%20ar" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F&amp;t=InputStream%20to%20ByteArray%20on%20a%20BlackBerry" title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F&amp;title=InputStream%20to%20ByteArray%20on%20a%20BlackBerry&amp;annotation=A%20quick%20and%20easy%20method%20to%20read%20an%20InputStream%20to%20a%20byte%20array%20is%20available%20in%20the%20IOUtilities%20class%20of%20the%20BlackBerry%20API.%20%C2%A0I%20didn%27t%20check%20if%20this%20is%20available%20pre%204.6%20or%20not%2C%20but%20it%20does%20exist%20in%204.6%0D%0A%0D%0ATo%20read%20an%20InputStream%20directly%20to%20a%20byte%20ar" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F&amp;title=InputStream%20to%20ByteArray%20on%20a%20BlackBerry" title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F&amp;title=InputStream%20to%20ByteArray%20on%20a%20BlackBerry" title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F&amp;t=InputStream%20to%20ByteArray%20on%20a%20BlackBerry&amp;s=A%20quick%20and%20easy%20method%20to%20read%20an%20InputStream%20to%20a%20byte%20array%20is%20available%20in%20the%20IOUtilities%20class%20of%20the%20BlackBerry%20API.%20%C2%A0I%20didn%27t%20check%20if%20this%20is%20available%20pre%204.6%20or%20not%2C%20but%20it%20does%20exist%20in%204.6%0D%0A%0D%0ATo%20read%20an%20InputStream%20directly%20to%20a%20byte%20ar" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=InputStream%20to%20ByteArray%20on%20a%20BlackBerry%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=InputStream%20to%20ByteArray%20on%20a%20BlackBerry&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Finputstream-to-bytearray-on-a-blackberry%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/H_vrUrM6w7o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2010/01/inputstream-to-bytearray-on-a-blackberry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2010/01/inputstream-to-bytearray-on-a-blackberry/</feedburner:origLink></item>
		<item>
		<title>RIM says “Would you like a password hint?”</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/QIQ0D_HCWig/</link>
		<comments>http://chirashi.zensay.com/2010/01/rim-says-would-you-like-a-password-hint/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 02:26:18 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=467</guid>
		<description><![CDATA[It would appear that RIM is planning to provide end-users with a mechanism to remember their passwords.  According to patent application 20090307498, RIM proposes to allow a user to store his password with unique version data to help him remember it later.  As per the patent application, the version data will be in the form [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chirashi.zensay.com/wp-content/uploads/2009/10/topleft.gif"><img class="alignnone size-full wp-image-269" title="topleft" src="http://chirashi.zensay.com/wp-content/uploads/2009/10/topleft.gif" alt="" width="139" height="55" /></a>It would appear that RIM is planning to provide end-users with a mechanism to remember their passwords.  According to patent application <a href="http://appft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&amp;Sect2=HITOFF&amp;d=PG01&amp;p=1&amp;u=%2Fnetahtml%2FPTO%2Fsrchnum.html&amp;r=1&amp;f=G&amp;l=50&amp;s1=%2220090307498%22.PGNR.&amp;OS=DN/20090307498&amp;RS=DN/20090307498" target="_blank">20090307498</a>, RIM proposes to allow a user to store his password with unique version data to help him remember it later.  As per the patent application, the version data will be in the form of a date.  Thus, if the user forgets his password on the initial prompt and as long as he has not exceeded the maximum number of password attempts, he will receive a second prompt that says something like &#8220;The password that has been used is one from 3rd January 2009, please enter it to unlock the device.&#8221;  This can be helpful, but to someone like me who is awful with dates, it won&#8217;t help me much.  Here&#8217;s my initial take on the patent application.  Feel free to provide your views in either the comments or in the <a href="http://www.linkedin.com/groups?gid=2383165" target="_blank">LinkedIn group &#8211; BlackBerry Security</a>.</p>
<p>The thing that jumps out at me regarding this patent application is the fact that RIM is certainly becoming more consumer friendly.  In the country where I reside at the moment, one thing is apparent.  BlackBerries rule.  I have seen teenage girls in malls who have their faces buried in their BlackBerry.  I have also seen the regular business user owning not one but two.  It is easily the most popular phone sold here.  While corporates praise RIM for their security, consumers will not feel the same way.  In my brief, personal experience with alleged power-users, I came away feeling like no one really understood security at all.  This will most likely multiply with regular end-users.  So, in an effort not to appear too anal, RIM seems to have decided to provide a way for a user to remember his password.  Of course the patent refers to &#8220;unique version data&#8221; and remains fairly nebulous on what it can be.  In it&#8217;s patent application, RIM states that this unique data can be a date, integer or string.  It might be that the end-user will have the ability to configure an option like &#8220;prompt me with the 3rd and 8th character of my password&#8221;.  I know the maximum limit for incorrect passwords is no more than 10.  I still think it won&#8217;t be possible to guess a password in 10 attempts.  Thus this is quite a good move in helping make the device both secure and consumer-friendly.  I expect they will roll it out in one of their next OS updates.</p>



Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F&amp;title=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22&amp;bodytext=It%20would%20appear%20that%20RIM%20is%20planning%20to%20provide%20end-users%20with%20a%20mechanism%20to%20remember%20their%20passwords.%20%C2%A0According%20to%20patent%20application%2020090307498%2C%20RIM%20proposes%20to%20allow%20a%20user%20to%20store%20his%20password%20with%20unique%20version%20data%20to%20help%20him%20remember%20it" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F&amp;title=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22&amp;notes=It%20would%20appear%20that%20RIM%20is%20planning%20to%20provide%20end-users%20with%20a%20mechanism%20to%20remember%20their%20passwords.%20%C2%A0According%20to%20patent%20application%2020090307498%2C%20RIM%20proposes%20to%20allow%20a%20user%20to%20store%20his%20password%20with%20unique%20version%20data%20to%20help%20him%20remember%20it" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F&amp;t=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22" title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F&amp;title=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22&amp;annotation=It%20would%20appear%20that%20RIM%20is%20planning%20to%20provide%20end-users%20with%20a%20mechanism%20to%20remember%20their%20passwords.%20%C2%A0According%20to%20patent%20application%2020090307498%2C%20RIM%20proposes%20to%20allow%20a%20user%20to%20store%20his%20password%20with%20unique%20version%20data%20to%20help%20him%20remember%20it" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F&amp;title=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22" title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F&amp;title=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22" title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F&amp;t=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22&amp;s=It%20would%20appear%20that%20RIM%20is%20planning%20to%20provide%20end-users%20with%20a%20mechanism%20to%20remember%20their%20passwords.%20%C2%A0According%20to%20patent%20application%2020090307498%2C%20RIM%20proposes%20to%20allow%20a%20user%20to%20store%20his%20password%20with%20unique%20version%20data%20to%20help%20him%20remember%20it" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=RIM%20says%20%22Would%20you%20like%20a%20password%20hint%3F%22&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2010%2F01%2Frim-says-would-you-like-a-password-hint%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/QIQ0D_HCWig" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2010/01/rim-says-would-you-like-a-password-hint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2010/01/rim-says-would-you-like-a-password-hint/</feedburner:origLink></item>
		<item>
		<title>BlackBall</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/Vz-pCFTwwtc/</link>
		<comments>http://chirashi.zensay.com/2009/12/blackball/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 02:24:51 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jde]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=464</guid>
		<description><![CDATA[I released my first commercial application for the BlackBerry a few days ago.  It&#8217;s called BlackBall and is an application that allows you to filter or block incoming calls based on a specific blacklist that you maintain.  It&#8217;s on an introductory offer at $0.99 until the end of January 2010, so check it [...]]]></description>
			<content:encoded><![CDATA[<p>I released my first commercial application for the BlackBerry a few days ago.  It&#8217;s called <a href="http://blackball.zenconsult.net">BlackBall</a> and is an application that allows you to filter or block incoming calls based on a specific blacklist that you maintain.  It&#8217;s on an introductory offer at <strong>$0.99</strong> until the end of January 2010, so check it out and grab a copy if you find it useful.</p>
<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/Vz-pCFTwwtc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2009/12/blackball/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2009/12/blackball/</feedburner:origLink></item>
		<item>
		<title>App World Dynamic Licensing HOWTO</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/F97jjC53rXQ/</link>
		<comments>http://chirashi.zensay.com/2009/12/app-world-dynamic-licensing-howto/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 09:30:39 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Activation Code]]></category>
		<category><![CDATA[App World]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Licensing]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=452</guid>
		<description><![CDATA[I started releasing commercial applications on BlackBerry App World and yesterday was the first time I used the Dynamic Licensing model.  I devised a quick solution for working with Dynamic Licensing based on Google App Engine and this post shows how this can be achieved and also includes sample source code for other developers in [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I started releasing commercial applications on BlackBerry App World and yesterday was the first time I used the Dynamic Licensing model.  I devised a quick solution for working with Dynamic Licensing based on Google App Engine and this post shows how this can be achieved and also includes sample source code for other developers in a similar situation.  Dynamic Licensing provides a mechanism for granting activation codes to user who purchase applications.  The system works like this:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">As with almost all commercial, downloadable applications, online purchase and activation codes have become the norm.  The end-user pays for the product, downloads it and waits for an activation code to be sent to his email address.  Once he receives the code, he enters it into the app and he can begin using it.  This is straightforward if the developer sells the app on his own store that is hosted on his own server.  If he is to sell it on other stores, however, things become tricky.  Usually, well established stores like MobiHand and others have a mechanism that allows a developer to interface with their storefront for various purposes.  One of these instances is when activation codes are involved.  In cases like these, here is a quick run-down of how the purchase flow works:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1. End-user visits Online Store</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2. End-user buys app from the Online Store</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3. Online Store contacts the Developer Server (using an HTTP POST request) with end-user specific details</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4. Developer Server generates the activation key</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">5. Developer Server responds to the Online Store POST request with an activation key</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">6. Online Store then presents this activation key to the End-user</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">It is the Developer&#8217;s responsibility to get his activation server up and running to ensure steps 3-5 are completed.  Sometimes this can be a painful task; especially after you&#8217;ve spent a few grueling weeks in developing your latest and greatest application.  Here then are the steps to help simplify the process:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">My solution is to setup a free account on Google App Engine to host my activation server routines there.  Why bother you ask?  Here are some advantages that I can see:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1. App Engine is free and can easily be converted to a paid model (reasonably priced) based only on usage of resources</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2. App Engine offers Java so its more likely to be familiar to a BlackBerry developer</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3. No administrative overhead with setting up a server or maintaining it</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4. It&#8217;s cool if you like to get into &#8220;Cloud Computing&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">5. It&#8217;s very easy to move off Google App Engine and onto your own server when you&#8217;re ready because of the standardized modules</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I&#8217;m not going to talk you through how to get an account, sign-up, etc.  Google has tons of docs and tutorials on how to do so.  I&#8217;ll assume you&#8217;ve already got your App Engine and know how to deploy apps on it.  What we&#8217;re going to create is a servlet and optionally, some classes to help us persist the incoming information to the app engine database.  If you&#8217;re using Eclipse with the Google App Engine plugin, then creating a project is simple.  On Eclipse simply click File-&gt;New-&gt;Project and then choose Web Application Project under the Google folder.  By default, a new project will be created with a servlet having the &#8220;doGet&#8221; method.  This method handles only HTTP GET requests.  You also need to create your own &#8220;doPost&#8221; method.  This is usually because stores including App World will POST the data to your URL.  What I do is just swap the doGet with doPost.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I then write my routines to handle the incoming request.  I usually capture all relevant information, extract some key parameters, use it to generate my activation key and provide a response.  For the sake of simplifying things.  Here is the code for my servlet that captures information from BlackBerry App World, generates the Activation Code and responds with that code:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">If you paste the code above into your Eclipse, you will run into some errors.  These are the typical ones and how they can be fixed:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1. The KeyGen Class isn&#8217;t available.  This is my own KeyGen routine for generating Activation Keys.  It takes the BlackBerry PIN as an argument and does some magic on it.  You have to write this one yourself.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2. The Hex Class isn&#8217;t available.  In my case, I wanted to work with Hex strings and convert them back and forth.  I looked up the source to the Apache Commons Codec project and copied across the source code for the Hex class and all its dependencies into my own project.  You do not need to use it, but if you do, then I advise you to look at the Apache Commons Project.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3. The PMF class is missing.  This class is used if you want to Persist or store data. The PMF class source code is standard and Google App Engine has the sample code for it here.  If you need it, I&#8217;ve attached the code later on in this post.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">As far as I recall this is what you will need to address.  Now, lets move onto storing the incoming data on the database.  I store each request in a class called an Entry.  Thus, each POST request to my servlet will be checked and if it isn&#8217;t tagged as a test, then it will be stored to the database.  The Entry object is marked as persistable and this makes it easy to store in the App Engine datastore.  Here is the code for the Entry object:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Once you get this up and running, you have about the simplest mechanism for working with Dynamic Licensing with not only BlackBerry App World, but other stores as well.  You can, of course, make this as grandiose as you wish; that part is left as an exercise.  I&#8217;m just giving you a point to start at.</div>
<p>I started releasing commercial applications on BlackBerry App World and yesterday was the first time I used the Dynamic Licensing model.  I devised a solution based on Google App Engine and this post shows how this can be achieved and also includes sample source code for other developers in a similar situation.  Dynamic Licensing provides a mechanism for granting activation codes to user who purchase applications.  The system works like this:</p>
<div id="attachment_453" class="wp-caption alignnone" style="width: 490px"><a href="http://chirashi.zensay.com/wp-content/uploads/2009/12/appworldflow_sm.png"><img class="size-full wp-image-453" title="appworldflow_sm" src="http://chirashi.zensay.com/wp-content/uploads/2009/12/appworldflow_sm.png" alt="App World Flow" width="480" height="112" /></a><p class="wp-caption-text">App World Flow</p></div>
<p>As with almost all commercial, downloadable applications, online purchase and activation codes have become the norm.  The end-user pays for the product, downloads it and waits for an activation code to be sent to his email address.  Once he receives the code, he enters it into the app and he can begin using it.  This is straightforward if the developer sells the app on his own store that is hosted on his own server.  If he is to sell it on other stores, however, things become tricky.  Usually, well established stores like <a href="http://www.mobihand.com" target="_blank">MobiHand</a> and others have a mechanism that allows a developer to interface with their storefront for various purposes.  One of these instances is when activation codes are involved.  In cases like these, here is a quick run-down of how the purchase flow works:</p>
<ol>
<li>End-user visits Online Store</li>
<li>End-user buys app from the Online Store</li>
<li>Online Store contacts the Developer Server (using an HTTP POST request) with end-user specific details</li>
<li>Developer Server generates the activation key</li>
<li>Developer Server responds to the Online Store POST request with an activation key</li>
<li>Online Store then presents this activation key to the End-user</li>
</ol>
<p>It is the Developer&#8217;s responsibility to get his activation server up and running to ensure steps 3-5 are completed.  Sometimes this can be a painful task; especially after you&#8217;ve spent a few grueling weeks in developing your latest and greatest application.  My solution is to setup a free account on Google App Engine to host my activation server routines there.  Why bother you ask?  Here are some advantages that I can see:</p>
<ol>
<li>App Engine is free and can easily be converted to a paid model (reasonably priced) based only on usage of resources</li>
<li>App Engine offers Java so its more likely to be familiar to a BlackBerry developer</li>
<li>No administrative overhead with setting up a server or maintaining it</li>
<li>It&#8217;s cool if you like to get into &#8220;Cloud Computing&#8221;</li>
<li>It&#8217;s very easy to move off Google App Engine and onto your own server when you&#8217;re ready because of the standardized modules</li>
</ol>
<p>I&#8217;m not going to talk you through how to get an account, sign-up, etc.  Google has tons of docs and tutorials on how to do so.  I&#8217;ll assume you&#8217;ve already got your App Engine and know how to deploy apps on it.  What we&#8217;re going to create is a servlet and optionally, some classes to help us persist the incoming information to the app engine database.  If you&#8217;re using Eclipse with the Google App Engine plugin, then creating a project is simple.  On Eclipse simply click File-&gt;New-&gt;Project and then choose Web Application Project under the Google folder.  By default, a new project will be created with a servlet having the &#8220;doGet&#8221; method.  This method handles only HTTP GET requests.  You also need to create your own &#8220;doPost&#8221; method.  This is usually because stores including App World will POST the data to your URL.  What I do is just swap the doGet with doPost.</p>
<p>I then write my routines to handle the incoming request.  I usually capture all relevant information, extract some key parameters, use it to generate my activation key and provide a response.  For the sake of simplifying things.  Here is the code for my servlet that captures information from BlackBerry App World, generates the Activation Code and responds with that code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">net.zenconsult.keyserver</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.PersistenceManager</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.http.HttpServlet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.http.HttpServletRequest</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.http.HttpServletResponse</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">net.zenconsult.codec.binary.Hex</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;serial&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> KeyServerServlet <span style="color: #000000; font-weight: bold;">extends</span> HttpServlet <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> doPost<span style="color: #009900;">&#40;</span>HttpServletRequest req, HttpServletResponse resp<span style="color: #009900;">&#41;</span>
			<span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// The RIM POST Format:</span>
		<span style="color: #666666; font-style: italic;">// PIN=12341234&amp;email=customeremail@email.com&amp;product=product&amp;version=1.2&amp;transactionid=123&amp;test=false</span>
&nbsp;
		<span style="color: #003399;">String</span> PIN <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;PIN&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> email <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;email&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> product <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;product&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> version <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;version&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> transactionId <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;transactionid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> test <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> verify <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;verify&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//Init vlaues</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>email <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			email <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>product <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			product <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>version <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			version <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>	
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>transactionId <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			transactionId <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>test <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			test <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// I realize using String.matches is taboo, but I did it anyway.  Feel free to change it</span>
		<span style="color: #666666; font-style: italic;">// Since you can also pass your own parameters, I am passing the &quot;verify&quot; parameter; security by obscurity, I know, </span>
		<span style="color: #666666; font-style: italic;">// but when using App Engine, your Servlet is publicly accessible, so...</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>PIN.<span style="color: #006633;">matches</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>p{XDigit}{8}&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>verify <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>verify.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;bbappworld&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// This is my own Key Generation Routine</span>
			KeyGen kg <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> KeyGen<span style="color: #009900;">&#40;</span>PIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003399;">String</span> hexString <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span>Hex.<span style="color: #006633;">encodeHex</span><span style="color: #009900;">&#40;</span>kg.<span style="color: #006633;">genKey</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #003399;">String</span> <span style="color: #003399;">Key</span> <span style="color: #339933;">=</span> hexString.<span style="color: #006633;">toUpperCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>test.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				PersistenceManager pm <span style="color: #339933;">=</span> PMF.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getPersistenceManager</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				Entry entry <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Entry<span style="color: #009900;">&#40;</span>email, product, version, transactionId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				pm.<span style="color: #006633;">makePersistent</span><span style="color: #009900;">&#40;</span>entry<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				pm.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			resp.<span style="color: #006633;">setContentType</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;text/plain&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			resp.<span style="color: #006633;">getWriter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;key=&quot;</span><span style="color: #339933;">+</span><span style="color: #003399;">Key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>If you paste the code above into your Eclipse, you will run into some errors.  These are the typical ones and how they can be fixed:</p>
<ol>
<li>The KeyGen Class isn&#8217;t available.  This is my own KeyGen routine for generating Activation Keys.  It takes the BlackBerry PIN as an argument and does some magic on it.  You have to write this one yourself.</li>
<li>The Hex Class isn&#8217;t available.  In my case, I wanted to work with Hex strings and convert them back and forth.  I looked up the source to the Apache Commons Codec project and copied across the source code for the Hex class and all its dependencies into my own project.  You do not need to use it, but if you do, then I advise you to look at the Apache Commons Project.</li>
<li>The PMF class is missing.  This class is used if you want to Persist or store data. The PMF class source code is standard and Google App Engine has the sample code for it <a href="http://code.google.com/appengine/docs/java/datastore/usingjdo.html" target="_blank">here</a>.  If you need it, I&#8217;ve attached the code later on in this post.</li>
</ol>
<p>As far as I recall this is what you will need to address.  Now, lets move onto storing the incoming data on the database.  I store each request in a class called an Entry.  Thus, each POST request to my servlet will be checked and if it isn&#8217;t tagged as a test, then it will be stored to the database.  The Entry object is marked as persistable and this makes it easy to store in the App Engine datastore.  Here is the code for the Entry object:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">net.zenconsult.keyserver</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Date</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.IdGeneratorStrategy</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.IdentityType</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.PersistenceCapable</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.Persistent</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jdo.annotations.PrimaryKey</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.appengine.api.datastore.Key</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
@PersistenceCapable<span style="color: #009900;">&#40;</span>identityType <span style="color: #339933;">=</span> IdentityType.<span style="color: #006633;">APPLICATION</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Entry 
<span style="color: #009900;">&#123;</span>
	@PrimaryKey
    @Persistent<span style="color: #009900;">&#40;</span>valueStrategy <span style="color: #339933;">=</span> IdGeneratorStrategy.<span style="color: #006633;">IDENTITY</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Key</span> key<span style="color: #339933;">;</span>
&nbsp;
	@Persistent
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> email<span style="color: #339933;">;</span>
&nbsp;
	@Persistent
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> product<span style="color: #339933;">;</span>
&nbsp;
	@Persistent
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> version<span style="color: #339933;">;</span>
&nbsp;
	@Persistent
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> transactionId<span style="color: #339933;">;</span>
&nbsp;
	@Persistent
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Date</span> creationDate<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> Entry<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> email, <span style="color: #003399;">String</span> product, <span style="color: #003399;">String</span> version, <span style="color: #003399;">String</span> transactionId<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		setEmail<span style="color: #009900;">&#40;</span>email<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setProduct<span style="color: #009900;">&#40;</span>product<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setVersion<span style="color: #009900;">&#40;</span>version<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setTransactionId<span style="color: #009900;">&#40;</span>transactionId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setCreationDate<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param key the key to set
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setKey<span style="color: #009900;">&#40;</span><span style="color: #003399;">Key</span> key<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">key</span> <span style="color: #339933;">=</span> key<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @return the key
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Key</span> getKey<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> key<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param email the email to set
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setEmail<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> email<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">email</span> <span style="color: #339933;">=</span> email<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @return the email
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getEmail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> email<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param product the product to set
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setProduct<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> product<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">product</span> <span style="color: #339933;">=</span> product<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @return the product
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getProduct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> product<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param version the version to set
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setVersion<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> version<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">version</span> <span style="color: #339933;">=</span> version<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @return the version
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getVersion<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> version<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param transactionId the transactionId to set
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setTransactionId<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> transactionId<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">transactionId</span> <span style="color: #339933;">=</span> transactionId<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @return the transactionId
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getTransactionId<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> transactionId<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param creationDate the creationDate to set
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setCreationDate<span style="color: #009900;">&#40;</span><span style="color: #003399;">Date</span> creationDate<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">creationDate</span> <span style="color: #339933;">=</span> creationDate<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @return the creationDate
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Date</span> getCreationDate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> creationDate<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Once you get this up and running, you have about the simplest mechanism for working with Dynamic Licensing with not only BlackBerry App World, but other stores as well.  You can, of course, make this as grandiose as you wish; that part is left as an exercise.  I&#8217;m just giving you a point to start at.</p>



Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F&amp;title=App%20World%20Dynamic%20Licensing%20HOWTO&amp;bodytext=I%20started%20releasing%20commercial%20applications%20on%20BlackBerry%20App%20World%20and%20yesterday%20was%20the%20first%20time%20I%20used%20the%20Dynamic%20Licensing%20model.%20%C2%A0I%20devised%20a%20quick%20solution%20for%20working%20with%20Dynamic%20Licensing%20based%20on%20Google%20App%20Engine%20and%20this%20post%20shows%20ho" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F&amp;title=App%20World%20Dynamic%20Licensing%20HOWTO&amp;notes=I%20started%20releasing%20commercial%20applications%20on%20BlackBerry%20App%20World%20and%20yesterday%20was%20the%20first%20time%20I%20used%20the%20Dynamic%20Licensing%20model.%20%C2%A0I%20devised%20a%20quick%20solution%20for%20working%20with%20Dynamic%20Licensing%20based%20on%20Google%20App%20Engine%20and%20this%20post%20shows%20ho" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F&amp;t=App%20World%20Dynamic%20Licensing%20HOWTO" title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F&amp;title=App%20World%20Dynamic%20Licensing%20HOWTO&amp;annotation=I%20started%20releasing%20commercial%20applications%20on%20BlackBerry%20App%20World%20and%20yesterday%20was%20the%20first%20time%20I%20used%20the%20Dynamic%20Licensing%20model.%20%C2%A0I%20devised%20a%20quick%20solution%20for%20working%20with%20Dynamic%20Licensing%20based%20on%20Google%20App%20Engine%20and%20this%20post%20shows%20ho" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F&amp;title=App%20World%20Dynamic%20Licensing%20HOWTO" title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F&amp;title=App%20World%20Dynamic%20Licensing%20HOWTO" title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F&amp;t=App%20World%20Dynamic%20Licensing%20HOWTO&amp;s=I%20started%20releasing%20commercial%20applications%20on%20BlackBerry%20App%20World%20and%20yesterday%20was%20the%20first%20time%20I%20used%20the%20Dynamic%20Licensing%20model.%20%C2%A0I%20devised%20a%20quick%20solution%20for%20working%20with%20Dynamic%20Licensing%20based%20on%20Google%20App%20Engine%20and%20this%20post%20shows%20ho" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=App%20World%20Dynamic%20Licensing%20HOWTO%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=App%20World%20Dynamic%20Licensing%20HOWTO&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fapp-world-dynamic-licensing-howto%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/F97jjC53rXQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2009/12/app-world-dynamic-licensing-howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2009/12/app-world-dynamic-licensing-howto/</feedburner:origLink></item>
		<item>
		<title>Emulating the BlackBerry Phone Call Log Field</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/opCQqaSBToc/</link>
		<comments>http://chirashi.zensay.com/2009/12/emulating-the-blackberry-phone-call-log-field/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 13:54:27 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jde]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=433</guid>
		<description><![CDATA[While writing an application for the BlackBerry, I wanted to emulate the layout of the Phone Log.  Typically, this looks like a set of rows laid out in a two-column or multi-column format.  Since there was no available field to achieve this, I had to write my own.  The way I did it was to [...]]]></description>
			<content:encoded><![CDATA[<p>While writing an application for the BlackBerry, I wanted to emulate the layout of the Phone Log.  Typically, this looks like a set of rows laid out in a two-column or multi-column format.  Since there was no available field to achieve this, I had to write my own.  The way I did it was to override the drawListRow method in an ObjectListField.  One thing you can notice in your BlackBerry call log screen is that the last 10 characters are always reserved and never appear as an ellipsis.  The last 10 characters are usually formatted thusly:</p>
<p><strong>[Call Attribute: upto 4 characters][Date or Time: upto 6 characters]</strong></p>
<p>Some examples of these are:</p>
<pre><code>
(W) 9:58p
(W2)11:22p
(H) 01/09
</code></pre>
<p>You will see in example 2 above, that all 10 characters are used up.  After I figured this out, the rest was pretty straightforward.  Here is the source code to my Field called PhoneNumberListField.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">net.rim.device.api.ui.DrawStyle</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">net.rim.device.api.ui.Graphics</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">net.rim.device.api.ui.component.ListField</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">net.rim.device.api.ui.component.ObjectListField</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PhoneNumberListField <span style="color: #000000; font-weight: bold;">extends</span> ObjectListField
<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> PhoneNumberListField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
     	    <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> PhoneNumberListField<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">long</span> style<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
     	    <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>style<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> drawListRow<span style="color: #009900;">&#40;</span>ListField listField, <span style="color: #003399;">Graphics</span> graphics,
        		<span style="color: #000066; font-weight: bold;">int</span> index, <span style="color: #000066; font-weight: bold;">int</span> y, <span style="color: #000066; font-weight: bold;">int</span> width<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
&nbsp;
        	<span style="color: #003399;">String</span> tmpCol1 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>listField, index<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        	<span style="color: #003399;">String</span> col1 <span style="color: #339933;">=</span> tmpCol1.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #009900;">&#40;</span>tmpCol1.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        	<span style="color: #003399;">String</span> col2 <span style="color: #339933;">=</span> tmpCol1.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span>tmpCol1.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        	<span style="color: #000066; font-weight: bold;">int</span> col2Size <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getFont</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getAdvance</span><span style="color: #009900;">&#40;</span>col2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066; font-weight: bold;">int</span> col1Size <span style="color: #339933;">=</span> width <span style="color: #339933;">-</span> col2Size<span style="color: #339933;">;</span>
&nbsp;
        	<span style="color: #000066; font-weight: bold;">int</span> col1Start <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        	<span style="color: #000066; font-weight: bold;">int</span> col2Start <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>width <span style="color: #339933;">-</span> col2Size<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        	graphics.<span style="color: #006633;">drawText</span><span style="color: #009900;">&#40;</span>col1, col1Start, y, DrawStyle.<span style="color: #006633;">ELLIPSIS</span>, col1Size<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        	graphics.<span style="color: #006633;">drawText</span><span style="color: #009900;">&#40;</span>col2, col2Start, y, DrawStyle.<span style="color: #006633;">HDEFAULT</span>, col2Size<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>How to implement</h3>
<p>You first create an array of Strings.  This array can contain phone numbers or a combination of First Name, Last Name together with the phone attribute like (W), (H) for Work and Home numbers respectively.  The last field will be the date or time.  I check the time of the call to see if it is older than 24 hours.  If it is, I use the date.  The format for the time is “<em>h:mma</em>” and for date it is “<em>MM/dd</em>”.  You can format these using SimpleDateFormat.</p>
<p>The full list of BlackBerry Attributes are represented as follows:</p>
<p>Home: (H)<br />
Work: (W)<br />
Mobile: (M)<br />
Pager: (P)<br />
Fax: (F)<br />
Other: (O)<br />
Work2: (W2)<br />
Home2: (H2)</p>
<p>The attribute constants can be found in the <a href="http://www.blackberry.com/developers/docs/4.6.0api/net/rim/blackberry/api/pdap/BlackBerryContact.html" target="_blank">BlackBerryContact Interface</a>.  A typical array of mine would look like this:</p>
<pre><code>
String[] numList = {“Sheran Gunasekera (W) 09/09”, “Scott Mosier (M) 9:39a”,
“Kevin Smith (M)10:39p”, “+12120031337     10:04p};</code></pre>
<p>Then, if I want to place this field on my MainScreen, I do this:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">PhoneNumberListField numbers <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PhoneNumberListField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
numbers.<span style="color: #006633;">setEmptyString</span><span style="color: #009900;">&#40;</span>“<span style="color: #339933;">***</span> No Calls Yet <span style="color: #339933;">***</span>”, DrawStyle.<span style="color: #006633;">HCENTER</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
numbers.<span style="color: #006633;">set</span><span style="color: #009900;">&#40;</span>numList<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add<span style="color: #009900;">&#40;</span>numbers<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This is what it looks like:</p>
<div id="attachment_444" class="wp-caption alignnone" style="width: 310px"><a href="http://chirashi.zensay.com/wp-content/uploads/2009/12/PhoneNumberListField.png"><img class="size-medium wp-image-444" title="PhoneNumberListField" src="http://chirashi.zensay.com/wp-content/uploads/2009/12/PhoneNumberListField-300x200.png" alt="PhoneNumberListField" width="300" height="200" /></a><p class="wp-caption-text">PhoneNumberListField</p></div>



Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F&amp;title=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field&amp;bodytext=While%20writing%20an%20application%20for%20the%20BlackBerry%2C%20I%20wanted%20to%20emulate%20the%20layout%20of%20the%20Phone%20Log.%C2%A0%20Typically%2C%20this%20looks%20like%20a%20set%20of%20rows%20laid%20out%20in%20a%20two-column%20or%20multi-column%20format.%C2%A0%20Since%20there%20was%20no%20available%20field%20to%20achieve%20this%2C%20I%20had%20" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F&amp;title=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field&amp;notes=While%20writing%20an%20application%20for%20the%20BlackBerry%2C%20I%20wanted%20to%20emulate%20the%20layout%20of%20the%20Phone%20Log.%C2%A0%20Typically%2C%20this%20looks%20like%20a%20set%20of%20rows%20laid%20out%20in%20a%20two-column%20or%20multi-column%20format.%C2%A0%20Since%20there%20was%20no%20available%20field%20to%20achieve%20this%2C%20I%20had%20" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F&amp;t=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field" title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F&amp;title=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field&amp;annotation=While%20writing%20an%20application%20for%20the%20BlackBerry%2C%20I%20wanted%20to%20emulate%20the%20layout%20of%20the%20Phone%20Log.%C2%A0%20Typically%2C%20this%20looks%20like%20a%20set%20of%20rows%20laid%20out%20in%20a%20two-column%20or%20multi-column%20format.%C2%A0%20Since%20there%20was%20no%20available%20field%20to%20achieve%20this%2C%20I%20had%20" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F&amp;title=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field" title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F&amp;title=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field" title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F&amp;t=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field&amp;s=While%20writing%20an%20application%20for%20the%20BlackBerry%2C%20I%20wanted%20to%20emulate%20the%20layout%20of%20the%20Phone%20Log.%C2%A0%20Typically%2C%20this%20looks%20like%20a%20set%20of%20rows%20laid%20out%20in%20a%20two-column%20or%20multi-column%20format.%C2%A0%20Since%20there%20was%20no%20available%20field%20to%20achieve%20this%2C%20I%20had%20" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Emulating%20the%20BlackBerry%20Phone%20Call%20Log%20Field&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Femulating-the-blackberry-phone-call-log-field%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/opCQqaSBToc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2009/12/emulating-the-blackberry-phone-call-log-field/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2009/12/emulating-the-blackberry-phone-call-log-field/</feedburner:origLink></item>
		<item>
		<title>Platform specific download statistics for the BlackBerry</title>
		<link>http://feedproxy.google.com/~r/chirashisec/~3/ChvUJTQ8Y6I/</link>
		<comments>http://chirashi.zensay.com/2009/12/platform-specific-download-statistics-for-blackberries/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 06:54:29 +0000</pubDate>
		<dc:creator>chopstick</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=419</guid>
		<description><![CDATA[I looked at the statistics for the number of downloads of Kisses, that I had today.  It was interesting to see the different types of Operating System versions or Platforms that were indeed downloading the tool.  Over all, I had 3051 downloads for a period of about 6 weeks.  I started writing applications that I [...]]]></description>
			<content:encoded><![CDATA[<p>I looked at the statistics for the number of downloads of Kisses, that I had today.  It was interesting to see the different types of Operating System versions or Platforms that were indeed downloading the tool.  Over all, I had 3051 downloads for a period of about 6 weeks.  I started writing applications that I plan to sell and was faced with the tough decision of choosing features based on the specific OS revision.  If I set a base OS version, then I stood to loose a percentage of the BlackBerry users out there.  So I turned to my existing downloads and came up with this chart.  In the hopes that others find it useful, I&#8217;ve included it in this post.  Surprisingly, I thought there would be more users for 4.2 and 4.3 versions.  Thus, based on this, I will set my base version to 4.5.  This cuts out weeks of development time (mainly making workarounds).  Obviously these figures don&#8217;t paint the full picture, but they give me a fair idea of how to plan.</p>
<p><a href="http://chirashi.zensay.com/wp-content/uploads/2009/12/BlackBerry_OS_Version_Statistics.png"><img class="alignnone size-medium  wp-image-420" title="BlackBerry_OS_Version_Statistics" src="http://chirashi.zensay.com/wp-content/uploads/2009/12/BlackBerry_OS_Version_Statistics-238x300.png" alt="BlackBerry_OS_Version_Statistics" width="238" height="300" /></a></p>
<p style="clear: both;">&nbsp;</p>



Share this on:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F&amp;title=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry&amp;bodytext=I%20looked%20at%20the%20statistics%20for%20the%20number%20of%20downloads%20of%20Kisses%2C%20that%20I%20had%20today.%C2%A0%20It%20was%20interesting%20to%20see%20the%20different%20types%20of%20Operating%20System%20versions%20or%20Platforms%20that%20were%20indeed%20downloading%20the%20tool.%C2%A0%20Over%20all%2C%20I%20had%203051%20downloads%20for%20" title="Digg"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F&amp;title=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry&amp;notes=I%20looked%20at%20the%20statistics%20for%20the%20number%20of%20downloads%20of%20Kisses%2C%20that%20I%20had%20today.%C2%A0%20It%20was%20interesting%20to%20see%20the%20different%20types%20of%20Operating%20System%20versions%20or%20Platforms%20that%20were%20indeed%20downloading%20the%20tool.%C2%A0%20Over%20all%2C%20I%20had%203051%20downloads%20for%20" title="del.icio.us"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F&amp;t=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry" title="Facebook"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F&amp;title=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry&amp;annotation=I%20looked%20at%20the%20statistics%20for%20the%20number%20of%20downloads%20of%20Kisses%2C%20that%20I%20had%20today.%C2%A0%20It%20was%20interesting%20to%20see%20the%20different%20types%20of%20Operating%20System%20versions%20or%20Platforms%20that%20were%20indeed%20downloading%20the%20tool.%C2%A0%20Over%20all%2C%20I%20had%203051%20downloads%20for%20" title="Google Bookmarks"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F&amp;title=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry" title="Reddit"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F&amp;title=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry" title="StumbleUpon"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F&amp;t=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry&amp;s=I%20looked%20at%20the%20statistics%20for%20the%20number%20of%20downloads%20of%20Kisses%2C%20that%20I%20had%20today.%C2%A0%20It%20was%20interesting%20to%20see%20the%20different%20types%20of%20Operating%20System%20versions%20or%20Platforms%20that%20were%20indeed%20downloading%20the%20tool.%C2%A0%20Over%20all%2C%20I%20had%203051%20downloads%20for%20" title="Tumblr"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry%20-%20http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F" title="Twitter"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=Platform%20specific%20download%20statistics%20for%20the%20BlackBerry&amp;url=http%3A%2F%2Fchirashi.zensay.com%2F2009%2F12%2Fplatform-specific-download-statistics-for-blackberries%2F" title="Slashdot"><img src="http://chirashi.zensay.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>


<br/><br/><img src="http://feeds.feedburner.com/~r/chirashisec/~4/ChvUJTQ8Y6I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chirashi.zensay.com/2009/12/platform-specific-download-statistics-for-blackberries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://chirashi.zensay.com/2009/12/platform-specific-download-statistics-for-blackberries/</feedburner:origLink></item>
	</channel>
</rss>
