Fire TV 2nd Gen - Root & OpenVPN

    
2016-03-30

Fire TV is an awesome htpc replacement. It still requires rooting and, if you want to watch US Netflix shows outside of US, installing a VPN client.

Rooting is straightforward – I just followed this guide.

Installing OpenVPN is a bit more tricky. Even though there are few tutorials (e.g. this one or this one), recommended installer apk doesn’t work on my Fire TV.

This tutorial recommends unpacking the OpenVPN binary manually to /system/xbin/. After following the steps, OpenVPN returned the error only position independent executables (PIE) are supported when started from adb. More info on this issue can be found here.

The first option is to recompile the OpenVPN binary with PIE support (linker options "-fPIE -pie"). Surely no one has time for that. A hackier way is to use a patched /system/bin/linker that skips the PIE checks entirely. I tested a bunch of patched versions – some of them caused funny crashes (e.g. random application storage space is full errors) or even boot-looped the OS. This is the version that worked fine on my Fire TV.

/system/bin/linker can be quickly replaced using adb:

adb push linker /sdcard/
adb shell
su
mount -o remount rw /system
mv /system/bin/linker /system/bin/linker.bak
cp /sdcard/linker /system/bin/
chmod 755 /system/bin/linker
mount -o remount ro /system
rm /sdcard/linker

Tagged #Fire TV , #Kodi , #XBMC , #VPN , #OpenVPN , #Android , #linker , #PIE , #Root
2016-03-30