From 0ccf804fb65842f36078832ca0cff6dd2d7be9f7 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 29 May 2013 21:53:38 +0200 Subject: Move files around --HG-- rename : LICENSE.txt => doc/LICENSE.txt rename : README.txt => doc/README.txt rename : todo.txt => doc/todo.txt rename : genFAQ.py => misc/genFAQ.py --- LICENSE.txt | 21 ------------ README.txt | 59 -------------------------------- doc/LICENSE.txt | 21 ++++++++++++ doc/README.txt | 59 ++++++++++++++++++++++++++++++++ doc/todo.txt | 34 ++++++++++++++++++ genFAQ.py | 104 -------------------------------------------------------- jni/jniglue.c | 1 - misc/genFAQ.py | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ todo.txt | 34 ------------------ 9 files changed, 218 insertions(+), 219 deletions(-) delete mode 100644 LICENSE.txt delete mode 100644 README.txt create mode 100644 doc/LICENSE.txt create mode 100644 doc/README.txt create mode 100644 doc/todo.txt delete mode 100755 genFAQ.py create mode 100755 misc/genFAQ.py delete mode 100644 todo.txt diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 7836430f..00000000 --- a/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -License for OpenVPN for Android. Please note that the thirdparty libraries/executables may have other license (OpenVPN, lzo, OpenSSL, Google Breakpad) - -Copyright (c) 2012-2013, Arne Schwabe - All rights reserved. - -If you need a non GPLv2 license of the source please contact me. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; version 2 -of the License only. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - diff --git a/README.txt b/README.txt deleted file mode 100644 index 50424d14..00000000 --- a/README.txt +++ /dev/null @@ -1,59 +0,0 @@ -This is my first Android project, so some things may be done in a completely stupid way. - -See the file todo.txt for ideas/not yet implemented features (and the bug tracker). - -Build instraction: - -Disable Google breakcode (WITH_BREAKPAD=0 in jni/Android.mk) or checkout google breakcode - -svn co http://google-breakpad.googlecode.com/svn/trunk/ google-breakpad - - -- Install sdk -- Install ndk (Version 8d gives strange linker errors, use 8b for now) -- Make sure that ndk-build is in your build path. - -Do ./build-native.(sh|bat) in the root directory of the project. -You may need to refresh the project and clean the project in eclipse - to have the libraries included the resulting apk. - -Use eclipse with android plugins to build the project. - - -FAQ - -Q: How is the OpenVPN version different from normal OpenVPN - -A: OpenVPN for Android uses a OpenVPN 2.3 master branch + Android patches + dual stack client patches. - A git repository of the OpenVPN source code and changes is under: - https://github.com/schwabe/openvpn/tree/android_2.3rc1%2Bds - -Q: what is minivpn? - -A: minivpn is only a executable thats links against libopenvpn which is the normal openvpn build as - library. It is done this way so the Android Play/Store apk will treat the library as normal library - and update it on updates of the application. Also the application does not need to take care of - keeping minivpn up to date because it contains no code. For almost all intents and purposes - minivpn + libopenvpn.so is the same as the normal openvpn binary - -Q: How to a VPN by name from an external app - -A: public class StartOpenVPNActivity extends Activity { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - - final String EXTRA_NAME = "de.blinkt.openvpn.shortcutProfileName"; - - Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); - shortcutIntent.setClassName("de.blinkt.openvpn", "de.blinkt.openvpn.LaunchVPN"); - shortcutIntent.putExtra(EXTRA_NAME,"upb ssl"); - startActivity(shortcutIntent); - } -} - -or from the shell: - -am start -a android.intent.action.MAIN -n de.blinkt.openvpn/.LaunchVPN -e de.blinkt.openvpn.shortcutProfileName Home - diff --git a/doc/LICENSE.txt b/doc/LICENSE.txt new file mode 100644 index 00000000..7836430f --- /dev/null +++ b/doc/LICENSE.txt @@ -0,0 +1,21 @@ +License for OpenVPN for Android. Please note that the thirdparty libraries/executables may have other license (OpenVPN, lzo, OpenSSL, Google Breakpad) + +Copyright (c) 2012-2013, Arne Schwabe + All rights reserved. + +If you need a non GPLv2 license of the source please contact me. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; version 2 +of the License only. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + diff --git a/doc/README.txt b/doc/README.txt new file mode 100644 index 00000000..50424d14 --- /dev/null +++ b/doc/README.txt @@ -0,0 +1,59 @@ +This is my first Android project, so some things may be done in a completely stupid way. + +See the file todo.txt for ideas/not yet implemented features (and the bug tracker). + +Build instraction: + +Disable Google breakcode (WITH_BREAKPAD=0 in jni/Android.mk) or checkout google breakcode + +svn co http://google-breakpad.googlecode.com/svn/trunk/ google-breakpad + + +- Install sdk +- Install ndk (Version 8d gives strange linker errors, use 8b for now) +- Make sure that ndk-build is in your build path. + +Do ./build-native.(sh|bat) in the root directory of the project. +You may need to refresh the project and clean the project in eclipse + to have the libraries included the resulting apk. + +Use eclipse with android plugins to build the project. + + +FAQ + +Q: How is the OpenVPN version different from normal OpenVPN + +A: OpenVPN for Android uses a OpenVPN 2.3 master branch + Android patches + dual stack client patches. + A git repository of the OpenVPN source code and changes is under: + https://github.com/schwabe/openvpn/tree/android_2.3rc1%2Bds + +Q: what is minivpn? + +A: minivpn is only a executable thats links against libopenvpn which is the normal openvpn build as + library. It is done this way so the Android Play/Store apk will treat the library as normal library + and update it on updates of the application. Also the application does not need to take care of + keeping minivpn up to date because it contains no code. For almost all intents and purposes + minivpn + libopenvpn.so is the same as the normal openvpn binary + +Q: How to a VPN by name from an external app + +A: public class StartOpenVPNActivity extends Activity { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + final String EXTRA_NAME = "de.blinkt.openvpn.shortcutProfileName"; + + Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); + shortcutIntent.setClassName("de.blinkt.openvpn", "de.blinkt.openvpn.LaunchVPN"); + shortcutIntent.putExtra(EXTRA_NAME,"upb ssl"); + startActivity(shortcutIntent); + } +} + +or from the shell: + +am start -a android.intent.action.MAIN -n de.blinkt.openvpn/.LaunchVPN -e de.blinkt.openvpn.shortcutProfileName Home + diff --git a/doc/todo.txt b/doc/todo.txt new file mode 100644 index 00000000..25b59a47 --- /dev/null +++ b/doc/todo.txt @@ -0,0 +1,34 @@ +Ideas: + +- Do cert+key+ca => p12 inside the app, import directly to keystore + +- general settings dialog + - encryption of profiles + +- Give the notification a nice speed bar + +- The app https://play.google.com/store/apps/details?id=org.proxydroid + has a nice feature: auto connect. Run a profile if a specified + network is available (a user defined WIFI profile and/or "WIFI/2G/3G" + and/or "WIFI" and/or "2G/3G" - selection of more than one network type + is possible) + +- Copy/Duplicate an existing profile (to create a new one with nearly + exact settings) + +- implement an encryption for profiles, so no sensitive data has be stored in plain text + - encrypt/decrypt with android private storage key (+no user input required) + + - hibernate when screen off and < 50 kB min + + +Missing configuration options: + +Tap support: +- Actually it is possible to emulate tap with tun device, a minimal implementation would have to do: + - generate random mac + - strip macs header on receive + - append mac header on send + - implement arp, possible the most difficult task ... + - need to chose right mac of receiver + diff --git a/genFAQ.py b/genFAQ.py deleted file mode 100755 index 5306cef7..00000000 --- a/genFAQ.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python -# Quick and dirty script to generate googlecode wiki pages - -import codecs -import xml.dom.minidom as dom -import os.path - -faqpath = "/Users/arne/oss/ics-openvpn.wiki" - -header=""" - -This page is autogenerated. Do not edit - - -= Frequently aksed questions = -""" - -def getString(strid,lang): - ostr="" - if strid in strres[lang]: - ostr=strres[lang][strid] - else: - ostr=strres["default"][strid] - - ostr = ostr.replace("<","<") - ostr = ostr.replace(">",">") - ostr = ostr.replace("\\\"","\"") - ostr = ostr.replace("\\'","'") - ostr = ostr.replace("\\n","

