<?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>szym.net</title>
	<atom:link href="http://szym.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://szym.net</link>
	<description></description>
	<lastBuildDate>Wed, 12 Jan 2011 20:42:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>dythr advanced in Knight News Challenge</title>
		<link>http://szym.net/2011/01/dythr-advanced-in-knc/</link>
		<comments>http://szym.net/2011/01/dythr-advanced-in-knc/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 20:42:00 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[dythr]]></category>

		<guid isPermaLink="false">http://szym.net/?p=354</guid>
		<description><![CDATA[Yay! dythr advanced to the next round of Knight News Challenge. We've got to work on the full proposals, which are due soon!]]></description>
			<content:encoded><![CDATA[Yay! <a href='/dythr'>dythr</a> advanced to the next round of <a href='http://www.newschallenge.org/'>Knight News Challenge</a>. We've got to work on the full proposals, which are due soon!]]></content:encoded>
			<wfw:commentRss>http://szym.net/2011/01/dythr-advanced-in-knc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep-root Recovery for Motorola Droid</title>
		<link>http://szym.net/2011/01/keep-root-droid/</link>
		<comments>http://szym.net/2011/01/keep-root-droid/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 07:28:48 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://szym.net/?p=318</guid>
		<description><![CDATA[If you currently have root access on your Motorola Droid but are running a vanilla (not custom) ROM, you need to take precautions when applying an OTA update. By default an OTA update will remove your root access. Some phones are rather easy to re-root (for instance, ), but in some cases the OTA update <a href="http://szym.net/2011/01/keep-root-droid/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[If you currently have root access on your Motorola Droid but are running a vanilla (not custom) ROM, you need to take precautions when applying an OTA update. By default an OTA update will remove your root access. Some phones are rather easy to re-root (for instance, <a href='http://szym.net/2010/12/rooting-nexus-one/'>Nexus One</a>), but in some cases the OTA update patches up the security holes exploited to gain root access.

<p>
My remedy is <a href='http://szym.net/2010/12/shsu-recovery/'>shsu</a> -- a very simple patch on top of the standard recovery image that will prevent loss of root access when applying an OTA update. Here's how to install and use it:<span id="more-318"></span>

<div class="note">Use at your own risk! I am not responsible for any damage incurred by following these instructions or using the linked software!</div>

<p>
<ol>
 <li>Download <a href="https://github.com/downloads/szym/android_bootable_recovery/flash_image">flash_image</a> and <a href="https://github.com/downloads/szym/android_bootable_recovery/recovery-ERE22D-shsu.img" >recovery-ERE22D-shsu</a>.
  <li>Push them to <code>/sdcard</code> on the phone -- either mount the SD card and copy it or use 
<pre class="brush:shell">
adb push flash_image /sdcard/
adb push recovery-ERE22D-shsu.img /sdcard/
</pre>.
  <li>Execute within <code>adb shell</code>:
<pre class="brush:shell">
cd /sdcard/
chmod 755 flash_image
su -c ./flash_image recovery recovery-ERE22D-shsu.img
</pre>
</ol>

<h4>Test Drive</h4>

<p>Verify that you have installed the recovery image correctly, by rebooting into recovery mode. The easiest way:
<pre class="brush:shell">
adb reboot recovery
</pre>
In the modified recovery, you can toggle menu using the space button. You should see <pre>
[ szym ] system recovery utility
</pre> and the last option on the list should be <code>install shsu</code>:
<a href="http://szym.net/wp-content/uploads/shsu.png"><img src="http://szym.net/wp-content/uploads/shsu-168x300.png" alt="" title="shsu" width="168" height="300" class="aligncenter size-medium wp-image-333" /></a>


<p>
This recovery will install <code>shsu</code> (shell-only su) every time it exits, so after rebooting back you can check that it worked by running within <code>adb shell</code>:
<pre class="brush:shell">
ls -l /system/xbin/shsu
-rwsr-x--- root     shell       80492 2011-01-02 02:10 shsu
shsu
id
uid=0(root) gid=0(root) groups=...
</pre>
This is a shell-only su, meaning that no app other than the shell (that is, adb shell) will be able to use it. 

<h4>Restoring root access using shsu</h4>
<p>
It is now safe to apply an OTA update. After applying the update, you will lose root access via regular su. Assuming the (now ineffective) su binary is in /system/xbin we need to fix its permissions. Enter <code>adb shell</code>:
<pre class="brush:shell">
shsu
mount -o remount,rw /dev/block/mtdblock4 /system
chmod 4755 /system/xbin/su
mount -o remount,ro /dev/block/mtdblock4 /system
</pre>
]]></content:encoded>
			<wfw:commentRss>http://szym.net/2011/01/keep-root-droid/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Barnacle 0.6.7 for HTC Evo, Aria, Liberty</title>
		<link>http://szym.net/2011/01/barnacle-0-6-7/</link>
		<comments>http://szym.net/2011/01/barnacle-0-6-7/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 04:55:12 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[barnacle]]></category>

		<guid isPermaLink="false">http://szym.net/?p=309</guid>
		<description><![CDATA[Version 0.6.7 is available. Barnacle 0.6.7 should work on HTC Evo and, with some extra work, on Aria and Liberty (and possibly Desire) as well. For Aria/Liberty you will need to download new firmware for your wifi driver. HTC Aria, Liberty, Desire(?) Download fw_bcm4329.bin to /sdcard/. You probably won't be able to download this on <a href="http://szym.net/2011/01/barnacle-0-6-7/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<a href="/apk/barnacle_39.apk">Version 0.6.7</a> is available. Barnacle 0.6.7 should work on HTC Evo and, with some extra work, on Aria and Liberty (and possibly Desire) as well. For Aria/Liberty you will need to download new firmware for your wifi driver.
<p>
<span id="more-309"></span>
<h4>HTC Aria, Liberty, Desire(?)</h4>
<ol>
<li>
Download <a href="http://piraterum.googlecode.com/svn-history/r181/branches/DesirePirate/system/etc/firmware/fw_bcm4329.bin">fw_bcm4329.bin</a> to <code>/sdcard/</code>. You probably won't be able to download this on the phone (due to the .bin extension) so download it on your computer and then put it on <code>/sdcard</code> either by mounting the SD card via USB and copying the file over or via adb: 
<pre class="brush: shell">
adb push fw_bcm4329.bin /sdcard/
</pre>
<li>
Unmount the SD card (it needs to be unmounted from USB in order for Android apps to read from it).
<li>
In Barnacle, configure Settings > Custom Wifi Ad-hoc > Aria/Liberty
<li>
Start Barnacle
</ol>
]]></content:encoded>
			<wfw:commentRss>http://szym.net/2011/01/barnacle-0-6-7/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>What&#8217;s new in Barnacle 0.6.6</title>
		<link>http://szym.net/2010/12/whats-new-in-barnacle-0-6-6/</link>
		<comments>http://szym.net/2010/12/whats-new-in-barnacle-0-6-6/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 08:56:11 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[barnacle]]></category>

		<guid isPermaLink="false">http://szym.net/?p=298</guid>
		<description><![CDATA[Version 0.6.6 is a minor update that should fix Barnacle on Milestone and a couple other phones. It also cleans up the log a little bit. The reason why was failing on Milestone is most bizarre: a process would exit with status 0 and yet the shell would treat that as "false", hence this was <a href="http://szym.net/2010/12/whats-new-in-barnacle-0-6-6/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="/apk/barnacle_38.apk">Version 0.6.6</a> is a minor update that should fix Barnacle on Milestone and a couple other phones. It also cleans up the log a little bit. 

<p>The reason why <a href='http://szym.net/2010/12/whats-new-in-barnacle-0-6-5/'>0.6.5 (37)</a> was failing on Milestone is most bizarre: a process would exit with status 0 and yet the shell would treat that as "false", hence this was failing (only on Milestone!):
<pre class="brush:shell">
./wifi load || exit
</pre>
]]></content:encoded>
			<wfw:commentRss>http://szym.net/2010/12/whats-new-in-barnacle-0-6-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barnacle and iPad</title>
		<link>http://szym.net/2010/12/barnacle-and-ipad/</link>
		<comments>http://szym.net/2010/12/barnacle-and-ipad/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 00:01:43 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[barnacle]]></category>

		<guid isPermaLink="false">http://szym.net/?p=292</guid>
		<description><![CDATA[Many users have issues connecting iPad to Barnacle's ad-hoc network. Here's some light as to why iPads are having difficulties when iPods and iPhones are doing fine. The problem here is timing. Basically, the wireless driver on many Android phones only beacons an ad-hoc network for a while, and then if no other client associates, <a href="http://szym.net/2010/12/barnacle-and-ipad/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Many users have issues connecting iPad to Barnacle's ad-hoc network. Here's some light as to why iPads are having difficulties when iPods and iPhones are doing fine.

<p>The problem here is timing. Basically, the wireless driver on many Android phones only beacons an ad-hoc network for a while, and then if no other client associates, it stops. The next time it tries, it uses a different BSSID. Unfortunately, AFAIK, there's nothing we can do to stop it. If you try providing a BSSID in the settings, it might simply fail to beacon at all (it would only associate with an existing network matching that BSSID).
<span id="more-292"></span>

<p>On the other hand it seems that the iPad won't beacon a network. It only wants to associate with an existing network and it does so by matching the BSSID after you tell it to connect. So you can see, there
is a very short window from the moment your Droid starts beaconing to the moment it will inevitably change its BSSID. This short window is when your iPad can connect with it.

<p>The known workaround right now is to first establish an ad-hoc network by other means and then tell an iPad to connect to it. For example, if you can connect your laptop to barnacle, you should then be able to
connect iPad without issues. You can then turn your laptop off.
]]></content:encoded>
			<wfw:commentRss>http://szym.net/2010/12/barnacle-and-ipad/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>What&#8217;s new in Barnacle 0.6.5</title>
		<link>http://szym.net/2010/12/whats-new-in-barnacle-0-6-5/</link>
		<comments>http://szym.net/2010/12/whats-new-in-barnacle-0-6-5/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 07:28:05 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[barnacle]]></category>

		<guid isPermaLink="false">http://szym.net/?p=287</guid>
		<description><![CDATA[Version 0.6.5 is hopefully the last of the December series of updates (starting at 0.6, , , and 0.6.4 so far). In 0.6.4, three distinct exceptions (also known as Force Close or FC) got squished. Also, added some handling of the nasty situation when another app enables wifi. If this happens, Barnacle tries to restart <a href="http://szym.net/2010/12/whats-new-in-barnacle-0-6-5/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="/apk/barnacle_37.apk">Version 0.6.5</a> is hopefully the last of the December series of updates 
(starting at 0.6, <a href='http://szym.net/2010/12/whats-new-in-barnacle-0-6-1/'>0.6.1</a>, <a href='http://szym.net/2010/12/whats-new-in-barnacle-0-6-2/'>0.6.2</a>, <a href='http://szym.net/2010/12/whats-new-in-barnacle-0-6-3/'>0.6.3</a> and 0.6.4 so far).
<p>In 0.6.4, three distinct exceptions (also known as Force Close or FC) got squished. Also, added some handling of the nasty situation when another app enables wifi. If this happens, Barnacle tries to restart as gracefully as possible (which is not that gracefully unfortunately).
<p>In 0.6.5, the setup scripts got a handful of fixes. There should be no more spurious "su not found" nor errors when connecting to NAT (for Access Control). Finally, switching between 3G and 4G should be as simple as restarting Barnacle (it will use whatever is available at the time of start).
<span id="more-287"></span>
<p>Unfortunately, didn't have time to fix the GRE forwarding issue.


]]></content:encoded>
			<wfw:commentRss>http://szym.net/2010/12/whats-new-in-barnacle-0-6-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What&#8217;s new in Barnacle 0.6.3</title>
		<link>http://szym.net/2010/12/whats-new-in-barnacle-0-6-3/</link>
		<comments>http://szym.net/2010/12/whats-new-in-barnacle-0-6-3/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 10:34:54 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[barnacle]]></category>

		<guid isPermaLink="false">http://szym.net/?p=281</guid>
		<description><![CDATA[Version 0.6.3 is so major I was contemplating calling it 0.7. Widget, encryption, bug fixes, ... a whole bunch of goodies for the holidays! Donation widget! "Barnacle Wifi Tether - donate" is now the "Barnacle Widget"! Everyone who donated so far (2000 users!) gets a nice gift for the holidays You will need to download <a href="http://szym.net/2010/12/whats-new-in-barnacle-0-6-3/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="/apk/barnacle_35.apk">Version 0.6.3</a> is so major I was contemplating calling it 0.7. 
<p>
Widget, encryption, bug fixes, ... a whole bunch of goodies for the holidays!
<span id="more-281"></span>

<h3>Donation widget!</h3>
<p>"Barnacle Wifi Tether - donate" is now the "Barnacle Widget"! Everyone who donated so far (2000 users!) gets a nice gift for the holidays <img src='http://szym.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> 
<p>You will need to download the free Barnacle Wifi Tether yourself, but that shouldn't be too hard.
<p>
After some experimentation, I discovered that due to some bad design in Android's permissions, you will also need to <u>reinstall</u> Barnacle Widget (from the Market) after installing Barnacle Wifi Tether for the first time. Otherwise, the widget won't be granted the permissions to control Barnacle.

<h3>wpa_supplicant fixed for Droid 2.2</h3>

<p>After quite a bit of work, I managed to get wpa_supplicant to behave on Moto Droid 2.2. A working wpa_supplicant means <b>WEP is working again</b>! More than that, it seems the new wpa_supplicant is much more consistent with respect to the beaconed BSSID and it features its own auto-beaconing.</p>

<p>I also added a small fix that allows wpa_supplicant join existing ad-hoc networks. This could help in the few cases when the laptop won't connect to Barnacle, but Barnacle can connect to the laptop.

<h3>40- and 104-bit WEP keys in wext</h3>

<p>Users who don't have wpa_supplicant working might be able to get WEP working on their phones as well after support for both 40- and 104-bit keys is fixed. Note, however, that whether WEP will actually work without wpa_supplicant depends on how well the wireless driver for your device implements wireless extensions.</p>

<h3>More reliable cleanup</h3>

<p>I managed to make the after-shutdown-cleanup much more reliable, so you should see "port already in use" much less frequently. Similarly, wifi should now work after Barnacle is stopped without having to kill the app.</p>

<h3>"run not found" fixed?</h3>

<p>Finally, added a small fix that should make the "run not found" problem (due to some bad implementations of <code>su</code>) go away, and squished yet another FC.</p>

]]></content:encoded>
			<wfw:commentRss>http://szym.net/2010/12/whats-new-in-barnacle-0-6-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Prospects of Ad-hoc Wifi in Android</title>
		<link>http://szym.net/2010/12/prospects-of-ad-hoc-wifi-in-android/</link>
		<comments>http://szym.net/2010/12/prospects-of-ad-hoc-wifi-in-android/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 23:36:05 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://szym.net/?p=250</guid>
		<description><![CDATA[Back to my "favorite" Android Issue 82. It seems Android engineers prefer Wi-Fi Direct over ad-hoc as illustrated by this thread. Ad-hoc has slipped in priority in favor of other superior solutions keeping power constraints and security in mind. Soft Ap support exists and wi-fi direct support will come in the future. ...even though ad-hoc <a href="http://szym.net/2010/12/prospects-of-ad-hoc-wifi-in-android/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
Back to my "favorite" <a href="http://code.google.com/p/android/issues/detail?id=82">Android Issue 82</a>.  It seems Android engineers prefer <a href="http://en.wikipedia.org/wiki/Wi-Fi_Direct">Wi-Fi Direct</a> over ad-hoc as illustrated by <a href="http://groups.google.com/group/android-platform/browse_thread/thread/b4b2eca664b249b6">this thread</a>.
</p>

<blockquote>
Ad-hoc has slipped in priority in favor of other superior solutions keeping 
power constraints and security in mind. Soft Ap support exists and wi-fi 
direct support will come in the future. 
</blockquote>
<span id="more-250"></span>
<p>
...even though ad-hoc is an age old technology supported by many many devices, and direct wifi is not available yet. But there's hope:
</p>
<blockquote>
Wifi direct is a layer that auto configures one of the devices as a Soft Ap. 
The benefits you have with Soft Ap are the same that you will get with wifi 
direct (wpa2 and power management). Thats not to say there is no good reason 
to add ad-hoc, there is - compatibility with devices that only support 
ad-hoc. 
(...)
Expect to see both direct and ad-hoc support in the future. 
</blockquote>

<p>
I wonder though if Wi-Fi Direct will support group communication, or will one device (the soft AP) need to do all the heavy lifting. In an ad-hoc network, no node acts as a relay: all traffic is direct, broadcasts are direct. In an infrastructure (or soft AP) network, the AP relays all traffic: even broadcast packets will be sent to the AP which then broadcasts them to all.
</p>

<p>Here's a snippet from Wi-Fi Alliance's FAQ on Wi-Fi Direct:</p>

<blockquote>
<h4>Is this the same as Ad Hoc mode?</h4>
<p>
No. Ad Hoc, or IBSS, mode is a legacy protocol for Wi-Fi devices, and Wi-Fi Direct is a new innovation.
Wi-Fi Direct brings important security features, ease of setup, and higher performance that is not currently
available in Ad Hoc mode. With Wi-Fi Direct, a device can maintain a simultaneous connection to an
infrastructure network – this isn’t possible with Ad Hoc.
</p>

<h4>Is the specification underlying the Wi-Fi Direct certification program based on the IEEE 802.11s
(Mesh) or 802.11z (Direct Link Setup) standards?</h4>
<p>
No. The specification underlying the Wi-Fi Direct certification program was developed within the Wi-Fi
Alliance by member companies. It operates on 802.11 devices but is not linked to any specific IEEE
802.11 amendment.
</p>
</blockquote>

<p>This means, Wi-Fi Direct is not an IEEE standard, but a specification from the Wi-Fi Alliance. It's not necessarily a bad thing. The rationale here seems to be that the reason why ad-hoc failed despite Wi-Fi certification was because it wasn't "easy enough for home users", and so Wi-Fi Direct is essentially built on top of <a href="http://en.wikipedia.org/wiki/Wi-Fi_Protected_Setup">Wi-Fi Protected Setup</a>.  
</p>

<p>
I have to say I'm rather disappointed by the arguments that legacy ad-hoc, or IBSS, deserves to be abandoned now because it was insecure or slow. Ad-hoc is basically defined above the MAC, so there's no fundamental reason why ad-hoc would not be able to support any of the data-rates or data encryption algorithms that are supported by the client device. That ad-hoc never evolved beyond 802.11b is to be blamed on the Wi-Fi Alliance for not updating the certification to allow 802.11g data-rates or WPA2 AES-based encryption.
</p>

<p>
Although I can see how WPS will make the "nightmare of setting up ad-hoc" go away for many users, I don't see any substantial advantages of the AP - STA approach taken in Wi-Fi Direct. It almost seems like this is a "lazy" solution along the lines of: since soft AP is becoming more proliferate (ironically to support the crippled STA devices that cannot do ad-hoc, like PS3, Wii, etc.), why not come up with a protocol that will establish which station should become a soft AP on-demand?
</p>
]]></content:encoded>
			<wfw:commentRss>http://szym.net/2010/12/prospects-of-ad-hoc-wifi-in-android/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What&#8217;s new in Barnacle 0.6.2</title>
		<link>http://szym.net/2010/12/whats-new-in-barnacle-0-6-2/</link>
		<comments>http://szym.net/2010/12/whats-new-in-barnacle-0-6-2/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 22:33:27 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[barnacle]]></category>

		<guid isPermaLink="false">http://szym.net/?p=222</guid>
		<description><![CDATA[Version 0.6.2 is an incremental update to 0.6.1 which improves the startup speed, but most importantly adds a couple new preferences: Auto Associate enables the auto-beaconing feature but you should disable it if it's causing trouble New Client Actions allows you to set notification options (sound/light) and specify that a new client should be automatically <a href="http://szym.net/2010/12/whats-new-in-barnacle-0-6-2/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="/apk/barnacle_33.apk">Version 0.6.2</a> is an incremental update to <a href="http://szym.net/2010/12/whats-new-in-barnacle-0-6-1/">0.6.1</a> which improves the startup speed, but most importantly adds a couple new preferences: <span id="more-222"></span></p>

<ul>
<li>Auto Associate enables the auto-beaconing feature but you should disable it if it's causing trouble </li>
<li>New Client Actions allows you to set notification options (sound/light) and specify that a new client should be automatically granted access. (You can always deny access from the clients list later.)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://szym.net/2010/12/whats-new-in-barnacle-0-6-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>shsu recovery &#8212; auto-root after OTA</title>
		<link>http://szym.net/2010/12/shsu-recovery/</link>
		<comments>http://szym.net/2010/12/shsu-recovery/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 08:05:51 +0000</pubDate>
		<dc:creator>szym</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://szym.net/?p=204</guid>
		<description><![CDATA[Despite all the excitement about custom ROMs, my Android phone is running the vanilla (Google experience) ROM that shipped from my network operator. However, I want to be both up-to-date and rooted, so I apply each OTA update but not without caution. An OTA update typically removes the setuid bit from all executables on the <a href="http://szym.net/2010/12/shsu-recovery/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Despite all the excitement about custom ROMs, my Android phone is running the vanilla (Google experience) ROM that shipped from my network operator.
However, I want to be both up-to-date and rooted, so I apply each OTA update but not without caution.</p>
<p>An OTA update typically removes the setuid bit from all executables on the system partition (the only one allowed to have the setuid bit set). To avoid losing root, I crafted my own recovery image which differs from the vanilla recovery image in one major aspect: before it reboots, it installs shsu: a shell-only su. Thus, even after unintended OTA update (happened before), I keep my root access. 
</p>
<span id="more-204"></span>

<h3>shsu branch</h3>

<p>This is a direct import of bootable/recovery from the <a href="http://android.git.kernel.org/?p=platform/bootable/recovery.git;a=summary">AOSP master</a>. A <a href="https://github.com/szym/android_bootable_recovery/compare/master...shsu">minimal
patch</a> adds a new option <code>install shsu</code> which installs the included standard
su as <code>shsu</code> (shsu stands for <em>shell-only</em> su which means it only works over adb
shell).</p>

<p>The new option <code>install shsu</code> is executed every time before reboot. The action
is implemented by setting a property <code>shsu.install=1</code>. This change is picked
up by <code>init</code> which executes the action specified in <code>init.rc</code> using builtins
only:</p>

<pre class="brush:shell"># copy su to /system/xbin/shsu using builtins only
on property:shsu.install=1
    mount yaffs2 mtd@system /system
    mount yaffs2 mtd@system /system rw remount
    mkdir /system/xbin

    copy /sbin/su /system/xbin/shsu
    chown root shell /system/xbin/shsu
    chmod 4750 /system/xbin/shsu

    setprop shsu.installed 1
    write /sbin/shsu.installed 1

    # also, recovery overwrite precautions
    copy /system/etc/install-recovery.sh /system/etc/install-recovery.sh.not
    write /system/etc/install-recovery.sh "exit #"
</pre>

<p>One of the effects of this action is also disabling the automated patching of
the recovery partition. You can later apply the recovery patch manually by
executing (in su shell):
<pre>
    sh /etc/install-recovery.sh.not
</pre>
...although you might have to edit the script to remove the <code>exit</code> if you called
<code>install shsu</code> more than once. After patching your nice recovery image is gone, 
so you probably want to....</p>

<h3>fix-recovery</h3>

<p>A simple script <a href="https://github.com/szym/android_bootable_recovery/blob/shsu/tools/shsu/fix-recovery.sh"><code>tools/fix-recovery.sh</code></a> automates the process of retrieving the
current recovery image, replacing the recovery binary, installing the
<code>shsu.install</code> hook, and reflashing the image. It also installs busybox if
available in your <code>out</code> directory and "unsecures" properties to enable adb.</p>

<p>This script depends on <a href="https://github.com/szym/unbootimg">unbootimg</a></p>

<p>Usage:</p>

<pre>./fix-recovery.sh (all|pull|fix|flash) [recovery-image-name]
</pre>

<p>You will need to build the following from the Android repo beforehand:</p>

<pre>make su flash_image recovery adbd unpack.sh repack.sh mkbootimg unbootimg
</pre>

<p>If you can't use <code>fix_recovery.sh</code> (for example, you're using Windows) I have prepared an  <a href='http://szym.net/2011/01/keep-root-droid/'>auto-root recovery for Motorola Droid</a>.]]></content:encoded>
			<wfw:commentRss>http://szym.net/2010/12/shsu-recovery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

