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

<channel>
	<title>Kanru&#039;s 探險日誌</title>
	<atom:link href="http://blog.kanru.info/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.kanru.info</link>
	<description>當發現美好的事物時，所要做的第一件事，就是把它分享給所有人</description>
	<lastBuildDate>Tue, 24 Aug 2010 08:02:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Android Service with dynamic arguments</title>
		<link>http://blog.kanru.info/archives/861</link>
		<comments>http://blog.kanru.info/archives/861#comments</comments>
		<pubDate>Tue, 24 Aug 2010 08:01:34 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[0xlab]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[init]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=861</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Recently when I was preparing some Android training material I found this little trick.</p>

<p>Android &#8220;init&#8221; can do a lot of things, including &#8220;on property change&#8221; trigger; one can image some applications use this to implement an ad-hoc IPC. One example is the <em>system/libnetutil</em> that monitors the &#8220;init.svc.dhcpcd&#8221; property to detect whether dhcpcd is running or not.</p>

<p>Android framework can execute some predefined command (service) via the &#8220;ctl.start&#8221; property, the most interesting part is you can supply dynamic arguments to the command just like you were calling a command from shell.</p>

<p>The format is</p>

<p><pre class="brush: plain;">
setprop ctl.start service:arg1 arg2 arg3..
</pre></p>

<p>It must be a oneshot service, for example you can define a dhcpcd service like:</p>

<p><pre class="brush: plain;">
service dhcpcd /system/bin/dhcpcd -B
    group dhcp wifi system
    disabled
    oneshot
</pre></p>

<p>And set the target interface dynamically:</p>

<p><pre class="brush: plain;">
setprop ctl.start dhcpcd:eth0
</pre></p>