") - return ostr - -def genPage(faqdom,lang): - out ="" - - out+="#summary %s\n" % getString("faq_summary",lang) - out+= header - - for xmld in faqdom.firstChild.childNodes: - for xmle in xmld.childNodes: - if xmle.nodeName == "TextView": - style = xmle.getAttribute("style") - - textstyle = None - if style == "@style/faqhead": - textstyle = "== %s ==\n" - elif style == "@style/faqitem": - textstyle = "%s\n" - - atext = xmle.getAttribute("android:text") - aid = xmle.getAttribute("android:id") - if atext: - atextid = atext.replace("@string/","") - else: - atextid = aid.replace("@+id/","") - - out += textstyle % getString(atextid,lang) - - return out - - -strres={} - -def loadstrres(filename,lang): - xmlstr = dom.parse(filename) - strres[lang]={} - for xmld in xmlstr.childNodes: - for xmle in xmld.childNodes: - if xmle.nodeName == "string": - strname= xmle.getAttribute("name") - strdata = xmle.firstChild.data - strres[lang][strname]=strdata - - -def main(): - - loadstrres("res/values/strings.xml","default") - - faqdom = dom.parse("res/layout/faq.xml") - faq= genPage(faqdom,"default") - - open(faqpath + "/FAQ.wiki","w").write(faq) - - for directory in os.listdir("res"): - if directory.startswith("values-") and directory.find("-sw")==-1: - lang = directory.split("-",1)[1] - print lang - loadstrres("res/values-%s/strings.xml" % lang,lang) - - langdir= "%s/%s" %(faqpath,lang) - if lang=="zh-rCN": - langdir= "%s/%s" %(faqpath,"zh-Hans") - elif lang=="zh-rTW": - langdir= "%s/%s" %(faqpath,"zh-Hant") - - - if not os.path.exists(langdir): - os.mkdir(langdir) - - faq= genPage(faqdom,lang) - open("%s/FAQ.wiki" % langdir,"w").write(faq.encode("utf-8")) - - -if __name__=="__main__": - main() diff --git a/jni/jniglue.c b/jni/jniglue.c index c3b4bf3b..36ad8fe7 100644 --- a/jni/jniglue.c +++ b/jni/jniglue.c @@ -19,4 +19,3 @@ void android_openvpn_log(int level,const char* prefix,const char* prefix_sep,con void Java_de_blinkt_openvpn_core_NativeUtils_jniclose(JNIEnv *env,jclass jo, jint fd) { int ret = close(fd); } - diff --git a/misc/genFAQ.py b/misc/genFAQ.py new file mode 100755 index 00000000..5306cef7 --- /dev/null +++ b/misc/genFAQ.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# Quick and dirty script to generate googlecode wiki pages + +import codecs +import xml.dom.minidom as dom +import os.path + +faqpath = "/Users/arne/oss/ics-openvpn.wiki" + +header=""" + +This page is autogenerated. Do not edit + + += Frequently aksed questions = +""" + +def getString(strid,lang): + ostr="" + if strid in strres[lang]: + ostr=strres[lang][strid] + else: + ostr=strres["default"][strid] + + ostr = ostr.replace("<","<") + ostr = ostr.replace(">",">") + ostr = ostr.replace("\\\"","\"") + ostr = ostr.replace("\\'","'") + ostr = ostr.replace("\\n","

