<?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>Linux kernel, Android, Golang &#38; Recsys</title>
	<atom:link href="http://wifihack.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://wifihack.net/blog</link>
	<description>simple is powerful</description>
	<lastBuildDate>Mon, 20 May 2013 07:32:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>git 修改注释</title>
		<link>http://wifihack.net/blog/2013/05/git-commit-amend/</link>
		<comments>http://wifihack.net/blog/2013/05/git-commit-amend/#comments</comments>
		<pubDate>Mon, 20 May 2013 07:32:51 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Tech.Notes]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[rebase]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=821</guid>
		<description><![CDATA[1. 修改最后一次提交的注释 git commit &#8211;amend 2. git使用amend选项提供了最后一次commit的反悔。但是对于历史提交呢，就必须使用rebase了。 git rebase -i HEAD~3 表示要修改当前版本的倒数第三次状态。 这个命令出来之后，会出来三行： pick:******* pick:******* pick:******* 如果你要修改哪个，就把那行的pick改成edit，然后退出。 这时通过git log你可以发现，git的最后一次提交已经变成你选的那个了，这时再使用： git commit -amend 使用git rebase &#8211;continue]]></description>
				<content:encoded><![CDATA[<p>1. 修改最后一次提交的注释<br />
git commit &#8211;amend<br />
2. git使用amend选项提供了最后一次commit的反悔。但是对于历史提交呢，就必须使用rebase了。<br />
git rebase -i HEAD~3<br />
表示要修改当前版本的倒数第三次状态。<br />
这个命令出来之后，会出来三行：<br />
pick:*******<br />
pick:*******<br />
pick:*******<br />
如果你要修改哪个，就把那行的pick改成edit，然后退出。</p>
<p>这时通过git log你可以发现，git的最后一次提交已经变成你选的那个了，这时再使用：<br />
git commit -amend<br />
使用git rebase &#8211;continue</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2013/05/git-commit-amend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用git svn创建一个svn的分支</title>
		<link>http://wifihack.net/blog/2013/04/git-svn-remote-svn-remote-branch/</link>
		<comments>http://wifihack.net/blog/2013/04/git-svn-remote-svn-remote-branch/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 05:30:54 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[Tech.Notes]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=816</guid>
		<description><![CDATA[git config --add svn-remote.newbranch.url https://svn/path_to_newbranch/ git config --add svn-remote.newbranch.fetch :refs/remotes/newbranch git svn fetch newbranch [-r] git checkout -b local-newbranch -t newbranch git svn rebase newbranch From: http://stackoverflow.com/questions/296975/how-do-i-tell-git-svn-about-a-remote-branch-created-after-i-fetched-the-repo]]></description>
				<content:encoded><![CDATA[<p><code><br />
git config --add svn-remote.newbranch.url https://svn/path_to_newbranch/<br />
git config --add svn-remote.newbranch.fetch :refs/remotes/newbranch<br />
git svn fetch newbranch [-r<rev>]<br />
git checkout -b local-newbranch -t newbranch<br />
git svn rebase newbranch<br />
</code></p>
<p>From: http://stackoverflow.com/questions/296975/how-do-i-tell-git-svn-about-a-remote-branch-created-after-i-fetched-the-repo</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2013/04/git-svn-remote-svn-remote-branch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac mkyaffs2image binary Re: HOWTO: Roll Your Own Firmware</title>
		<link>http://wifihack.net/blog/2013/04/mac-mkyaffs2image-binary-re-howto-roll-your-own-firmware/</link>
		<comments>http://wifihack.net/blog/2013/04/mac-mkyaffs2image-binary-re-howto-roll-your-own-firmware/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 03:15:50 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[mkyaffs2image]]></category>
		<category><![CDATA[yaffs2]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=814</guid>
		<description><![CDATA[Here&#8217;s a Mac (intel 32bit snow leopard) built binary of mkyaffs2image http://www.multiupload.com/DD76DX276D I have only tested it so far that it runs. Use at your own peril. Based on the source from http://code.google.com/p/fatplus/downloads/list . Got it to compile by adding the following to devextras.h #if defined(__APPLE__) &#124;&#124; defined (__FreeBSD__) typedef long long loff_t; #endif No [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a Mac (intel 32bit snow leopard) built binary of mkyaffs2image</p>
<p>http://www.multiupload.com/DD76DX276D</p>
<p>I have only tested it so far that it runs. Use at your own peril.</p>
<p>Based on the source from http://code.google.com/p/fatplus/downloads/list . </p>
<p>Got it to compile by adding the following to devextras.h</p>
<p>#if defined(__APPLE__) || defined (__FreeBSD__)<br />
typedef long long loff_t;<br />
#endif</p>
<p>No luck on finding or building a mac binary of unyaffs so far. However, a Windows binary can be found at http://boomtopper.blogspot.com/2009/10/unyaffs-windows-binary.html</p>
<p>From: http://forums.seagate.com/t5/FreeAgent-Theater-and-GoFlexTV/HOWTO-Roll-Your-Own-Firmware/m-p/48669</p>
<p>&#8211;EOF&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2013/04/mac-mkyaffs2image-binary-re-howto-roll-your-own-firmware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>/proc/net/tcp文件网络状态</title>
		<link>http://wifihack.net/blog/2013/01/procnettcp%e6%96%87%e4%bb%b6%e7%bd%91%e7%bb%9c%e7%8a%b6%e6%80%81/</link>
		<comments>http://wifihack.net/blog/2013/01/procnettcp%e6%96%87%e4%bb%b6%e7%bd%91%e7%bb%9c%e7%8a%b6%e6%80%81/#comments</comments>
		<pubDate>Mon, 21 Jan 2013 10:01:01 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Tech.Notes]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[proc]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[tcp6]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=811</guid>
		<description><![CDATA[/proc/net/tcp或/proc/net/tcp6 文件，这里记录的是ipv4/ipv6下所有tcp连接的情况，包括下列数值： sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 0: 0100007F:13AD 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 521 1 dce53a80 300 0 0 2 -1 最主要的，就是local_address本地地址:端口、rem_address远程地址:端口、st连接状态。 注1：文件中都是用的16进制，所以HTTP的80端口记录为0050。 注2：状态码对应如下 00 “ERROR_STATUS”, 01 “TCP_ESTABLISHED”, 02 “TCP_SYN_SENT”, 03 “TCP_SYN_RECV”, 04 “TCP_FIN_WAIT1″, 05 “TCP_FIN_WAIT2″, 06 “TCP_TIME_WAIT”, 07 “TCP_CLOSE”, 08 “TCP_CLOSE_WAIT”, 09 “TCP_LAST_ACK”, 0A [...]]]></description>
				<content:encoded><![CDATA[<p>/proc/net/tcp或/proc/net/tcp6 文件，这里记录的是ipv4/ipv6下所有tcp连接的情况，包括下列数值：<br />
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode<br />
   0: 0100007F:13AD 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 521 1 dce53a80 300 0 0 2 -1<br />
最主要的，就是local_address本地地址:端口、rem_address远程地址:端口、st连接状态。<br />
注1：文件中都是用的16进制，所以HTTP的80端口记录为0050。<br />
注2：状态码对应如下<br />
00  “ERROR_STATUS”,<br />
01  “TCP_ESTABLISHED”,<br />
02  “TCP_SYN_SENT”,<br />
03  “TCP_SYN_RECV”,<br />
04  “TCP_FIN_WAIT1″,<br />
05  “TCP_FIN_WAIT2″,<br />
06  “TCP_TIME_WAIT”,<br />
07  “TCP_CLOSE”,<br />
08  “TCP_CLOSE_WAIT”,<br />
09  “TCP_LAST_ACK”,<br />
0A  “TCP_LISTEN”,<br />
0B  “TCP_CLOSING”,</p>
<p>&#8211;EOF&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2013/01/procnettcp%e6%96%87%e4%bb%b6%e7%bd%91%e7%bb%9c%e7%8a%b6%e6%80%81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script for pack mtk’s boot/recovery image</title>
		<link>http://wifihack.net/blog/2012/12/script-for-pack-mtks-bootrecovery-image/</link>
		<comments>http://wifihack.net/blog/2012/12/script-for-pack-mtks-bootrecovery-image/#comments</comments>
		<pubDate>Thu, 20 Dec 2012 08:39:39 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[mtk]]></category>
		<category><![CDATA[mtk6575]]></category>
		<category><![CDATA[pack]]></category>
		<category><![CDATA[packing]]></category>
		<category><![CDATA[ramdisk]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[rom]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=805</guid>
		<description><![CDATA[From: http://www.beautyorange.com/2011/10/script-for-pack-mtks-bootrecovery-image/ 1. pack-mtk-boot.sh 1 2 3 4 5 6 7 8 9 cd rmdisk find . &#124; cpio -o -H newc &#124; gzip &#62; ../new_ram cd .. python cksum.py new_ram ram_header mv ram_header.alt ram_header dd if=./new_ram &#62;&#62; ./ram_header mv ram_header ramdisk_new ./mkbootimg --kernel ./kernel_no_header --ramdisk ./ramdisk_new -o ./new_boot.img rm -rf kernel rmdisk new_ram ramdisk [...]]]></description>
				<content:encoded><![CDATA[<p>From: <a href="http://www.beautyorange.com/2011/10/script-for-pack-mtks-bootrecovery-image/">http://www.beautyorange.com/2011/10/script-for-pack-mtks-bootrecovery-image/</a></p>
<p><a href="http://wifihack.net/blog/2012/12/script-for-pack-mtks-bootrecovery-image/mt6573-recovery/" rel="attachment wp-att-806"><img src="http://wifihack.net/blog/wp-content/uploads/2012/12/mt6573-recovery.png" alt="mt6573-recovery" width="1004" height="284" class="alignnone size-full wp-image-806" /></a></p>
<p>1. pack-mtk-boot.sh</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">cd rmdisk
find . | cpio -o -H newc | gzip &gt; ../new_ram
cd ..
python cksum.py new_ram ram_header
mv ram_header.alt ram_header
dd if=./new_ram &gt;&gt; ./ram_header
mv ram_header ramdisk_new
./mkbootimg --kernel ./kernel_no_header --ramdisk ./ramdisk_new -o ./new_boot.img
rm -rf kernel rmdisk new_ram ramdisk ramdisk_no_header kernel_no_header ramdisk_new</pre></td></tr></table></div>

<p>2. pack-mtk-recovery.sh</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
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">echo &quot;packing...&quot;
&nbsp;
cd rmdisk
# Compress ramdisk_no_header
find . | cpio -o -H newc | gzip &gt; ../new_ram
cd ..
# Generate ramdisk_header
python cksum.py new_ram ram_header
# Rename ramdisk_header file
mv ram_header.alt ram_header
# Merge ramdisk_no_header and ramdisk_header
dd if=./new_ram &gt;&gt; ./ram_header
# Rename ramdisk
mv ram_header ramdisk_new
# Make recovery image with kernel_no_header and ramdisk
./mkbootimg --kernel ./kernel_no_header --ramdisk ./ramdisk_new --base 0x10000000 --pagesize 2048 -o ./new_recovery.img
# Clean temp files
rm -rf kernel rmdisk new_ram ramdisk ramdisk_no_header kernel_no_header ramdisk_new
&nbsp;
echo &quot;Done!&quot;</pre></td></tr></table></div>

<p>3. cksum.py</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">struct</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
usage <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;usage: cksum.py&lt;header&gt;&quot;</span> <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">&lt;</span>/header<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p>&#8211;EOF&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/12/script-for-pack-mtks-bootrecovery-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script for unpack mtk’s boot/recovery image</title>
		<link>http://wifihack.net/blog/2012/12/script-for-unpack-mtks-bootrecovery-image/</link>
		<comments>http://wifihack.net/blog/2012/12/script-for-unpack-mtks-bootrecovery-image/#comments</comments>
		<pubDate>Thu, 20 Dec 2012 08:19:43 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[boot.img]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[mtk]]></category>
		<category><![CDATA[mtk6575]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[rom]]></category>
		<category><![CDATA[unpacking]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=801</guid>
		<description><![CDATA[From: http://www.beautyorange.com/2011/10/script-for-unpack-mtks-bootrecovery-image/ 1. unpack-boot.sh 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 echo &#34;Unpacking MTK Boot.img...&#34; &#160; KER=$(hexdump -C boot.img &#124; grep &#34;KERNEL&#34; &#124; cut --fields=3-10 -d' '); NUMKER=$(od -A d -t x1 boot.img &#124; grep &#34;$KER&#34; &#124; cut -f1 [...]]]></description>
				<content:encoded><![CDATA[<p>From: <a href="http://www.beautyorange.com/2011/10/script-for-unpack-mtks-bootrecovery-image/">http://www.beautyorange.com/2011/10/script-for-unpack-mtks-bootrecovery-image/</a></p>
<p><a href="http://wifihack.net/blog/2012/12/script-for-unpack-mtks-bootrecovery-image/mt6573-recovery-900x254/" rel="attachment wp-att-802"><img src="http://wifihack.net/blog/wp-content/uploads/2012/12/mt6573-recovery-900x254.png" alt="mt6573-recovery-900x254" width="900" height="254" class="alignnone size-full wp-image-802" /></a></p>
<p>1. unpack-boot.sh</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
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">echo &quot;Unpacking MTK Boot.img...&quot;
&nbsp;
KER=$(hexdump -C boot.img | grep &quot;KERNEL&quot; | cut --fields=3-10 -d' ');
NUMKER=$(od -A d -t x1 boot.img | grep &quot;$KER&quot; | cut -f1 -d' ');
&nbsp;
REC=$(hexdump -C boot.img | grep &quot;ROOTFS&quot; | cut --fields=3-10 -d' ');
NUMREC=$(od -A d -t x1 boot.img | grep &quot;$REC&quot; | cut -f1 -d' ');
&nbsp;
dd if=boot.img of=kernel bs=$NUMREC count=1
dd if=kernel of=kernel_no_header bs=$NUMKER skip=1
&nbsp;
dd if=boot.img of=ramdisk bs=$NUMREC skip=1
NUMRAM=$(od -A d -t x1 ramdisk | grep &quot;1f 8b 08 00&quot; | cut -f1 -d' ');
&nbsp;
dd if=ramdisk of=ram_header bs=$NUMRAM count=1
dd if=ramdisk of=ramdisk_no_header.gz bs=$NUMRAM skip=1
&nbsp;
gunzip ./ramdisk_no_header.gz
mkdir rmdisk
cd rmdisk
cpio -i &lt; ../ramdisk_no_header
&nbsp;
echo &quot;Done!&quot;</pre></td></tr></table></div>

<p>2. unpacking-recovery.sh</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
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">echo &quot;Unpacking MTK recovery...&quot;
&nbsp;
KER=$(hexdump -C recovery.img | grep &quot;KERNEL&quot; | cut --fields=3-10 -d' ');
NUMKER=$(od -A d -t x1 recovery.img | grep &quot;$KER&quot; | cut -f1 -d' ');
&nbsp;
REC=$(hexdump -C recovery.img | grep &quot;RECOVERY&quot; | cut --fields=3-10 -d' ');
NUMREC=$(od -A d -t x1 recovery.img | grep &quot;$REC&quot; | cut -f1 -d' ');
&nbsp;
dd if=recovery.img of=kernel bs=$NUMREC count=1
dd if=kernel of=kernel_no_header bs=$NUMKER skip=1
&nbsp;
dd if=recovery.img of=ramdisk bs=$NUMREC skip=1
NUMRAM=$(od -A d -t x1 ramdisk | grep &quot;1f 8b 08 00&quot; | cut -f1 -d' ');
&nbsp;
dd if=ramdisk of=ram_header bs=$NUMRAM count=1
dd if=ramdisk of=ramdisk_no_header.gz bs=$NUMRAM skip=1
&nbsp;
gunzip ./ramdisk_no_header.gz
mkdir rmdisk
cd rmdisk
cpio -i &lt; ../ramdisk_no_header
&nbsp;
echo &quot;Done!&quot;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/12/script-for-unpack-mtks-bootrecovery-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在ubuntu上面安装谷歌拼音输入法libgooglepinyin</title>
		<link>http://wifihack.net/blog/2012/11/install-google-pinyin-on-ubuntu/</link>
		<comments>http://wifihack.net/blog/2012/11/install-google-pinyin-on-ubuntu/#comments</comments>
		<pubDate>Mon, 05 Nov 2012 08:19:54 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Tech.Notes]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[ibus]]></category>
		<category><![CDATA[ibus. libpinyin]]></category>
		<category><![CDATA[libpinyin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pinyin]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=794</guid>
		<description><![CDATA[ubuntu自动的拼音输入发实在是太难用了, 前段时间无意中看到一个linux环境下面的谷歌拼音输入法libgooglepinyin，试用了一段时间，感觉非常不错。 安装过程非常简单, 具体过程如下: 1. 按照必要的编译环境如: GCC, cmake 等 1 sudo apt-get install cmake build-essential opencc mercurial ibus 2. 安装谷歌输入法libgooglepinyin 1 2 3 4 5 6 7 8 9 hg clone http://code.google.com/p/libgooglepinyin/ &#160; cd libgooglepinyin &#160; mkdir build; cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr &#160; make sudo make install 3. 安装ibus皮肤 ibus-googlepinyin 1 2 3 4 [...]]]></description>
				<content:encoded><![CDATA[<p>    ubuntu自动的拼音输入发实在是太难用了, 前段时间无意中看到一个linux环境下面的谷歌拼音输入法<a href="http://code.google.com/p/libgooglepinyin/">libgooglepinyin</a>，试用了一段时间，感觉非常不错。</p>
<p>安装过程非常简单, 具体过程如下:</p>
<p>1. 按照必要的编译环境如: GCC, cmake 等</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">sudo apt-get install cmake build-essential opencc mercurial ibus</pre></td></tr></table></div>

<p>2. 安装谷歌输入法libgooglepinyin</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">hg clone http://code.google.com/p/libgooglepinyin/
&nbsp;
cd libgooglepinyin
&nbsp;
mkdir build; cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
&nbsp;
make
sudo make install</pre></td></tr></table></div>

<p>3. 安装ibus皮肤 ibus-googlepinyin</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">hg clone http://code.google.com/p/libgooglepinyin.ibus-wrapper/ ibus-googlepinyin
&nbsp;
cd ibus-googlepinyin
&nbsp;
mkdir build; cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
&nbsp;
make
sudo make install</pre></td></tr></table></div>

<p>4. 重新启动ibus-daemon</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">sudo killall -9 ibus-daemon</pre></td></tr></table></div>

<p>5. ibus配置谷歌输入法</p>
<blockquote><p>
打开 IBUS设置 → 输入法 → 选择输入法→ 汉语 → GooglePinyin，然后将其上升到顶，或者把其他的输入法删掉。
</p></blockquote>
<p>更详细的安装过程参考: <a href="http://code.google.com/p/libgooglepinyin/wiki/INSTALL">http://code.google.com/p/libgooglepinyin/wiki/INSTALL</a></p>
<p>-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/11/install-google-pinyin-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Go语言开放工具之Emacs</title>
		<link>http://wifihack.net/blog/2012/09/golang-ide-emacs/</link>
		<comments>http://wifihack.net/blog/2012/09/golang-ide-emacs/#comments</comments>
		<pubDate>Tue, 04 Sep 2012 14:03:54 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[golang]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[gocode]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[speedbar]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=787</guid>
		<description><![CDATA[原文放在@astaxie 写的“build web application with golang”书里面。 下面只把Emacs里面的拿出来，如果需要参考vim，liteide和Sublime text的请一步 https://github.com/astaxie/build-web-application-with-golang/blob/master/1.4.md Emacs主要是使用了gocode, speedbar, 并把一些go的命令融合进来。 ## Emacs Emacs传说中的神器，她不仅仅是一个编辑器，它是一个整合环境，或可称它为集成开发环境，这些功能如让使用者置身于全功能的操作系统中 1. 配置Emacs高亮显示 cp $GOROOT/misc/emacs/* ~/.emacs.d/ 2. 安装[Gocode](https://github.com/nsf/gocode/) go get -u github.com/nsf/gocode gocode默认安装到$GOPATH/bin里面下面，需要把$GOPATH/bin路径设置到系统PATH里面。 3. 配置[Gocode](https://github.com/nsf/gocode/) ~ cd $GOPATH/src/github.com/nsf/gocode/emacs ~ cp go-autocomplete.el ~/.emacs.d/ ~ gocode set propose-builtins true propose-builtins true ~ gocode set lib-path &#8220;/home/border/gocode/pkg/linux_amd64&#8243; // 换为你自己的路径 lib-path &#8220;/home/border/gocode/pkg/linux_amd64&#8243; ~ gocode set [...]]]></description>
				<content:encoded><![CDATA[<p>原文放在@astaxie 写的“<a href="https://github.com/astaxie/build-web-application-with-golang">build web application with golang</a>”书里面。</p>
<p>下面只把Emacs里面的拿出来，如果需要参考vim，liteide和Sublime text的请一步 <a href="https://github.com/astaxie/build-web-application-with-golang/blob/master/1.4.md">https://github.com/astaxie/build-web-application-with-golang/blob/master/1.4.md</a></p>
<p>Emacs主要是使用了gocode, speedbar, 并把一些go的命令融合进来。</p>
<p>## Emacs<br />
Emacs传说中的神器，她不仅仅是一个编辑器，它是一个整合环境，或可称它为集成开发环境，这些功能如让使用者置身于全功能的操作系统中</p>
<p> <a href="http://wifihack.net/blog/wp-content/uploads/2012/09/emacs.png"><img src="http://wifihack.net/blog/wp-content/uploads/2012/09/emacs.png" alt="" title="emacs" width="1024" height="583" class="alignnone size-full wp-image-788" /></a></p>
<p> 1. 配置Emacs高亮显示</p>
<p>        cp $GOROOT/misc/emacs/* ~/.emacs.d/</p>
<p> 2. 安装[Gocode](https://github.com/nsf/gocode/)</p>
<p>        go get -u github.com/nsf/gocode</p>
<p>    gocode默认安装到$GOPATH/bin里面下面，需要把$GOPATH/bin路径设置到系统PATH里面。</p>
<p> 3. 配置[Gocode](https://github.com/nsf/gocode/)</p>
<p>        ~ cd $GOPATH/src/github.com/nsf/gocode/emacs<br />
        ~ cp go-autocomplete.el ~/.emacs.d/<br />
        ~ gocode set propose-builtins true<br />
        propose-builtins true<br />
        ~ gocode set lib-path &#8220;/home/border/gocode/pkg/linux_amd64&#8243; // 换为你自己的路径<br />
        lib-path &#8220;/home/border/gocode/pkg/linux_amd64&#8243;<br />
        ~ gocode set<br />
        propose-builtins true<br />
        lib-path &#8220;/home/border/gocode/pkg/linux_amd64&#8243;</p>
<p> 4. 需要安装 [Auto Completion](http://www.emacswiki.org/emacs/AutoComplete)</p>
<p>   下载AutoComplete并解压</p>
<p>        ~ make install DIR=$HOME/.emacs.d/auto-complete</p>
<p>   配置~/.emacs文件</p>
<p>        ;;auto-complete<br />
        (require &#8216;auto-complete-config)<br />
        (add-to-list &#8216;ac-dictionary-directories &#8220;~/.emacs.d/auto-complete/ac-dict&#8221;)<br />
        (ac-config-default)<br />
        (local-set-key (kbd &#8220;M-/&#8221;) &#8216;semantic-complete-analyze-inline)<br />
        (local-set-key &#8220;.&#8221; &#8216;semantic-complete-self-insert)<br />
        (local-set-key &#8220;>&#8221; &#8216;semantic-complete-self-insert)</p>
<p>   详细信息参考: http://www.emacswiki.org/emacs/AutoComplete</p>
<p> 5. 配置.emacs</p>
<p>        ;; golang mode<br />
        (require &#8216;go-mode-load)<br />
        (require &#8216;go-autocomplete)<br />
        ;; speedbar<br />
        ;; (speedbar 1)<br />
        (speedbar-add-supported-extension &#8220;.go&#8221;)<br />
        (add-hook<br />
         &#8216;go-mode-hook<br />
         &#8216;(lambda ()<br />
           ;; gocode<br />
           (auto-complete-mode 1)<br />
           (setq ac-sources &#8216;(ac-source-go))<br />
            ;; Imenu &#038; Speedbar<br />
            (setq imenu-generic-expression<br />
                  &#8216;((&#8220;type&#8221; &#8220;^type *\\([^ \t\n\r\f]*\\)&#8221; 1)<br />
                    (&#8220;func&#8221; &#8220;^func *\\(.*\\) {&#8221; 1)))<br />
            (imenu-add-to-menubar &#8220;Index&#8221;)<br />
            ;; Outline mode<br />
            (make-local-variable &#8216;outline-regexp)<br />
            (setq outline-regexp &#8220;//\\.\\|//[^\r\n\f][^\r\n\f]\\|pack\\|func\\|impo\\|cons\\|var.\\|type\\|\t\t*&#8230;.&#8221;)<br />
            (outline-minor-mode 1)<br />
            (local-set-key &#8220;\M-a&#8221; &#8216;outline-previous-visible-heading)<br />
            (local-set-key &#8220;\M-e&#8221; &#8216;outline-next-visible-heading)<br />
            ;; Menu bar<br />
            (require &#8216;easymenu)<br />
            (defconst go-hooked-menu<br />
              &#8216;(&#8220;Go tools&#8221;<br />
                ["Go run buffer" go t]<br />
                ["Go reformat buffer" go-fmt-buffer t]<br />
                ["Go check buffer" go-fix-buffer t]))<br />
            (easy-menu-define<br />
              go-added-menu<br />
              (current-local-map)<br />
              &#8220;Go tools&#8221;<br />
              go-hooked-menu)</p>
<p>            ;; Other<br />
            (setq show-trailing-whitespace t)<br />
            ))<br />
        ;; helper function<br />
        (defun go ()<br />
          &#8220;run current buffer&#8221;<br />
          (interactive)<br />
          (compile (concat &#8220;go run &#8221; (buffer-file-name))))</p>
<p>        ;; helper function<br />
        (defun go-fmt-buffer ()<br />
          &#8220;run gofmt on current buffer&#8221;<br />
          (interactive)<br />
          (if buffer-read-only<br />
            (progn<br />
              (ding)<br />
              (message &#8220;Buffer is read only&#8221;))<br />
            (let ((p (line-number-at-pos))<br />
            (filename (buffer-file-name))<br />
            (old-max-mini-window-height max-mini-window-height))<br />
              (show-all)<br />
              (if (get-buffer &#8220;*Go Reformat Errors*&#8221;)<br />
            (progn<br />
              (delete-windows-on &#8220;*Go Reformat Errors*&#8221;)<br />
              (kill-buffer &#8220;*Go Reformat Errors*&#8221;)))<br />
              (setq max-mini-window-height 1)<br />
              (if (= 0 (shell-command-on-region (point-min) (point-max) &#8220;gofmt&#8221; &#8220;*Go Reformat Output*&#8221; nil &#8220;*Go Reformat Errors*&#8221; t))<br />
            (progn<br />
              (erase-buffer)<br />
              (insert-buffer-substring &#8220;*Go Reformat Output*&#8221;)<br />
              (goto-char (point-min))<br />
              (forward-line (1- p)))<br />
          (with-current-buffer &#8220;*Go Reformat Errors*&#8221;<br />
            (progn<br />
              (goto-char (point-min))<br />
              (while (re-search-forward &#8220;<standard input>&#8221; nil t)<br />
                (replace-match filename))<br />
              (goto-char (point-min))<br />
              (compilation-mode))))<br />
              (setq max-mini-window-height old-max-mini-window-height)<br />
              (delete-windows-on &#8220;*Go Reformat Output*&#8221;)<br />
              (kill-buffer &#8220;*Go Reformat Output*&#8221;))))<br />
        ;; helper function<br />
        (defun go-fix-buffer ()<br />
          &#8220;run gofix on current buffer&#8221;<br />
          (interactive)<br />
          (show-all)<br />
          (shell-command-on-region (point-min) (point-max) &#8220;go tool fix -diff&#8221;))</p>
<p> 6. 恭喜你，你现在可以体验在神器中开发Go的乐趣. 默认speedbar是关闭的，如果打开需要把 ;; (speedbar 1) 前面的注释去掉，或者也可以通过 *M-x speedbar* 手动开启。</p>
<p>参考:<br />
1. Go &#038; Emacs <a href="http://www.let.rug.nl/~kleiweg/go/go-emacs.html">http://www.let.rug.nl/~kleiweg/go/go-emacs.html</a><br />
2. <a href="https://github.com/border/emacs">https://github.com/border/emacs</a></p>
<p>&#8211;EOF&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/09/golang-ide-emacs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sina微薄oauth2验证Go实现</title>
		<link>http://wifihack.net/blog/2012/09/sina-weibo-oauth2-login-with-golang/</link>
		<comments>http://wifihack.net/blog/2012/09/sina-weibo-oauth2-login-with-golang/#comments</comments>
		<pubDate>Tue, 04 Sep 2012 03:04:58 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[golang]]></category>
		<category><![CDATA[goauth2]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[oauth2]]></category>
		<category><![CDATA[sina]]></category>
		<category><![CDATA[weibo]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=784</guid>
		<description><![CDATA[Sina微薄oauth2验证Go实现的方法: 格式化后的代码在: https://gist.github.com/3607494 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 [...]]]></description>
				<content:encoded><![CDATA[<p>Sina微薄oauth2验证Go实现的方法:<br />
格式化后的代码在: <a href="https://gist.github.com/3607494">https://gist.github.com/3607494</a></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
132
133
134
135
136
137
138
139
140
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Copyright 2012 Jiang Bian (borderj@gmail.com). All rights reserved.</span>
<span style="color: #666666; font-style: italic;">// Use of this source code is governed by a BSD-style</span>
<span style="color: #666666; font-style: italic;">// license that can be found in the LICENSE file.</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Email: borderj@gmail.com</span>
<span style="color: #666666; font-style: italic;">// Blog: http://wifihack.net/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Sina WeiBo oauth2 Login, Base on goauth2 lib</span>
package main
&nbsp;
import <span style="color: #009900;">&#40;</span>
	<span style="color: #ff0000;">&quot;code.google.com/p/goauth2/oauth&quot;</span>
	<span style="color: #666666; font-style: italic;">//&quot;crypto/tls&quot;</span>
	<span style="color: #ff0000;">&quot;fmt&quot;</span>
	<span style="color: #ff0000;">&quot;io/ioutil&quot;</span>
	<span style="color: #ff0000;">&quot;log&quot;</span>
	<span style="color: #ff0000;">&quot;net/http&quot;</span>
	<span style="color: #ff0000;">&quot;strings&quot;</span>
	<span style="color: #ff0000;">&quot;text/template&quot;</span>
<span style="color: #009900;">&#41;</span>
&nbsp;
var notAuthenticatedTemplate <span style="color: #339933;">=</span> template.<span style="color: #202020;">Must</span><span style="color: #009900;">&#40;</span>template.<span style="color: #202020;">New</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #202020;">Parse</span><span style="color: #009900;">&#40;</span>`
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;&lt;</span>body<span style="color: #339933;">&gt;</span>
You have currently not given permissions to access your data.
<span style="color: #339933;">&lt;</span>form action<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;/authorize&quot;</span> method<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;POST&quot;</span><span style="color: #339933;">&gt;&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;Ok, authorize this app with my id&quot;</span><span style="color: #339933;">/&gt;&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;&lt;/</span>html<span style="color: #339933;">&gt;</span>
`<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
&nbsp;
var userInfoTemplate <span style="color: #339933;">=</span> template.<span style="color: #202020;">Must</span><span style="color: #009900;">&#40;</span>template.<span style="color: #202020;">New</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #202020;">Parse</span><span style="color: #009900;">&#40;</span>`
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;&lt;</span>body<span style="color: #339933;">&gt;</span>
Please Input Your Sina User Name<span style="color: #339933;">:</span>
<span style="color: #339933;">&lt;</span>form action<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;/getuserinfo&quot;</span> method<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;POST&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;input&quot;</span> name<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;userinfo&quot;</span> value<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;b0rder&quot;</span><span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;Get User Info&quot;</span><span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;&lt;/</span>html<span style="color: #339933;">&gt;</span>
`<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// variables used during oauth protocol flow of authentication</span>
var <span style="color: #009900;">&#40;</span>
	code  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span>
	token <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #009900;">&#41;</span>
&nbsp;
var oauthCfg <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>oauth.<span style="color: #202020;">Config</span><span style="color: #009900;">&#123;</span>
	ClientId<span style="color: #339933;">:</span>     <span style="color: #ff0000;">&quot;2168100802&quot;</span><span style="color: #339933;">,</span>
	ClientSecret<span style="color: #339933;">:</span> <span style="color: #ff0000;">&quot;29da9ac80a8387c52e59ec6c957d2e1b&quot;</span><span style="color: #339933;">,</span>
	AuthURL<span style="color: #339933;">:</span>      <span style="color: #ff0000;">&quot;https://api.weibo.com/oauth2/authorize&quot;</span><span style="color: #339933;">,</span>
	TokenURL<span style="color: #339933;">:</span>     <span style="color: #ff0000;">&quot;https://api.weibo.com/oauth2/access_token&quot;</span><span style="color: #339933;">,</span>
	RedirectURL<span style="color: #339933;">:</span>  <span style="color: #ff0000;">&quot;http://127.0.0.1:8080/oauth2callback&quot;</span><span style="color: #339933;">,</span>
	Scope<span style="color: #339933;">:</span>        <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">const</span> profileInfoURL <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;https://api.weibo.com/2/users/show.json&quot;</span>
<span style="color: #993333;">const</span> port <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;:8080&quot;</span>
&nbsp;
func main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	http.<span style="color: #202020;">HandleFunc</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #339933;">,</span> handleRoot<span style="color: #009900;">&#41;</span>
	http.<span style="color: #202020;">HandleFunc</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/authorize&quot;</span><span style="color: #339933;">,</span> handleAuthorize<span style="color: #009900;">&#41;</span>
&nbsp;
	http.<span style="color: #202020;">HandleFunc</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/oauth2callback&quot;</span><span style="color: #339933;">,</span> handleOAuth2Callback<span style="color: #009900;">&#41;</span>
	http.<span style="color: #202020;">HandleFunc</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/getuserinfo&quot;</span><span style="color: #339933;">,</span> getUserInfo<span style="color: #009900;">&#41;</span>
&nbsp;
	<span style="color: #000066;">log</span>.<span style="color: #202020;">Println</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Listen On&quot;</span> <span style="color: #339933;">+</span> port<span style="color: #009900;">&#41;</span>
	http.<span style="color: #202020;">ListenAndServe</span><span style="color: #009900;">&#40;</span>port<span style="color: #339933;">,</span> nil<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
func handleRoot<span style="color: #009900;">&#40;</span>w http.<span style="color: #202020;">ResponseWriter</span><span style="color: #339933;">,</span> r <span style="color: #339933;">*</span>http.<span style="color: #202020;">Request</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	notAuthenticatedTemplate.<span style="color: #202020;">Execute</span><span style="color: #009900;">&#40;</span>w<span style="color: #339933;">,</span> nil<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Start the authorization process</span>
func handleAuthorize<span style="color: #009900;">&#40;</span>w http.<span style="color: #202020;">ResponseWriter</span><span style="color: #339933;">,</span> r <span style="color: #339933;">*</span>http.<span style="color: #202020;">Request</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//Get the Google URL which shows the Authentication page to the user</span>
	url <span style="color: #339933;">:=</span> oauthCfg.<span style="color: #202020;">AuthCodeURL</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>
&nbsp;
	<span style="color: #000066;">log</span>.<span style="color: #202020;">Printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;URL: %v<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> url<span style="color: #009900;">&#41;</span>
	<span style="color: #666666; font-style: italic;">//redirect user to that page</span>
	http.<span style="color: #202020;">Redirect</span><span style="color: #009900;">&#40;</span>w<span style="color: #339933;">,</span> r<span style="color: #339933;">,</span> url<span style="color: #339933;">,</span> http.<span style="color: #202020;">StatusFound</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Function that handles the callback from the Google server</span>
func handleOAuth2Callback<span style="color: #009900;">&#40;</span>w http.<span style="color: #202020;">ResponseWriter</span><span style="color: #339933;">,</span> r <span style="color: #339933;">*</span>http.<span style="color: #202020;">Request</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//Get the code from the response</span>
	code <span style="color: #339933;">:=</span> r.<span style="color: #202020;">FormValue</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;code&quot;</span><span style="color: #009900;">&#41;</span>
&nbsp;
	t <span style="color: #339933;">:=</span> <span style="color: #339933;">&amp;</span>oauth.<span style="color: #202020;">Transport</span><span style="color: #009900;">&#123;</span>oauth.<span style="color: #202020;">Config</span><span style="color: #339933;">:</span> oauthCfg<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Exchange the received code for a token</span>
	tok<span style="color: #339933;">,</span> _ <span style="color: #339933;">:=</span> t.<span style="color: #202020;">Exchange</span><span style="color: #009900;">&#40;</span>code<span style="color: #009900;">&#41;</span>
&nbsp;
	<span style="color: #009900;">&#123;</span>
		tokenCache <span style="color: #339933;">:=</span> oauth.<span style="color: #202020;">CacheFile</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;./request.token&quot;</span><span style="color: #009900;">&#41;</span>
&nbsp;
		err <span style="color: #339933;">:=</span> tokenCache.<span style="color: #202020;">PutToken</span><span style="color: #009900;">&#40;</span>tok<span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">if</span> err <span style="color: #339933;">!=</span> nil <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">log</span>.<span style="color: #202020;">Fatal</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Cache write:&quot;</span><span style="color: #339933;">,</span> err<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000066;">log</span>.<span style="color: #202020;">Printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Token is cached in %v<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> tokenCache<span style="color: #009900;">&#41;</span>
		token <span style="color: #339933;">=</span> tok.<span style="color: #202020;">AccessToken</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/*
		// Skip TLS Verify
		t.Transport = &amp;http.Transport{
		    TLSClientConfig: &amp;tls.Config{InsecureSkipVerify: true},
		}
	*/</span>
&nbsp;
	userInfoTemplate.<span style="color: #202020;">Execute</span><span style="color: #009900;">&#40;</span>w<span style="color: #339933;">,</span> nil<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get Sina User Info</span>
func getUserInfo<span style="color: #009900;">&#40;</span>w http.<span style="color: #202020;">ResponseWriter</span><span style="color: #339933;">,</span> r <span style="color: #339933;">*</span>http.<span style="color: #202020;">Request</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> token <span style="color: #339933;">==</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066;">log</span>.<span style="color: #202020;">Println</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Get Access Token Error&quot;</span><span style="color: #009900;">&#41;</span>
		http.<span style="color: #202020;">Redirect</span><span style="color: #009900;">&#40;</span>w<span style="color: #339933;">,</span> r<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #339933;">,</span> http.<span style="color: #202020;">StatusFound</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span>
	<span style="color: #009900;">&#125;</span>
	user <span style="color: #339933;">:=</span> r.<span style="color: #202020;">FormValue</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;userinfo&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #b1b100;">if</span> strings.<span style="color: #202020;">TrimSpace</span><span style="color: #009900;">&#40;</span>user<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #009900;">&#123;</span>
		w.<span style="color: #202020;">Write</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span>byte<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Please Input User Name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	url <span style="color: #339933;">:=</span> fmt.<span style="color: #202020;">Sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%s?screen_name=%s&amp;access_token=%s&quot;</span><span style="color: #339933;">,</span> profileInfoURL<span style="color: #339933;">,</span> user<span style="color: #339933;">,</span> token<span style="color: #009900;">&#41;</span>
	<span style="color: #000066;">log</span>.<span style="color: #202020;">Println</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;url: &quot;</span> <span style="color: #339933;">+</span> url<span style="color: #009900;">&#41;</span>
&nbsp;
	resp<span style="color: #339933;">,</span> err <span style="color: #339933;">:=</span> http.<span style="color: #202020;">Get</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span>
	defer resp.<span style="color: #202020;">Body</span>.<span style="color: #202020;">Close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> err <span style="color: #339933;">!=</span> nil <span style="color: #009900;">&#123;</span>
		<span style="color: #000066;">log</span>.<span style="color: #202020;">Fatal</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Request Error:&quot;</span><span style="color: #339933;">,</span> err<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	body<span style="color: #339933;">,</span> _ <span style="color: #339933;">:=</span> ioutil.<span style="color: #202020;">ReadAll</span><span style="color: #009900;">&#40;</span>resp.<span style="color: #202020;">Body</span><span style="color: #009900;">&#41;</span>
	w.<span style="color: #202020;">Write</span><span style="color: #009900;">&#40;</span>body<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/09/sina-weibo-oauth2-login-with-golang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Go Release相关说明</title>
		<link>http://wifihack.net/blog/2012/09/go-release%e7%9b%b8%e5%85%b3%e8%af%b4%e6%98%8e/</link>
		<comments>http://wifihack.net/blog/2012/09/go-release%e7%9b%b8%e5%85%b3%e8%af%b4%e6%98%8e/#comments</comments>
		<pubDate>Sat, 01 Sep 2012 13:50:50 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[golang]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[minux]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=780</guid>
		<description><![CDATA[By: minux.ma # gmail.com FROM: https://groups.google.com/group/golang-china/msg/f71b2bd13b239313 今天在邮件列表里面讨论GC相关的问题的时候，聊到了Go Release发行相关的流程，@minux 详细总结了一下，下面原文。 PS: @minux 给Go核心代码里面提交了不少代码。 Dmitriy Vyukov前一阵（5月）在搞这个，已经提交了以下改动， http://codereview.appspot.com/6223050 faster GC mark phase http://codereview.appspot.com/6215065 faster GC sweep phase 后来又有几个小的性能微调，其他的暂时不知道； PS: 可能还有人不清楚，我详细说下Go release相关的事情： 1, Go 1之后取消weekly发布，理由是这样会fragment user base 至少在短期内不会恢复；想要尝鲜的直接建议使用default分支；它是足够稳定的； 2, 当积累了足够的重要的bugfixes之后，会考虑发布一个新的Go 1.0.x版本； 其特点是：cherry pick一部分default分支的commit到release分支；要求是 不引入任何API改动（新加入API都不会考虑，如果一个bugfix必须引入新API， 那么要么这个改动不被选择要么会把导出符号改成非导出符号）；保证用户 可以安全升级。 这个版本的发布流程大概包括如下三歩： (1) 在golang-dev发布一个表格指示哪些commit计划被加入新的发布；此阶段 接受意见，但是绝大多数情况下只会接受反对加入某个commit的意见；想要 加入一个新commit是要花很大精力的。 这个表格以CL的形式发布方便大家评论。 示例：http://codereview.appspot.com/6279048/ （cherry pick的过程是自动的， 这个CL里面包含所需要的所有脚本） (2) 在golang-dev发布几个preview，但是都不打包，需要自己去clone然后测试， 面向开发者 [...]]]></description>
				<content:encoded><![CDATA[<p>By: minux.ma # gmail.com<br />
FROM: <a href="https://groups.google.com/group/golang-china/msg/f71b2bd13b239313" target="_blank">https://groups.google.com/group/golang-china/msg/f71b2bd13b239313</a></p>
<p>今天在<a href="https://groups.google.com/group/golang-china">邮件列表</a>里面讨论GC相关的问题的时候，聊到了Go Release发行相关的流程，@minux 详细总结了一下，下面原文。<br />
PS: @minux 给Go核心代码里面提交了不少代码。</p>
<p>Dmitriy Vyukov前一阵（5月）在搞这个，已经提交了以下改动，<br />
http://codereview.appspot.com/6223050 faster GC mark phase<br />
http://codereview.appspot.com/6215065 faster GC sweep phase<br />
后来又有几个小的性能微调，其他的暂时不知道；</p>
<p>PS: 可能还有人不清楚，我详细说下Go release相关的事情：<br />
1, Go 1之后取消weekly发布，理由是这样会fragment user base<br />
至少在短期内不会恢复；想要尝鲜的直接建议使用default分支；它是足够稳定的；</p>
<p>2, 当积累了足够的重要的bugfixes之后，会考虑发布一个新的Go 1.0.x版本；<br />
其特点是：cherry pick一部分default分支的commit到release分支；要求是<br />
不引入任何API改动（新加入API都不会考虑，如果一个bugfix必须引入新API，<br />
那么要么这个改动不被选择要么会把导出符号改成非导出符号）；保证用户<br />
可以安全升级。</p>
<p>这个版本的发布流程大概包括如下三歩：<br />
(1) 在golang-dev发布一个表格指示哪些commit计划被加入新的发布；此阶段<br />
接受意见，但是绝大多数情况下只会接受反对加入某个commit的意见；想要<br />
加入一个新commit是要花很大精力的。<br />
这个表格以CL的形式发布方便大家评论。<br />
示例：http://codereview.appspot.com/6279048/ （cherry pick的过程是自动的，<br />
这个CL里面包含所需要的所有脚本）<br />
(2) 在golang-dev发布几个preview，但是都不打包，需要自己去clone然后测试，<br />
面向开发者<br />
比如这个：https://groups.google.com/d/topic/golang-dev/9UtB9iZBo4o/discussion<br />
(3) 发布<br />
在所有支持的系统上编译测试然后制作安装包，测试；上传到</p>
<p>http://code.google.com/p/go/downloads/list；然后在go-nuts发布更新说明；</p>
<p>关于Go 1.0.3的发布日期到现在也没有确定；而且还有标记优先级为Soon的问题<br />
没解决，所以可能还得等等；</p>
<p>3，经过足够考验后的default分支在合适的时候用来发布Go 1.1<br />
所有前段时间的改变，包括新添加的API会在这个时候发布出来。<br />
也就是这次会是个merge。据说是今年年底发布这个。<br />
-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/09/go-release%e7%9b%b8%e5%85%b3%e8%af%b4%e6%98%8e/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building android 4.0.4 for P7300</title>
		<link>http://wifihack.net/blog/2012/07/building-android-4-for-p7300/</link>
		<comments>http://wifihack.net/blog/2012/07/building-android-4-for-p7300/#comments</comments>
		<pubDate>Wed, 18 Jul 2012 05:40:46 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[building]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[ICS]]></category>
		<category><![CDATA[p7300]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=776</guid>
		<description><![CDATA[在下载android代码时候耗时比较长，一个比较简单的方法就是先在本地建个镜像，然后再根据本地的镜像来进行更新，能减少不少时间。 比如: P7300 相关的操作如下. repo init -u https://github.com/Galaxian-Soup/android.git &#8211;mirror repo init -u https://github.com/Galaxian-Soup/android.git -b ics &#8211;reference=git://127.0.0.1/galaxian-soup.mirror/android.git 在编译Android 4.0.4 r2的时候出现的错误信息，修改如下: host C++: libMesa]]></description>
				<content:encoded><![CDATA[<p>在下载android代码时候耗时比较长，一个比较简单的方法就是先在本地建个镜像，然后再根据本地的镜像来进行更新，能减少不少时间。</p>
<p>比如: P7300 相关的操作如下.<br />
repo init -u https://github.com/Galaxian-Soup/android.git &#8211;mirror<br />
repo init -u https://github.com/Galaxian-Soup/android.git -b ics  &#8211;reference=git://127.0.0.1/galaxian-soup.mirror/android.git</p>
<p>在编译Android 4.0.4 r2的时候出现的错误信息，修改如下:</p>
<p>host C++: libMesa <= external/mesa3d/src/glsl/loop_unroll.cpp<br />
In file included from external/mesa3d/src/glsl/ir.h:38:0,<br />
                 from external/mesa3d/src/glsl/loop_analysis.h:29,<br />
                 from external/mesa3d/src/glsl/loop_unroll.cpp:25:<br />
external/mesa3d/src/glsl/ir_visitor.h:48:17: warning: 'virtual void ir_visitor::visit(ir_function_signature*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:49:17: warning: 'virtual void ir_visitor::visit(ir_function*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:59:17: warning: 'virtual void ir_visitor::visit(ir_return*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:60:17: warning: 'virtual void ir_visitor::visit(ir_discard*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:61:17: warning: 'virtual void ir_visitor::visit(ir_if*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:62:17: warning: 'virtual void ir_visitor::visit(ir_loop*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:63:17: warning: 'virtual void ir_visitor::visit(ir_loop_jump*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:114:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_function_signature*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:116:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_function*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:118:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_expression*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:120:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_texture*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:122:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_swizzle*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:124:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_dereference_array*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:126:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_dereference_record*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:128:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_assignment*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:130:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_call*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:132:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_return*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:134:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_discard*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:136:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_leave(ir_if*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/loop_unroll.cpp:37:30: warning:   by 'virtual ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop*)' [-Woverloaded-virtual]<br />
In file included from external/mesa3d/src/glsl/ir.h:38:0,<br />
                 from external/mesa3d/src/glsl/glsl_symbol_table.h:34,<br />
                 from external/mesa3d/src/glsl/linker.cpp:78:<br />
external/mesa3d/src/glsl/ir_visitor.h:48:17: warning: 'virtual void ir_visitor::visit(ir_function_signature*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:49:17: warning: 'virtual void ir_visitor::visit(ir_function*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:59:17: warning: 'virtual void ir_visitor::visit(ir_return*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:60:17: warning: 'virtual void ir_visitor::visit(ir_discard*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:61:17: warning: 'virtual void ir_visitor::visit(ir_if*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:62:17: warning: 'virtual void ir_visitor::visit(ir_loop*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:63:17: warning: 'virtual void ir_visitor::visit(ir_loop_jump*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_visitor.h:81:17: warning:   by 'ir_control_flow_visitor::visit' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:111:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_loop*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:113:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_function_signature*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:115:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_function*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:117:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_expression*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:119:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_texture*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:121:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_swizzle*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:123:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_dereference_array*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:125:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_dereference_record*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:131:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_return*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:133:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_discard*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:135:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_if*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:110:30: warning:   by 'find_assignment_visitor::visit_enter' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:86:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit(ir_variable*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:153:30: warning:   by 'virtual ir_visitor_status find_deref_visitor::visit(ir_dereference_variable*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:87:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit(ir_constant*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:153:30: warning:   by 'virtual ir_visitor_status find_deref_visitor::visit(ir_dereference_variable*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:88:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit(ir_loop_jump*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:153:30: warning:   by 'virtual ir_visitor_status find_deref_visitor::visit(ir_dereference_variable*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h: In function 'void remap_variables(ir_instruction*, gl_shader*, hash_table*)':<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:86:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit(ir_variable*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:623:33: warning:   by 'virtual ir_visitor_status remap_variables(ir_instruction*, gl_shader*, hash_table*)::remap_visitor::visit(ir_dereference_variable*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:87:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit(ir_constant*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:623:33: warning:   by 'virtual ir_visitor_status remap_variables(ir_instruction*, gl_shader*, hash_table*)::remap_visitor::visit(ir_dereference_variable*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/ir_hierarchical_visitor.h:88:30: warning: 'virtual ir_visitor_status ir_hierarchical_visitor::visit(ir_loop_jump*)' was hidden [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp:623:33: warning:   by 'virtual ir_visitor_status remap_variables(ir_instruction*, gl_shader*, hash_table*)::remap_visitor::visit(ir_dereference_variable*)' [-Woverloaded-virtual]<br />
external/mesa3d/src/glsl/linker.cpp: In function 'void assign_varying_locations(gl_shader_program*, gl_shader*, gl_shader*)':<br />
external/mesa3d/src/glsl/linker.cpp:1394:49: error: expected primary-expression before ',' token<br />
external/mesa3d/src/glsl/linker.cpp:1394:50: error: 'varyings' was not declared in this scope<br />
external/mesa3d/src/glsl/linker.cpp:1394:58: error: 'offsetof' was not declared in this scope<br />
external/mesa3d/src/glsl/linker.cpp:1395:48: error: expected primary-expression before ',' token<br />
external/mesa3d/src/glsl/linker.cpp:1412:47: error: expected primary-expression before ',' token<br />
external/mesa3d/src/glsl/linker.cpp:1412:48: error: 'position' was not declared in this scope<br />
external/mesa3d/src/glsl/linker.cpp:1414:47: error: expected primary-expression before ',' token<br />
external/mesa3d/src/glsl/linker.cpp:1414:48: error: 'pointSize' was not declared in this scope<br />
external/mesa3d/src/glsl/linker.cpp:1424:47: error: expected primary-expression before ',' token<br />
external/mesa3d/src/glsl/linker.cpp:1424:48: error: 'position' was not declared in this scope<br />
external/mesa3d/src/glsl/linker.cpp:1428:47: error: expected primary-expression before ',' token<br />
external/mesa3d/src/glsl/linker.cpp:1428:48: error: 'frontFacingPointCoord' was not declared in this scope<br />
external/mesa3d/src/glsl/linker.cpp:1431:47: error: expected primary-expression before ',' token<br />
external/mesa3d/src/glsl/linker.cpp:1431:48: error: 'frontFacingPointCoord' was not declared in this scope<br />
external/mesa3d/src/glsl/linker.cpp: In function 'void link_shaders(const gl_context*, gl_shader_program*)':<br />
external/mesa3d/src/glsl/linker.cpp:1734:49: error: expected primary-expression before ',' token<br />
external/mesa3d/src/glsl/linker.cpp:1734:50: error: 'fragColor' was not declared in this scope<br />
external/mesa3d/src/glsl/linker.cpp:1734:59: error: 'offsetof' was not declared in this scope<br />
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1<br />
make: *** Waiting for unfinished jobs....</p>
<p>解决这个问题需要修改文件如下：</p>
<p>把 "#include <stddef.h>&#8221; 添加到 linker.cpp 文件头部。</p>
<p>====================================================</p>
<p>host C++: liboprofile_pp <= external/oprofile/libpp/arrange_profiles.cpp<br />
In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0:<br />
external/oprofile/libpp/format_output.h:94:22: error: reference 'counts' cannot be declared 'mutable' [-fpermissive]<br />
host C++: liboprofile_pp <= external/oprofile/libpp/callgraph_container.cpp<br />
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o] Error 1<br />
make: *** Waiting for unfinished jobs....</p>
<p>解决方法：<br />
需要修改external/oprofile/libpp/format_output.h:94行<br />
mutable counts_t &#038; counts为<br />
counts_t &#038; counts</p>
<p>====================================================</p>
<p>external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: 'ptrdiff_t' does not name a type<br />
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_main_host_intermediates/gtest_main.o] Error 1<br />
make: *** Waiting for unfinished jobs....<br />
In file included from external/gtest/src/gtest-all.cc:38:0:<br />
external/gtest/src/../src/gtest-filepath.cc: In member function 'bool testing::internal::FilePath::FileOrDirectoryExists() const':<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_dev' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::__pad1' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::__st_ino' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_mode' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_nlink' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_uid' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_gid' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_rdev' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::__pad2' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_size' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_blksize' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_blocks' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_atim' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_mtim' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_ctim' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member 'stat::st_ino' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc: In member function 'bool testing::internal::FilePath::DirectoryExists() const':<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_dev' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::__pad1' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::__st_ino' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_mode' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_nlink' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_uid' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_gid' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_rdev' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::__pad2' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_size' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_blksize' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_blocks' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_atim' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_mtim' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_ctim' [-Wmissing-field-initializers]<br />
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member 'stat::st_ino' [-Wmissing-field-initializers]<br />
frameworks/base/media/mtp/MtpDataPacket.cpp: In member function 'int android::MtpDataPacket::read(usb_request*)':<br />
frameworks/base/media/mtp/MtpDataPacket.cpp:387:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]<br />
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_host_intermediates/gtest-all.o] Error 1</p>
<p>解决方法：<br />
$vi external/gtest/src/../include/gtest/internal/gtest-param-util.h<br />
+#include <cstddef></p>
<p>====================================================</p>
<p>host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_reflection.cpp<br />
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function &#8216;static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)&#8217;:<br />
frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23: error: variable &#8216;ParamName&#8217; set but not used [-Werror=unused-but-set-variable]<br />
cc1plus: all warnings being treated as errors</p>
<p>make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_export_foreach.o] Error 1<br />
make: *** Waiting for unfinished jobs&#8230;.</p>
<p>解决办法：<br />
vim frameworks/compile/slang/Android.mk<br />
把：<br />
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror<br />
改为：<br />
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter<br />
参考：http://code.google.com/p/android/issues/detail?id=22006#c0<br />
参考：http://groups.google.com/group/android-building/browse_thread/thread/0207abb98ed72304 </p>
<p>-EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/07/building-android-4-for-p7300/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>把Android源码中的密码对转换为keystore的方法</title>
		<link>http://wifihack.net/blog/2012/05/%e6%8a%8aandroid%e6%ba%90%e7%a0%81%e4%b8%ad%e7%9a%84%e5%af%86%e7%a0%81%e5%af%b9%e8%bd%ac%e6%8d%a2%e4%b8%bakeystore%e7%9a%84%e6%96%b9%e6%b3%95/</link>
		<comments>http://wifihack.net/blog/2012/05/%e6%8a%8aandroid%e6%ba%90%e7%a0%81%e4%b8%ad%e7%9a%84%e5%af%86%e7%a0%81%e5%af%b9%e8%bd%ac%e6%8d%a2%e4%b8%bakeystore%e7%9a%84%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Wed, 30 May 2012 02:26:34 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Keystore]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[pem]]></category>
		<category><![CDATA[pk12]]></category>
		<category><![CDATA[pk8]]></category>
		<category><![CDATA[x509]]></category>
		<category><![CDATA[签名]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=774</guid>
		<description><![CDATA[把Android源码中的密码对转换为keystore的方法 原文作者: Yongce 原文链接: http://www.goafter.info/2011/07/09/36.html 如果要在Eclipse中调试Android源码中非test key签名的程序（也就是使用platform, media or shared key签名的程序），需要把Android源码中的公私钥对（build/target/product/security）转换为Eclipse能够使用的keystore。 转换步骤如下： 0. 把build/target/product/security下面的某对需要转换的key拷贝到一个你的工作目录 （下面以shared key为例：shared.pk8 &#038; shared.x509.pem） 1. 把pkcs8格式的私钥转换为pkcs12格式： $ openssl pkcs8 -in shared.pk8 -inform DER -outform PEM -out shared.priv.pem -nocrypt 2.生成pkcs12格式的密钥文件： $ openssl pkcs12 -export -in shared.x509.pem -inkey shared.priv.pem -out shared.pk12 -name androiddebugkey (注：此过程中需要输入密码：android) 3.生成keystore： $ keytool -importkeystore -deststorepass android -destkeypass android -destkeystore [...]]]></description>
				<content:encoded><![CDATA[<p>把Android源码中的密码对转换为keystore的方法<br />
原文作者: <a href="http://www.goafter.info">Yongce</a><br />
原文链接: <a href="http://www.goafter.info/2011/07/09/36.html">http://www.goafter.info/2011/07/09/36.html</a></p>
<p>如果要在Eclipse中调试Android源码中非test key签名的程序（也就是使用platform, media or shared key签名的程序），需要把Android源码中的公私钥对（build/target/product/security）转换为Eclipse能够使用的keystore。</p>
<p>转换步骤如下：</p>
<p>0. 把build/target/product/security下面的某对需要转换的key拷贝到一个你的工作目录</p>
<p>（下面以shared key为例：shared.pk8 &#038; shared.x509.pem）</p>
<p>1. 把pkcs8格式的私钥转换为pkcs12格式：</p>
<p>$ openssl pkcs8 -in shared.pk8 -inform DER -outform PEM -out shared.priv.pem -nocrypt</p>
<p>2.生成pkcs12格式的密钥文件：</p>
<p>$ openssl pkcs12 -export -in shared.x509.pem -inkey shared.priv.pem -out shared.pk12 -name androiddebugkey</p>
<p>(注：此过程中需要输入密码：android)</p>
<p>3.生成keystore：</p>
<p>$ keytool -importkeystore -deststorepass android -destkeypass android -destkeystore debug.keystore -srckeystore shared.pk12 -srcstoretype PKCS12 -srcstorepass android -alias androiddebugkey</p>
<p>至此，已经生成keystore：debug.keystore</p>
<p>在Eclipse的Windows/Preferences/Android/Build中设置“Custom debug keystore“为刚才生成的keystore即可。</p>
<p>对于其它类型的key，步骤相同。</p>
<p>&#8211;EOF&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/05/%e6%8a%8aandroid%e6%ba%90%e7%a0%81%e4%b8%ad%e7%9a%84%e5%af%86%e7%a0%81%e5%af%b9%e8%bd%ac%e6%8d%a2%e4%b8%bakeystore%e7%9a%84%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs块操作</title>
		<link>http://wifihack.net/blog/2012/05/block-text-in-emacs/</link>
		<comments>http://wifihack.net/blog/2012/05/block-text-in-emacs/#comments</comments>
		<pubDate>Mon, 28 May 2012 07:44:15 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Tech.Notes]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=771</guid>
		<description><![CDATA[参考: How do I intelligently indent a block of text in Emacs? http://www.quora.com/How-do-I-intelligently-indent-a-block-of-text-in-Emacs 块选择: C-Space 或者 C-@ 开始进行块选择。 可以通过C-n, C-p, C-v 等进行选择。 块删除: C-w 快缩进: C-u C-x TAB 移动一个TAB(4个空格)，  C-u -4 C-x TAB 删除4个空格 &#160;]]></description>
				<content:encoded><![CDATA[<p>参考: How do I intelligently indent a block of text in Emacs?<br />
<a href="http://www.quora.com/How-do-I-intelligently-indent-a-block-of-text-in-Emacs"> http://www.quora.com/How-do-I-intelligently-indent-a-block-of-text-in-Emacs</a></p>
<p>块选择: C-Space 或者 C-@ 开始进行块选择。</p>
<p>可以通过C-n, C-p, C-v 等进行选择。</p>
<p>块删除: C-w</p>
<p>快缩进: C-u C-x TAB 移动一个TAB(4个空格)，  C-u -4 C-x TAB 删除4个空格</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/05/block-text-in-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>windows版本的Emacs无法显示图片的解决方法</title>
		<link>http://wifihack.net/blog/2012/05/windows-emacs-cant-display-picture-of-the-solution/</link>
		<comments>http://wifihack.net/blog/2012/05/windows-emacs-cant-display-picture-of-the-solution/#comments</comments>
		<pubDate>Sun, 27 May 2012 00:53:24 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Tech.Notes]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[gnuwin32]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[tiff]]></category>
		<category><![CDATA[xbm]]></category>
		<category><![CDATA[xpm]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=766</guid>
		<description><![CDATA[原文参考: http://blog.csdn.net/atskyline/article/details/7569621 可以先在运行下面几个语句检查一下是否已经支持了图片 (image-type-available-p &#8216;png) (image-type-available-p &#8216;gif) (image-type-available-p &#8216;jpeg) (image-type-available-p &#8216;tiff) (image-type-available-p &#8216;xbm) (image-type-available-p &#8216;xpm) 这几个函数复制到随便Lisp模式的buffer， 然后在每一行行尾按C-j，就可以看到每个函数运行的结果，返回t证明已经可以支持图片了。 Win 的不能显示图片是因为编译后默认没有带几个DLL文件。 把以下DLL文件拷贝到EMACS安装目录的BIN目录下，就可以显示图片了。 jpeg62.dll libgcrypt-11.dll libgnutls-26.dll libpng14-14.dll libtasn1-3.dll libtiff3.dll libungif4.dll libXpm.dll xpm4.dll zlib1.dll 这些文件都可以在 http://gnuwin32.sourceforge.net/packages.html 一个个下载到。 另外一个比较快的方法了在 https://code.google.com/p/emacs-for-windows/downloads/list 有已经修改过的EMACS版本。 我把emacs里面图片相关的链接库单独提取出来供大家下载使用: emacs-images &#8211;EOF-]]></description>
				<content:encoded><![CDATA[<p>原文参考: http://blog.csdn.net/atskyline/article/details/7569621</p>
<p>可以先在运行下面几个语句检查一下是否已经支持了图片</p>
<p>(image-type-available-p &#8216;png)</p>
<p>(image-type-available-p &#8216;gif)</p>
<p>(image-type-available-p &#8216;jpeg)</p>
<p>(image-type-available-p &#8216;tiff)</p>
<p>(image-type-available-p &#8216;xbm)</p>
<p>(image-type-available-p &#8216;xpm)</p>
<p>这几个函数复制到随便Lisp模式的buffer，</p>
<p>然后在每一行行尾按C-j，就可以看到每个函数运行的结果，返回t证明已经可以支持图片了。</p>
<p>Win 的不能显示图片是因为编译后默认没有带几个DLL文件。</p>
<p>把以下DLL文件拷贝到EMACS安装目录的BIN目录下，就可以显示图片了。</p>
<p>jpeg62.dll<br />
libgcrypt-11.dll<br />
libgnutls-26.dll<br />
libpng14-14.dll<br />
libtasn1-3.dll<br />
libtiff3.dll<br />
libungif4.dll<br />
libXpm.dll<br />
xpm4.dll<br />
zlib1.dll</p>
<p>这些文件都可以在</p>
<p>http://gnuwin32.sourceforge.net/packages.html</p>
<p>一个个下载到。</p>
<p>另外一个比较快的方法了在</p>
<p>https://code.google.com/p/emacs-for-windows/downloads/list</p>
<p>有已经修改过的EMACS版本。</p>
<p>我把emacs里面图片相关的链接库单独提取出来供大家下载使用:<br />
<a href='http://wifihack.net/blog/wp-content/uploads/2012/05/emacs-images.rar'>emacs-images</a></p>
<p>&#8211;EOF-</p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/05/windows-emacs-cant-display-picture-of-the-solution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android基于ClockworkMod Recovery(CWM)的系统升级</title>
		<link>http://wifihack.net/blog/2012/04/android-clockworkmod-recovery-system-updat/</link>
		<comments>http://wifihack.net/blog/2012/04/android-clockworkmod-recovery-system-updat/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 13:29:47 +0000</pubDate>
		<dc:creator>BianJiang</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Tech.Notes]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[ClockworkMod]]></category>
		<category><![CDATA[CWM]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[rom]]></category>
		<category><![CDATA[RomManager]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[定制ROM]]></category>

		<guid isPermaLink="false">http://wifihack.net/blog/?p=760</guid>
		<description><![CDATA[Android 系统自带了升级的接库RecoverySystem.installPackage，但是通过installPackage进入ClockworkMod Recovery(CWM)后，包的签名验证是打开的，导致升级错误。但是在实践中发现，如果通过自己手动按键进入CWM Recovery模式后，签名验证默认是关闭的，而自己通过APK升级进入后验证是打开的，这个就说明签名验证是可以通过外部参数调整的。由于CWM本身是不开源的，无法看到具体的实现细节，只能通过反编译，RomManager的日志和猜。 CWM提供了一个配套的RomManager.apk进行升级，那我们就从RomManager.apk下手。 通过分析RomManager.apk的日志，发现RomManager.apk在运行的时候会通过一个 rommanager.sh 的脚本，来进行相关的reboot 并进入recovery模式。 1 2 3 4 5 6 7 border@kvbian:~ s$ cat rommanager.sh mkdir -p /cache/recovery ; cat /data/data/com.koushikdutta.rommanager/files/extendedcommand &#62; /cache/recovery/extendedcommand ; rm /cache/recovery/command ; mkdir -p /sdcard/clockworkmod ; echo 1 &#62; /sdcard/clockworkmod/.recoverycheckpoint ; reboot recovery ; border@kvbian:~ s$ cat extendedcommand ui_print&#40;&#34;ROM Manager Version 5.0.0.5&#34;&#41;; ui_print&#40;&#34;2012年4月18日&#34;&#41;; ui_print&#40;&#34;Preparing to [...]]]></description>
				<content:encoded><![CDATA[<p>Android 系统自带了升级的接库RecoverySystem.installPackage，但是通过installPackage进入ClockworkMod Recovery(CWM)后，包的签名验证是打开的，导致升级错误。但是在实践中发现，如果通过自己手动按键进入CWM Recovery模式后，签名验证默认是关闭的，而自己通过APK升级进入后验证是打开的，这个就说明签名验证是可以通过外部参数调整的。由于CWM本身是不开源的，无法看到具体的实现细节，只能通过反编译，RomManager的日志和猜。</p>
<p>CWM提供了一个配套的RomManager.apk进行升级，那我们就从RomManager.apk下手。</p>
<p>通过分析RomManager.apk的日志，发现RomManager.apk在运行的时候会通过一个 rommanager.sh 的脚本，来进行相关的reboot 并进入recovery模式。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">border<span style="color: #000000; font-weight: bold;">@</span>kvbian:~ s$ <span style="color: #c20cb9; font-weight: bold;">cat</span> rommanager.sh 
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>recovery ; <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>com.koushikdutta.rommanager<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>extendedcommand <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>recovery<span style="color: #000000; font-weight: bold;">/</span>extendedcommand ;  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>recovery<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">command</span> ; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>sdcard<span style="color: #000000; font-weight: bold;">/</span>clockworkmod ; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sdcard<span style="color: #000000; font-weight: bold;">/</span>clockworkmod<span style="color: #000000; font-weight: bold;">/</span>.recoverycheckpoint ;  reboot recovery ;
border<span style="color: #000000; font-weight: bold;">@</span>kvbian:~ s$ <span style="color: #c20cb9; font-weight: bold;">cat</span> extendedcommand 
ui_print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;ROM Manager Version 5.0.0.5&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
ui_print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;2012年4月18日&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
ui_print<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;Preparing to install ROM...&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
assert<span style="color: #7a0874; font-weight: bold;">&#40;</span>install_zip<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;/sdcard/update/kvbian-rom-signed-20120417-2112.zip&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;</pre></td></tr></table></div>

<p>从上面的rommanager.sh 脚本可以看出:<br />
CWM如果要取消签名验证进行升级，不能使用Android默认的<br />
 /cache/recovery/command 文件进行相关的命令。<br />
 而是使用 /cache/recovery/extendedcommand 执行相关的升级命令。</p>
<p> 同时要在 /sdcard/clockworkmod/.recoverycheckpoint 文件做相关的标记。</p>
<p>相关的升级代码:<br />
权限:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.ACCESS_CACHE_FILESYSTEM&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.REBOOT&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>Java 代码(完成的程序参考: <a href='http://wifihack.net/blog/wp-content/uploads/2012/04/RomUpdate.zip'>升级程序RomUpdate下载</a>):</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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
</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;">com.kvbian.romupdate</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileOutputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileWriter</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.InputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.HttpURLConnection</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.MalformedURLException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URL</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Activity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Context</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.PowerManager</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.StrictMode</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.util.Log</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.TextView</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author Jiang Bian
 * mail: borderj@gmail.com
 * blog: http://wifihack.net
 *
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> RomUpdateActivity <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #009900;">&#123;</span>
    <span style="color: #008000; font-style: italic; font-weight: bold;">/** Called when the activity is first created. */</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/*
     * Android 3.0
     * 测试机器: GT-P7300/GT-P7310
     *  本程序之在 ClockworkMod_Recovery_v5.5.0.4 版本测试过，其他版本没有测试。
     *  ClockworkMod Recovery(CWM) 如果要取消签名验证进行升级，不能使用Android默认的
     *  /cache/recovery/command 文件进行相关的命令。
     *  而是使用 /cache/recovery/extendedcommand 执行相关的升级命令。
     *  
     *  同时要在 /sdcard/clockworkmod/.recoverycheckpoint 文件做相关的标记。
     * 
     * 本文参考: 
     *  1. frameworks/base/core/java/android/os/RecoverySystem.java
     *  2. bootable/recovery/recovery.c
     *  3. RomManager.apk
     */</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> TAG <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;RomUpdateActivity&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> ROM_DOWNLOAD_URL <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://192.168.1.66/update.zip&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> ROMPATH <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/sdcard/update.zip&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> buffer_size <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1024</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/** Used to communicate with recovery.  See bootable/recovery/recovery.c. */</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> RECOVERY_DIR <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/cache/recovery&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> CLOCK_WORK_MOD_DIR <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/sdcard/clockworkmod&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> CLOCK_WORK_MOD_CHECKPOINT_FILE <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>CLOCK_WORK_MOD_DIR, <span style="color: #0000ff;">&quot;.recoverycheckpoint&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> COMMAND_FILE <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>RECOVERY_DIR, <span style="color: #0000ff;">&quot;command&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//     // /cache/recovery/extendedcommand</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> EXTENDED_FILE <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>RECOVERY_DIR, <span style="color: #0000ff;">&quot;extendedcommand&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> LOG_FILE <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>RECOVERY_DIR, <span style="color: #0000ff;">&quot;log&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Reboot into the recovery system with the supplied argument.
     * @throws IOException if something goes wrong.
     *  From: frameworks/base/core/java/android/os/RecoverySystem.java
&nbsp;
border@kvbian:~ s$ cat rommanager.sh 
mkdir -p /cache/recovery ; cat /data/data/com.koushikdutta.rommanager/files/extendedcommand &gt; /cache/recovery/extendedcommand ;  rm /cache/recovery/command ; mkdir -p /sdcard/clockworkmod ; echo 1 &gt; /sdcard/clockworkmod/.recoverycheckpoint ;  reboot recovery ;
border@kvbian:~ s$ cat extendedcommand 
ui_print(&quot;ROM Manager Version 5.0.0.5&quot;);
ui_print(&quot;2012年4月18日&quot;);
ui_print(&quot;Preparing to install ROM...&quot;);
assert(install_zip(&quot;/sdcard/update/kvbian-rom-signed-20120417-2112.zip&quot;));
     */</span>
    <span style="color: #000000; font-weight: bold;">private</span>  <span style="color: #000066; font-weight: bold;">void</span> bootCommand<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context<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>
        RECOVERY_DIR.<span style="color: #006633;">mkdirs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// In case we need it</span>
        CLOCK_WORK_MOD_DIR.<span style="color: #006633;">mkdirs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        EXTENDED_FILE.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        COMMAND_FILE.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// In case it's not writable</span>
        CLOCK_WORK_MOD_CHECKPOINT_FILE.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        LOG_FILE.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;write ClockWorkMod Checkpoint File: &quot;</span> <span style="color: #339933;">+</span> CLOCK_WORK_MOD_CHECKPOINT_FILE.<span style="color: #006633;">getAbsolutePath</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: #003399;">FileWriter</span> checkpoint <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileWriter</span><span style="color: #009900;">&#40;</span>CLOCK_WORK_MOD_CHECKPOINT_FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            checkpoint.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            checkpoint.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #009900;">&#123;</span>
            checkpoint.<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>
&nbsp;
        Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;write Extended Command File: &quot;</span> <span style="color: #339933;">+</span> EXTENDED_FILE.<span style="color: #006633;">getAbsolutePath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;write Extended Command File args: &quot;</span> <span style="color: #339933;">+</span> ROMPATH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">FileWriter</span> command <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileWriter</span><span style="color: #009900;">&#40;</span>EXTENDED_FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            command.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ui_print(<span style="color: #000099; font-weight: bold;">\&quot;</span>ZPad ROM Manager Version:<span style="color: #000099; font-weight: bold;">\&quot;</span>); &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            command.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            command.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ui_print(<span style="color: #000099; font-weight: bold;">\&quot;</span>2012.4.18<span style="color: #000099; font-weight: bold;">\&quot;</span>);&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            command.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            command.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ui_print(<span style="color: #000099; font-weight: bold;">\&quot;</span>Preparing to install ROM...<span style="color: #000099; font-weight: bold;">\&quot;</span>);&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            command.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">//assert(install_zip(&quot;/sdcard/update/kvbian-rom-signed-20120417-2112.zip&quot;));</span>
            command.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;assert(install_zip(<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;">+</span> ROMPATH  <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>));&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            command.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #009900;">&#123;</span>
            command.<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>
&nbsp;
        <span style="color: #008000; font-style: italic; font-weight: bold;">/**
         * boot-recovery
         * recovery
         */</span>
        <span style="color: #666666; font-style: italic;">// Having written the command file, go ahead and reboot</span>
        PowerManager pm <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>PowerManager<span style="color: #009900;">&#41;</span> context.<span style="color: #006633;">getSystemService</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span>.<span style="color: #006633;">POWER_SERVICE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//pm.reboot(&quot;recovery&quot;);</span>
        pm.<span style="color: #006633;">reboot</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;recovery&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        StrictMode.<span style="color: #006633;">setThreadPolicy</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> StrictMode.<span style="color: #006633;">ThreadPolicy</span>.<span style="color: #006633;">Builder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">detectDiskReads</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">detectDiskWrites</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">detectNetwork</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// or</span>
                                                                      <span style="color: #666666; font-style: italic;">// .detectAll()</span>
                                                                      <span style="color: #666666; font-style: italic;">// for</span>
                                                                      <span style="color: #666666; font-style: italic;">// all</span>
                                                                      <span style="color: #666666; font-style: italic;">// detectable</span>
                                                                      <span style="color: #666666; font-style: italic;">// problems</span>
                .<span style="color: #006633;">penaltyLog</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">build</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        StrictMode.<span style="color: #006633;">setVmPolicy</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> StrictMode.<span style="color: #006633;">VmPolicy</span>.<span style="color: #006633;">Builder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">detectLeakedSqlLiteObjects</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">detectLeakedClosableObjects</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">penaltyLog</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">penaltyDeath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">build</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// getRomFromNet(ROM_DOWNLOAD_URL);</span>
        romUpdate<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        TextView tv <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TextView<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        tv.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;RomUpdate Version: 1.1 - 2012.4.18&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        setContentView<span style="color: #009900;">&#40;</span>tv<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> romUpdate<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            bootCommand<span style="color: #009900;">&#40;</span>context<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</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> getRomFromNet<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> romURL<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// set the download URL, a url that points to a file on the internet</span>
            <span style="color: #666666; font-style: italic;">// this is the file to be downloaded</span>
            Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;   -------------  url: &quot;</span> <span style="color: #339933;">+</span> romURL <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; -------------  &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">URL</span> url <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span>romURL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// create the new connection</span>
            <span style="color: #003399;">HttpURLConnection</span> urlConnection <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">HttpURLConnection</span><span style="color: #009900;">&#41;</span> url
                    .<span style="color: #006633;">openConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">File</span> file <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>ROMPATH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// this will be used in reading the data from the internet</span>
            <span style="color: #003399;">InputStream</span> inputStream <span style="color: #339933;">=</span> urlConnection.<span style="color: #006633;">getInputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// this is the total size of the file</span>
            <span style="color: #000066; font-weight: bold;">int</span> totalSize <span style="color: #339933;">=</span> urlConnection.<span style="color: #006633;">getContentLength</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// variable to store total downloaded bytes</span>
            <span style="color: #000066; font-weight: bold;">int</span> downloadedSize <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// create a buffer...</span>
            <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> buffer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">int</span> bufferLength <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// used to store a temporary size of the</span>
&nbsp;
            Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;Download From [&quot;</span> <span style="color: #339933;">+</span> romURL <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;], Save File To: &quot;</span>
                    <span style="color: #339933;">+</span> ROMPATH <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">FileOutputStream</span> fileOutput <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileOutputStream</span><span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>bufferLength <span style="color: #339933;">=</span> inputStream.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>buffer<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                fileOutput.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>buffer, <span style="color: #cc66cc;">0</span>, bufferLength<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                downloadedSize <span style="color: #339933;">+=</span> bufferLength<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #666666; font-style: italic;">// close the output stream when done</span>
            fileOutput.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot; Save File To: [&quot;</span> <span style="color: #339933;">+</span> ROMPATH <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">MalformedURLException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            e.<span style="color: #006633;">printStackTrace</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: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p> 测试机器: GT-P7300/GT-P7310<br />
 测试环境:  Android 3.0<br />
 在 ClockworkMod_Recovery_v5.5.0.4 版本测试过，其他版本没有测试。</p>
<p>本文参考:<br />
 1. frameworks/base/core/java/android/os/RecoverySystem.java<br />
 2. bootable/recovery/recovery.c<br />
 3. RomManager.apk<br />
 4. <a href='http://wifihack.net/blog/wp-content/uploads/2012/04/RomUpdate.zip'>升级程序RomUpdate下载</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wifihack.net/blog/2012/04/android-clockworkmod-recovery-system-updat/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>