<p>&#8220;init&#8221; will then execute &#8220;dhcpcd -B eth0&#8243; with appropriate permissions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/861/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[非官方] COSCUP 2010 Mobile App</title>
		<link>http://blog.kanru.info/archives/850</link>
		<comments>http://blog.kanru.info/archives/850#comments</comments>
		<pubDate>Fri, 13 Aug 2010 23:36:53 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[0xlab]]></category>
		<category><![CDATA[coscup]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=850</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>今年 <a href="http://code.google.com/events/io/2010/sessions/android-ui-design-patterns.html">GoogleIO</a> 時 Android team 不斷在推廣一個 <a href="http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html">Android UI Pattern</a>，可以觀察到最早利用這個 Pattern 的應該是預設的 Facebook 程式，接下來發展的更為完備的是 Twitter 官方程式，處處可以見到該 Pattern 的影子。GoogleIO 前 Google 也推出一個程式叫作 IOSched 用來顯示議程相關資訊，同樣是使用該 Pattern 的實作。雖然 Twitter <a href="http://blog.twitter.com/2010/04/twitter-for-android-robots-like-to.html">承諾會釋出 source code</a>，但是一直沒下文，因此想要使用這個 UI Pattern 的可以說完全沒有範例可以參考。</p>

<p>今年 <a href="http://blog.coscup.org/2010/08/blog-post_14.html">COSCUP</a> 就參考 IOSched，嘗試從頭打造一個類似的程式，順便練習一下怎麼使用這個 UI Pattern，結果寫好後才知道<a href="http://www.plurk.com/ericsk">上官大神</a>早有 <a href="http://blog.ericsk.org/archives/1416">HTML5</a> 的版本，連 <a href="http://code.google.com/p/iosched/">IOSched</a> 不知道什麼時候也有 source code 了 (汗)</p>

<p><a href="http://blog.kanru.info/wp-content/uploads/2010/08/device1.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/08/device1-168x300.png" alt="" title="Home" width="168" height="300" class="alignnone size-medium wp-image-851" /></a><a href="http://blog.kanru.info/wp-content/uploads/2010/08/device2.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/08/device2-168x300.png" alt="" title="Tracks" width="168" height="300" class="alignnone size-medium wp-image-852" /></a><a href="http://blog.kanru.info/wp-content/uploads/2010/08/device3.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/08/device3-180x300.png" alt="" title="Sessions" width="180" height="300" class="alignnone size-medium wp-image-853" /></a><img src="http://blog.kanru.info/wp-content/uploads/2010/08/coscup2010-qr.png" alt="" title="coscup2010-qr" width="148" height="148" class="alignnone size-full wp-image-854" /></p>

<p>無論如何，總算是練習了一下 Android Programming，有參加 COSCUP 的人可以試用看看 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>

<p>Source code 在 <a href="http://github.com/kanru/Coscup2010">http://github.com/kanru/Coscup2010</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/850/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Root your Phone with just 1-Click</title>
		<link>http://blog.kanru.info/archives/822</link>
		<comments>http://blog.kanru.info/archives/822#comments</comments>
		<pubDate>Tue, 03 Aug 2010 09:32:25 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[0xlab]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[root]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=822</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Today I read that <a href="http://news.slashdot.org/story/10/07/31/167255/Silent-Easily-Made-Android-Rootkit-Released-At-DefCon">someone</a> demoed how to put rootkit into your phone during the <a href="https://www.defcon.org/">Defcon</a>. But there are no details, the keywords like kernel moudle, install apk, remote phone call, &#8230;, all reminds me the old phishing attack. Then I thought, can it be the <a href="http://mobile.slashdot.org/story/10/07/23/2013251/Droid-X-Gets-Rooted">trick</a> used to root Droid X?</p>

<p>Actually this <a href="http://c-skills.blogspot.com/2010/07/exploid-works-on-droid-x.html">exploid</a> works on almost every Android phone because it leverages a vulnerability in the framework. XDA developers also <a href="http://forum.xda-developers.com/showthread.php?t=736271">confirmed</a> the success on various N1 model. But can it be used on real attack?</p>

<p>To demonstrate how <strong>dangerous</strong> the local exploit is, I wrote an Android application that inject the <code>su</code> program into your phone. With <a href="http://github.com/CyanogenMod/android_packages_apps_Superuser">Superuser.apk</a> you can gain root access whenever you run <code>su</code> from adb shell.</p>

<p><strong>No additional permissions required! This works on my stock Nexus One and in theory any Android. Just one click I can root you phone (optionally take away your data simultaneously). Don&#8217;t trust me or any other similar programs floating around the market, or simply don&#8217;t install any program until your carrier fix this.</strong></p>

<p><a href="http://blog.kanru.info/wp-content/uploads/2010/08/home1.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/08/home1-180x300.png" alt="" title="home1" width="180" height="300" class="alignnone size-medium wp-image-823" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/08/rootdroid.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/08/rootdroid-180x300.png" alt="" title="rootdroid" width="180" height="300" class="alignnone size-medium wp-image-824" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/08/su.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/08/su-180x300.png" alt="" title="su" width="180" height="300" class="alignnone size-medium wp-image-837" /></a></p>

<p><pre>
Download the apk here: <a href="http://0xlab.org/~kanru/RootDroid-release.apk">http://0xlab.org/~kanru/RootDroid-release.apk</a>
<img src="http://blog.kanru.info/wp-content/uploads/2010/08/RootDroid-release.apk_.png" alt="" title="RootDroid-release.apk" width="120" height="120" class="alignnone size-full wp-image-843" style="float:left" />
md5: 20894acd3be808c51ce32491872ba027
sha1: 889fc92692c0e58e83673dedbabbc66d5c6318b1
</pre></p>

<div style="clear:left"/>

<p>This vulnerability has been <a href="http://github.com/CyanogenMod/android_system_core/commit/5f5d5c8cef10f28950fa108a8bd86d55f11b7ef4">fixed</a> in CyanogenMod two weeks ago, and the source code is landing the AOSP froyo branch, but there is still no official fix update from Google. Consider how <strong>dangerous</strong> this is, I may not install any third party application until an OTA arrives or just go ahead with a customized rom with my newly rooted phone <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/822/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>啟用 mobile 版面</title>
		<link>http://blog.kanru.info/archives/809</link>
		<comments>http://blog.kanru.info/archives/809#comments</comments>
		<pubDate>Sun, 23 May 2010 09:38:00 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[未分類]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=809</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>偶爾也想在手機上看自己的 blog (?!) 所以裝了個行動版的 plugin <a href="http://www.bravenewcode.com/products/wptouch/">WPTouch</a></p>

<p><a href="http://blog.kanru.info/wp-content/uploads/2010/05/mobile01.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/05/mobile01-180x300.png" alt="Blog 手機版" title="Blog 手機版" width="180" height="300" class="alignnone size-medium wp-image-810" /></a><a href="http://blog.kanru.info/wp-content/uploads/2010/05/mobile02.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/05/mobile02-180x300.png" alt="" title="Blog 手機版" width="180" height="300" class="alignnone size-medium wp-image-816" /></a><a href="http://blog.kanru.info/wp-content/uploads/2010/05/mobile03.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/05/mobile03-180x300.png" alt="" title="Blog 手機版" width="180" height="300" class="alignnone size-medium wp-image-815" /></a><a href="http://blog.kanru.info/wp-content/uploads/2010/05/mobile04.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/05/mobile04-180x300.png" alt="" title="Blog 手機版" width="180" height="300" class="alignnone size-medium wp-image-814" /></a></p>

<p>看起來還不賴！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/809/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AndroidDev: Recent progress on Gallery3D</title>
		<link>http://blog.kanru.info/archives/799</link>
		<comments>http://blog.kanru.info/archives/799#comments</comments>
		<pubDate>Wed, 19 May 2010 12:31:40 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[0xlab]]></category>
		<category><![CDATA[agl]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Gallery3D]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=799</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Gallery3D is the gallery application released with Éclair, contributed by <a href="http://www.cooliris.com/mobile/nexus-one/">Cooliris</a>.</p>

