OpenVPN Manual Install Android Samsung Galaxy S4

OpenVPN on AndroidLast night I wanted to connect to my VPN to have access to the server resources on my T-Mobile Galaxy S4. Unfortunately it seems that installing the OpenVPN Installer App from the Play Store has been broken on 4.3 and up versions of Android. Thankfully I was able to hack together a few steps that will allow you to install the OpenVPN binary needed to use the OpenVPN Settings App. Even more so I decided to document how I was able to install the binary in this blog, if only so I have a tutorial for when I re-rom my phone. This tutorial will assume you have adb.exe setup on Windows (or Linux) in order to push the binary OpenVPN file to the phone as well as a rooted Galaxy S4. Also a huge thanks to the author of the OpenVPN Installer App APK, Friedrich Schäuffelhut (without whom I would probably not have OpenVPN Working). So let’s dive right in.

First up, it is necessary to understand that an APK can be extracted using an unzipping program. My unzipping program of choice is 7zip, but others might like WinRAR or even WinZIP. But in reality no extra software is required on Windows other than renaming the .apk to .zip. Once that has been done, windows will be able to extract the Android APK file like a normal zip file. So let’s start by downloading the OpenVPN Installer from http://android-openvpn-installer.googlecode.com/

Go to Downloads and grab the OpenVPN-Installer-0.2.4.apk Download the file and extract the contents, either to the download folder a temp folder or somewhere you feel comfortable with to locate it and be able to push it to your Samsung Galaxy S4.

Once you have the OpenVPN Install APK File downloaded and unzipped open a command prompt shell. Push the file located under assets/openvpn-2.1.1-static-xbin to the phone with the following command (the phone needs to be connected via usb):

adb push c:tempopenvpn-apk-extractedassetsopenvpn-2.1.1-static-xbin /storage/sdcard/emulated/legacy/openvpn
									

The adb command will essentially copy the OpenVPN Binary file to your phone’s internal SD Card. Once the OpenVPN binary has been copied it is time to open up an adb shell. Type adb shell on the command prompt and it will take you to the shell. From here we will need to mount the /system file as read-write. Execute the following commands from the adb shell:

su
mount -o remount,rw /dev/block/platform/msm_sdcc.1/by-name/system /system
cp /storage/sdcard/emulated/legacy/openvpn /system/xbin/
chmod 755 /system/xbin/openvpn
mount -o remount,ro /system
									

The commands above will mount the /system as read-write. Note, the path may vary. To find out the right path type mount and look for /system. Once the /system partition has been mounted as read-write we copy the OpenVPN Binary file to the xbin folder which will add the OpenVPN binary to our path for using OpenVPN at a later time than chmod the OpenVPN Binary to allow execution and finally re-mount the /system as read only. Once that has been done, you can verify completion by running openvpn –help from the adb shell. If you see the manual / help section for OpenVPN, congratulations! You have manually installed the OpenVPN Binary…now what?

Well after you have the OpenVPN binary installed, I would suggest using the OpenVPN Installer’s Settings application from the same author, Friedrich Schäuffelhut. Configure your VPN settings and you are on your way to accessing local resources from your server(s) using OpenVPN.

The tl;dr version:
Download apk from http://android-openvpn-installer.googlecode.com/
Either run 7zip or rename to .zip and unzip to a folder.
Open command prompt, run adb push
Once pushed connected to adb shell and run the following:

su
mount -o remount,rw /dev/block/platform/msm_sdcc.1/by-name/system /system
cp /storage/sdcard/emulated/legacy/openvpn /system/xbin/
chmod 755 /system/xbin/openvpn
mount -o remount,ro /system
									


Exit the shell, install the OpenVPN Settings from the Play Store and you should be on your way!

No Comments

Leave us a comment

No comment posted yet.

Leave a Comment

↑ BACK TO THE TOP ↑