") + return ostr + +def genPage(faqdom,lang): + out ="" + + out+="#summary %s\n" % getString("faq_summary",lang) + out+= header + + for xmld in faqdom.firstChild.childNodes: + for xmle in xmld.childNodes: + if xmle.nodeName == "TextView": + style = xmle.getAttribute("style") + + textstyle = None + if style == "@style/faqhead": + textstyle = "== %s ==\n" + elif style == "@style/faqitem": + textstyle = "%s\n" + + atext = xmle.getAttribute("android:text") + aid = xmle.getAttribute("android:id") + if atext: + atextid = atext.replace("@string/","") + else: + atextid = aid.replace("@+id/","") + + out += textstyle % getString(atextid,lang) + + return out + + +strres={} + +def loadstrres(filename,lang): + xmlstr = dom.parse(filename) + strres[lang]={} + for xmld in xmlstr.childNodes: + for xmle in xmld.childNodes: + if xmle.nodeName == "string": + strname= xmle.getAttribute("name") + strdata = xmle.firstChild.data + strres[lang][strname]=strdata + + +def main(): + + loadstrres("res/values/strings.xml","default") + + faqdom = dom.parse("res/layout/faq.xml") + faq= genPage(faqdom,"default") + + open(faqpath + "/FAQ.wiki","w").write(faq) + + for directory in os.listdir("res"): + if directory.startswith("values-") and directory.find("-sw")==-1: + lang = directory.split("-",1)[1] + print lang + loadstrres("res/values-%s/strings.xml" % lang,lang) + + langdir= "%s/%s" %(faqpath,lang) + if lang=="zh-rCN": + langdir= "%s/%s" %(faqpath,"zh-Hans") + elif lang=="zh-rTW": + langdir= "%s/%s" %(faqpath,"zh-Hant") + + + if not os.path.exists(langdir): + os.mkdir(langdir) + + faq= genPage(faqdom,lang) + open("%s/FAQ.wiki" % langdir,"w").write(faq.encode("utf-8")) + + +if __name__=="__main__": + main() diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 25b59a47..00000000 --- a/todo.txt +++ /dev/null @@ -1,34 +0,0 @@ -Ideas: - -- Do cert+key+ca => p12 inside the app, import directly to keystore - -- general settings dialog - - encryption of profiles - -- Give the notification a nice speed bar - -- The app https://play.google.com/store/apps/details?id=org.proxydroid - has a nice feature: auto connect. Run a profile if a specified - network is available (a user defined WIFI profile and/or "WIFI/2G/3G" - and/or "WIFI" and/or "2G/3G" - selection of more than one network type - is possible) - -- Copy/Duplicate an existing profile (to create a new one with nearly - exact settings) - -- implement an encryption for profiles, so no sensitive data has be stored in plain text - - encrypt/decrypt with android private storage key (+no user input required) - - - hibernate when screen off and < 50 kB min - - -Missing configuration options: - -Tap support: -- Actually it is possible to emulate tap with tun device, a minimal implementation would have to do: - - generate random mac - - strip macs header on receive - - append mac header on send - - implement arp, possible the most difficult task ... - - need to chose right mac of receiver - -- cgit v1.2.3