<p>This application heavily uses OpenGL to render the scenes. It looks great on Nexus One. But 0xdroid does not yet support hardware accelerated 3D graphics and rely on libagl to rasterize the 3D graph.</p>

<p>Agl is the software OpenGL rendering engine used by android emulator. Gallery3D assumes there is hardware support and this caused a lot of trouble when one want to run it with agl. Even if the libagl implementation is correct and complete, Gallery3D may also assumes some implementation depended behavior. Not to mention the fundamental libagl implementations may have problems.</p>

<p>Anyway, we have some progress and I&#8217;d like to share the screenshots. Devkit8000 DVI output, 640&#215;480 resolution, captured by DDMS.</p>


<a href='http://blog.kanru.info/archives/799/device2' title='device2'><img width="150" height="150" src="http://blog.kanru.info/wp-content/uploads/2010/05/device2-150x150.png" class="attachment-thumbnail" alt="device2" title="device2" /></a>
<a href='http://blog.kanru.info/archives/799/device1' title='device1'><img width="150" height="150" src="http://blog.kanru.info/wp-content/uploads/2010/05/device1-150x150.png" class="attachment-thumbnail" alt="device1" title="device1" /></a>
<a href='http://blog.kanru.info/archives/799/device' title='device'><img width="150" height="150" src="http://blog.kanru.info/wp-content/uploads/2010/05/device-150x150.png" class="attachment-thumbnail" alt="device" title="device" /></a>


<p>I have a feeling there are more OpenGL tricks inside the source code then I&#8217;d expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/799/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AndroidDev: Provision the device</title>
		<link>http://blog.kanru.info/archives/789</link>
		<comments>http://blog.kanru.info/archives/789#comments</comments>
		<pubDate>Wed, 12 May 2010 02:39:43 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[0xlab]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Devkit8000]]></category>
		<category><![CDATA[Provision]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=789</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>在 Devkit8000 上把 HOME key 設定好後卻無法作用，仔細看了下處理 HOME key 的地方是 polices 下的 PhoneWindowManager.java，會去檢查這個 device 是否被 &#8220;Provision&#8221; 了。</p>

<p>這個 Provision 的動作其實就是 Device 第一次啟用時做初始設定，在 Google phone 上面就是 SetupWizard，在 emulator 裏面則有簡單的 Provision.apk，之前無法作用就是因為一直沒有把 Provision.apk 放進去&#8230;</p>

<p>Provision.apk 做了什麼事呢？其實很簡短：</p>

<div>
<pre class="brush: java;">
public class DefaultActivity extends Activity {

    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        // Add a persistent setting to allow other apps to know
        // the device has been provisioned.
        Settings.Secure.putInt(getContentResolver(),
                               Settings.Secure.DEVICE_PROVISIONED, 1);

        // remove this activity from the package manager.
        PackageManager pm = getPackageManager();
        ComponentName name = new ComponentName(this,
                                     DefaultActivity.class);
        pm.setComponentEnabledSetting(name,
                   PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);

        // terminate the activity.
        finish();
    }
}
</pre>
</div>

<p>因此若要提供一個類似 SetupWizard 的初始化介面在 Devit8000 上面，只要延伸這個 Provision.apk 做的事，提供 GUI 等等，最重要的就是設定這個 &#8220;Settings.Secure.DEVICE_PROVISIONED&#8221;</p>

<p>這是一個筆記。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/789/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fourth 0xdroid Release for BeagleBoard and Devkit8000!</title>
		<link>http://blog.kanru.info/archives/767</link>
		<comments>http://blog.kanru.info/archives/767#comments</comments>
		<pubDate>Tue, 27 Apr 2010 04:16:14 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[0xlab]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=767</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><img src="http://0xlab.org/logo_imgs/0xdroid.png"/ style="float:left;"/> Today we are celebrating the 0xLab&#8217;s one year old birthday! I&#8217;d like to write about the recently announced <a href="http://code.google.com/p/0xdroid/wiki/beagle_eclair_0x4">fourth 0xdroid release</a>.</p>

<p>What&#8217;s new in this release? The biggest one is that it is based on Éclair code base! While Éclair uses a lot more 3D stuff for its UI, the performance drop between Donut and Éclair is huge. After lots of testing and hacking, we finally bought the Éclair performance back to its original level. For detailed benchmark results, checkout the wiki page <a href="http://code.google.com/p/0xdroid/wiki/Benchmarks">Benchmarks</a>.</p>

<p>Second is new hardware support. 0xdroid now officially supports Devkit8000, a BeagleBoard clone. Developers did many works to bring up the all functionality include LCD/DVI output, touchscreen calibration, USB, Ethernet, etc. Running Éclair on Devkit8000 looks great!</p>

<p>Oh, and the new installer! The new installer used in this release supports both BeagleBoard and Devkit8000, with different display resolution and hardware revision. It can do a lot more than previous installer can do, for example it can download images from network, install to SD/MMC card and indicate progress via graphic display or via blinking LEDs. All of this will fit into a 1MB binary!</p>

<p>Enjoy the release video on the youtube:</p>

<div style="width:480px;margin: 0 auto;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/OGpYk1p1UPI&#038;hl=zh_TW&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/OGpYk1p1UPI&#038;hl=zh_TW&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></div>

<p>Want to contribute? <a href="http://code.google.com/p/0xdroid/wiki/UsingPreBuiltImages">Download</a> it and try now!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/767/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The good old xorg.conf and the new xorg.conf.d</title>
		<link>http://blog.kanru.info/archives/732</link>
		<comments>http://blog.kanru.info/archives/732#comments</comments>
		<pubDate>Thu, 08 Apr 2010 15:38:12 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=732</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>自從 Xorg xserver 宣佈要放棄使用 hal 的自動設定機制後，Xorg 開發者們就開始討論與實做各種可能的 config backend。最後定案的是在 Linux 上直接使用 udev 來偵測 input device，在這個後端實做的早期也想把設定的工作一起做在 udev rules 裡，但顯然這樣的做法是有其侷限的。很多人說這只是把 hal 的 .fdi 換個寫法放到 udev rules 裡罷了，同樣是對 user 極不友善的做法，而且使用 udev 在非 Linux 的平台就不能用了。</p>

<p>最後一個很聰明的辦法是把 auto probe 與 config 這兩個行為分開，讓 udev 只管找到新的裝置，config 則集中放在 xorg.conf.d 中。xorg.conf.d 中設定檔的格式和 xorg.conf 是一樣的，因此不但 code 可以重用，使用者也不用學新的語法，其他平台則可以用不同的 backend。</p>

<p>因為 udev backend 是以 Debian Developer &#8211; Julien Cristau 為主開發的, Debian 很早就可以使用 udev backend 了，最近 Debian 更從 xorg-xserver 1.8 backport 了 xorg.conf.d 的修改，所以設定方式又不太一樣了。(大概只有 Debian 是這樣一改再改吧，其他 distro 應是無痛升級)</p>

<p>參考 xorg.conf(5)，X 在啟動時會去找</p>

<p><pre class="brush: plain;">
           /etc/X11/&lt;cmdline&gt;
           /usr/etc/X11/&lt;cmdline&gt;
           /etc/X11/$XORGCONFIG
           /usr/etc/X11/$XORGCONFIG
           /etc/X11/xorg.conf-4
           /etc/X11/xorg.conf
           /etc/xorg.conf
           /usr/etc/X11/xorg.conf.&lt;hostname&gt;
           /usr/etc/X11/xorg.conf-4
           /usr/etc/X11/xorg.conf
           /usr/lib/X11/xorg.conf.&lt;hostname&gt;
           /usr/lib/X11/xorg.conf-4
           /usr/lib/X11/xorg.conf
</pre></p>

<p>這些地方的設定檔，因此設定不用全放在一個檔案裡了。這也是近來很多 daemon 要支援多重設定檔常用的方法，可以讓 vendor 或 distro 的設定與 user 的設定可以各自獨立出來。</p>

<p>接下來我們有興趣的地方是 <code>InputClass</code> 這個新的 Section，就是它讓我們可以設定隨插即用裝置。</p>

<p><pre class="brush: plain;">
           Section &quot;InputClass&quot;
               Identifier  &quot;name&quot;
               entries
               ...
               options
               ...
           EndSection
</pre></p>

<p>就像 xorg.conf 內其他 Section 一樣，<code>Identifier</code> 是必需的，我們可以用各種 Match rule 去比對裝置的特性並用 Option 加以設定。所有的 InputClass 都可以被其之後的 InputClass 取代，因此使用者可以用新設定檔取代系統的設定。</p>

<p>現在可以用的 Match rule 有</p>

<p><pre class="brush: plain;">
MatchProduct        &quot;matchproduct&quot;
MatchVendor         &quot;matchvendor&quot;
MatchDevicePath     &quot;matchdevice&quot;
MatchTag            &quot;matchtag&quot;
MatchIsKeyboard     &quot;bool&quot;
MatchIsPointer      &quot;bool&quot;
MatchIsJoystick     &quot;bool&quot;
MatchIsTablet       &quot;bool&quot;
MatchIsTouchpad     &quot;bool&quot;
MatchIsTouchscreen  &quot;bool&quot;
</pre></p>

<p>前四個可以用來 match 特定的裝置名稱、路徑，其他的則可以用來 match 一般的裝置特性如滑鼠、鍵盤等。如我要設定 touchpad 的話，可以用</p>

<div>
<pre class="brush: plain;">
# /etc/X11/xorg.conf.d/10-synaptics.conf
Section &quot;InputClass&quot;
    Identifier &quot;Synaptics&quot;
    MatchIsTouchpad &quot;true&quot;

    Option &quot;TapButton1&quot; &quot;1&quot;
    Option &quot;HorizEdgeScroll&quot; &quot;true&quot;
EndSection
</pre>
</div>

<p>來設定。再加上 X 會自己找到可以用的 driver，和<a href="http://blog.kanru.info/archives/251">以前</a><a href="http://blog.kanru.info/archives/279">的</a><a href="http://blog.kanru.info/archives/339">方法</a>比起來，是不是簡單很多呢？ <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/732/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Got one A1 from Broncho</title>
		<link>http://blog.kanru.info/archives/688</link>
		<comments>http://blog.kanru.info/archives/688#comments</comments>
		<pubDate>Mon, 15 Mar 2010 09:50:49 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[0xlab]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=688</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>上週末下班前，在桌上發現一個包裹，原來是渡海而來的兩隻 A1！這兩隻 A1 是 Broncho 的產品，詳細規格可以參考 <a href="http://www.broncho.cn/products/a1/">Broncho 的網頁</a>。</p>

<p>大伙興奮的開箱啦！</p>

<p><a href="http://blog.kanru.info/wp-content/uploads/2010/03/FxCam_1268373797319.jpg"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/FxCam_1268373797319-150x150.jpg" alt="開箱" title="unbox" width="150" height="150" class="alignnone size-thumbnail wp-image-689" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/FxCam_1268373867309.jpg"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/FxCam_1268373867309-150x150.jpg" alt="開箱" title="unbox2" width="150" height="150" class="alignnone size-thumbnail wp-image-691" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/2010-03-12-14.04.52.jpg"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/2010-03-12-14.04.52-150x150.jpg" alt="" title="合照" width="150" height="150" class="alignnone size-thumbnail wp-image-699" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/2010-03-12-14.06.25.jpg"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/2010-03-12-14.06.25-150x150.jpg" alt="" title="真像" width="150" height="150" class="alignnone size-thumbnail wp-image-703" /></a></p>

<p>包裝和 Hero 的很像。3.2 寸 LCD, 480&#215;320 的解析度，200 萬畫素的相機鏡頭，CPU 是 Marvell 300 (624 MHz)，記憶體是 256 + 128 MB，支援 WIFI, Bluetooth, FM, GPS。不是使用標準的 USB 接口，但同一個接口可以接 USB、耳機、變壓器。觸控螢幕使用起來的感覺像是電容式的，反應非常靈敏，輕輕的觸摸就有反應。</p>

<p>系統是 Android Cupcake，內建軟體有不少 Google App，最另人驚訝旳是上面有 Android Market 可以用，試著從 Market 上面下載了一些小遊戲下來玩，完全沒有問題，真是太牛了！另外一點就是有內建手寫輸入，速度不快但是準確度不錯。除此之外還有谷歌拼音可以用。</p>

<p>測試的途中無線網路與 GPS 不是很穩，除此之外以一隻中低價位的手機來說表現的相當不錯。</p>

<p><a href="http://blog.kanru.info/wp-content/uploads/2010/03/lock.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/lock-150x150.png" alt="" title="lock" width="150" height="150" class="alignnone size-thumbnail wp-image-711" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/home.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/home-150x150.png" alt="" title="home" width="150" height="150" class="alignnone size-thumbnail wp-image-712" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/apps.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/apps-150x150.png" alt="" title="apps" width="150" height="150" class="alignnone size-thumbnail wp-image-713" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/market.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/market-150x150.png" alt="" title="market" width="150" height="150" class="alignnone size-thumbnail wp-image-714" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/market2.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/market2-150x150.png" alt="" title="market2" width="150" height="150" class="alignnone size-thumbnail wp-image-715" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/market3.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/market3-150x150.png" alt="" title="market3" width="150" height="150" class="alignnone size-thumbnail wp-image-716" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/weather.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/weather-150x150.png" alt="" title="weather" width="150" height="150" class="alignnone size-thumbnail wp-image-717" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/handwriting1.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/handwriting1-150x150.png" alt="" title="handwriting1" width="150" height="150" class="alignnone size-thumbnail wp-image-718" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/handwriting2.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/handwriting2-150x150.png" alt="" title="handwriting2" width="150" height="150" class="alignnone size-thumbnail wp-image-719" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/handwriting3.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/handwriting3-150x150.png" alt="" title="handwriting3" width="150" height="150" class="alignnone size-thumbnail wp-image-720" /></a>
<a href="http://blog.kanru.info/wp-content/uploads/2010/03/handwriting4.png"><img src="http://blog.kanru.info/wp-content/uploads/2010/03/handwriting4-150x150.png" alt="" title="handwriting4" width="150" height="150" class="alignnone size-thumbnail wp-image-721" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/688/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debian 用 wpa_cli 之 romaning mode，不用 network-manager</title>
		<link>http://blog.kanru.info/archives/685</link>
		<comments>http://blog.kanru.info/archives/685#comments</comments>
		<pubDate>Mon, 08 Mar 2010 16:38:12 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[未分類]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=685</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>在 <code>/etc/wpa_supplicant/wpa_supplicant.conf</code> 加入 network 設定</p>

<div>
<pre class="brush: plain;">
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    network={
            ssid=&quot;Example&quot;
            psk=&quot;password&quot;
            id_str=&quot;office&quot;
    }

    network={
        key_mgmt=NONE
    }
    # 可以參考 /usr/share/doc/wpasupplicant/examples/wpa-roam.conf
</pre>
</div>

<p>然後在 <code>/etc/network/interfaces</code> 加加 mapping</p>

<div>
<pre class="brush: plain;">
    allow-hotplug wlan0
    iface wlan0 inet manual
            wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

    iface office inet dhcp
</pre>
</div>

<p>之後開機就會自動 connect 到合適的 AP 了</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/685/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
