From 85cbeb46d371b96af0034f08e2e323d3bc202c49 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 2 Jul 2013 22:54:28 -0600 Subject: Move AboutFragment into leapclient package --- src/se/leap/leapclient/AboutFragment.java | 65 +++++++++++++++++++++++++ src/se/leap/leapclient/ConfigurationWizard.java | 1 - src/se/leap/leapclient/Dashboard.java | 1 - src/se/leap/openvpn/AboutFragment.java | 65 ------------------------- 4 files changed, 65 insertions(+), 67 deletions(-) create mode 100644 src/se/leap/leapclient/AboutFragment.java delete mode 100644 src/se/leap/openvpn/AboutFragment.java diff --git a/src/se/leap/leapclient/AboutFragment.java b/src/se/leap/leapclient/AboutFragment.java new file mode 100644 index 00000000..9c7f31f0 --- /dev/null +++ b/src/se/leap/leapclient/AboutFragment.java @@ -0,0 +1,65 @@ +package se.leap.leapclient; + +import android.app.Fragment; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager.NameNotFoundException; +import android.os.Bundle; +import android.text.Html; +import android.text.Spanned; +import android.text.method.LinkMovementMethod; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; +import se.leap.leapclient.R; + +public class AboutFragment extends Fragment { + + public static Fragment newInstance() { + AboutFragment provider_detail_fragment = new AboutFragment(); + return provider_detail_fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View v= inflater.inflate(R.layout.about, container, false); + TextView ver = (TextView) v.findViewById(R.id.version); + + String version; + String name="Openvpn"; + try { + PackageInfo packageinfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0); + version = packageinfo.versionName; + name = getString(R.string.app); + } catch (NameNotFoundException e) { + version = "error fetching version"; + } + + + ver.setText(getString(R.string.version_info,name,version)); + + TextView paypal = (TextView) v.findViewById(R.id.donatestring); + + String donatetext = getActivity().getString(R.string.donatewithpaypal); + Spanned htmltext = Html.fromHtml(donatetext); + paypal.setText(htmltext); + paypal.setMovementMethod(LinkMovementMethod.getInstance()); + + TextView translation = (TextView) v.findViewById(R.id.translation); + + // Don't print a text for myself + if ( getString(R.string.translationby).contains("Arne Schwabe")) + translation.setText(""); + else + translation.setText(R.string.translationby); + return v; + } + +} diff --git a/src/se/leap/leapclient/ConfigurationWizard.java b/src/se/leap/leapclient/ConfigurationWizard.java index d12fdc77..2687b579 100644 --- a/src/se/leap/leapclient/ConfigurationWizard.java +++ b/src/se/leap/leapclient/ConfigurationWizard.java @@ -9,7 +9,6 @@ import org.json.JSONObject; import se.leap.leapclient.ProviderAPIResultReceiver.Receiver; import se.leap.leapclient.ProviderListContent.ProviderItem; import se.leap.leapclient.R; -import se.leap.openvpn.AboutFragment; import se.leap.openvpn.MainActivity; import android.app.Activity; import android.app.DialogFragment; diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java index a429d3b3..1b6b8e38 100644 --- a/src/se/leap/leapclient/Dashboard.java +++ b/src/se/leap/leapclient/Dashboard.java @@ -6,7 +6,6 @@ import org.json.JSONException; import org.json.JSONObject; import se.leap.leapclient.ProviderAPIResultReceiver.Receiver; -import se.leap.openvpn.AboutFragment; import se.leap.openvpn.LogWindow; import se.leap.openvpn.MainActivity; import se.leap.openvpn.OpenVPN; diff --git a/src/se/leap/openvpn/AboutFragment.java b/src/se/leap/openvpn/AboutFragment.java deleted file mode 100644 index 235216ec..00000000 --- a/src/se/leap/openvpn/AboutFragment.java +++ /dev/null @@ -1,65 +0,0 @@ -package se.leap.openvpn; - -import android.app.Fragment; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager.NameNotFoundException; -import android.os.Bundle; -import android.text.Html; -import android.text.Spanned; -import android.text.method.LinkMovementMethod; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; -import se.leap.leapclient.R; - -public class AboutFragment extends Fragment { - - public static Fragment newInstance() { - AboutFragment provider_detail_fragment = new AboutFragment(); - return provider_detail_fragment; - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View v= inflater.inflate(R.layout.about, container, false); - TextView ver = (TextView) v.findViewById(R.id.version); - - String version; - String name="Openvpn"; - try { - PackageInfo packageinfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0); - version = packageinfo.versionName; - name = getString(R.string.app); - } catch (NameNotFoundException e) { - version = "error fetching version"; - } - - - ver.setText(getString(R.string.version_info,name,version)); - - TextView paypal = (TextView) v.findViewById(R.id.donatestring); - - String donatetext = getActivity().getString(R.string.donatewithpaypal); - Spanned htmltext = Html.fromHtml(donatetext); - paypal.setText(htmltext); - paypal.setMovementMethod(LinkMovementMethod.getInstance()); - - TextView translation = (TextView) v.findViewById(R.id.translation); - - // Don't print a text for myself - if ( getString(R.string.translationby).contains("Arne Schwabe")) - translation.setText(""); - else - translation.setText(R.string.translationby); - return v; - } - -} -- cgit v1.2.3 From b358f7883257fdf2c5ca391ce7dcc51ff28f6266 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Thu, 4 Jul 2013 08:41:32 -0600 Subject: Clean up AboutFragment, remove donation text --- res/layout/about.xml | 13 ------------- src/se/leap/leapclient/AboutFragment.java | 7 ------- 2 files changed, 20 deletions(-) diff --git a/res/layout/about.xml b/res/layout/about.xml index 5820d291..366bdcec 100644 --- a/res/layout/about.xml +++ b/res/layout/about.xml @@ -33,19 +33,6 @@ android:autoLink="all" android:text="@string/copyright_guicode" /> - - - - - - Date: Tue, 2 Jul 2013 22:44:27 -0600 Subject: Remove legacy files and scripts that are ics-openvpn specific --- README_icsopenvpn.txt | 43 ----------------------- fetchtranslations.sh | 35 ------------------- genFAQ.py | 96 --------------------------------------------------- todo.txt | 35 ------------------- 4 files changed, 209 deletions(-) delete mode 100644 README_icsopenvpn.txt delete mode 100755 fetchtranslations.sh delete mode 100755 genFAQ.py delete mode 100644 todo.txt diff --git a/README_icsopenvpn.txt b/README_icsopenvpn.txt deleted file mode 100644 index f6690f5a..00000000 --- a/README_icsopenvpn.txt +++ /dev/null @@ -1,43 +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: - -Checkout google breakcode: - -svn co http://google-breakpad.googlecode.com/svn/trunk/ google-breakpad - -- Install sdk -- Install ndk - -Do ./build-native.sh in the root directory of the project. - -Use eclipse with android plugins to build the project. - -Optional: Copy minivpn from lib/ to assets (if you want your own compiled version) - - - - -Starting a VPN by name from an external app: - -public class StartOpenVPNActivity extends Activity { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - - final String EXTRA_NAME = "se.leap.openvpn.shortcutProfileName"; - - Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); - shortcutIntent.setClassName("se.leap.openvpn", "se.leap.openvpn.LaunchVPN"); - shortcutIntent.putExtra(EXTRA_NAME,"upb ssl"); - startActivity(shortcutIntent); - } -} - -or from the shell: - -am start -a android.intent.action.VPNLEGACY -n se.leap.openvpn/.LaunchVPN -e se.leap.openvpn.shortcutProfileName Home - diff --git a/fetchtranslations.sh b/fetchtranslations.sh deleted file mode 100755 index 203a8bcc..00000000 --- a/fetchtranslations.sh +++ /dev/null @@ -1,35 +0,0 @@ -#! /bin/sh - - -if [ "$ICSCROWDAPIKEY" != "" ] -then - echo "Generating new translation archives" - fetch -q -1 -o - http://api.crowdin.net/api/project/ics-openvpn/export?key=$ICSCROWDAPIKEY -fi - -echo "Fetch translation archive" -fetch -q http://crowdin.net/download/project/ics-openvpn.zip - -langtoinclude="ca cs de es et fr id it ja ko no nl ro ru uk" - -for lang in $langtoinclude -do - tar xfv ics-openvpn.zip /res/values-$lang/ -done - -# Chinese language require zh-CN and zh-TW - -for lang in zh-CN zh-TW id -do - if [ $lang = "zh-CN" ] ; then - rlang="zh-rCN" - elif [ $lang = "zh-TW" ] ; then - rlang="zh-rTW" - elif [ $lang = "id" ] ; then - rlang="id" - fi - - echo "Fetch archive for $lang" - fetch http://crowdin.net/download/project/ics-openvpn/$lang.zip - tar -xv -C res/values-$rlang/ --strip-components 3 -f $lang.zip -done \ No newline at end of file diff --git a/genFAQ.py b/genFAQ.py deleted file mode 100755 index 1815f7a2..00000000 --- a/genFAQ.py +++ /dev/null @@ -1,96 +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): - if strid in strres[lang]: - return strres[lang][strid] - else: - return strres["default"][strid] - -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-"): - lang = directory.split("-",1)[1] - 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) - - print lang - 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 a8da2103..00000000 --- a/todo.txt +++ /dev/null @@ -1,35 +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) - -Bugfixes: - - startpath file explorer - - 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 From 2265ab2f534c53de6ea28ca5dfc64a56c5a14403 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 2 Jul 2013 22:46:16 -0600 Subject: Change app\'s VPN notification icon --- res/drawable-hdpi/ic_stat_vpn.png | Bin 682 -> 1272 bytes res/drawable-ldpi/ic_stat_vpn.png | Bin 0 -> 632 bytes res/drawable-mdpi/ic_stat_vpn.png | Bin 468 -> 845 bytes res/drawable-xhdpi/ic_stat_vpn.png | Bin 781 -> 1731 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 res/drawable-ldpi/ic_stat_vpn.png diff --git a/res/drawable-hdpi/ic_stat_vpn.png b/res/drawable-hdpi/ic_stat_vpn.png index 788cbd32..98d60516 100644 Binary files a/res/drawable-hdpi/ic_stat_vpn.png and b/res/drawable-hdpi/ic_stat_vpn.png differ diff --git a/res/drawable-ldpi/ic_stat_vpn.png b/res/drawable-ldpi/ic_stat_vpn.png new file mode 100644 index 00000000..4f0ba1df Binary files /dev/null and b/res/drawable-ldpi/ic_stat_vpn.png differ diff --git a/res/drawable-mdpi/ic_stat_vpn.png b/res/drawable-mdpi/ic_stat_vpn.png index e1dbeb33..e8c99c1c 100644 Binary files a/res/drawable-mdpi/ic_stat_vpn.png and b/res/drawable-mdpi/ic_stat_vpn.png differ diff --git a/res/drawable-xhdpi/ic_stat_vpn.png b/res/drawable-xhdpi/ic_stat_vpn.png index 605d9936..51af141a 100644 Binary files a/res/drawable-xhdpi/ic_stat_vpn.png and b/res/drawable-xhdpi/ic_stat_vpn.png differ -- cgit v1.2.3 From 8addeb2ced0db9979877e51347f076c3bf0b33b2 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Fri, 12 Jul 2013 21:39:20 -0600 Subject: Remove credit for pieces we're not using from About fragment --- res/layout/about.xml | 11 ----------- res/values/untranslatable.xml | 1 - 2 files changed, 12 deletions(-) diff --git a/res/layout/about.xml b/res/layout/about.xml index 366bdcec..3404686b 100644 --- a/res/layout/about.xml +++ b/res/layout/about.xml @@ -74,17 +74,6 @@ android:layout_width="match_parent" android:layout_height="20sp" /> - - - - diff --git a/res/values/untranslatable.xml b/res/values/untranslatable.xml index 79271141..a794866f 100644 --- a/res/values/untranslatable.xml +++ b/res/values/untranslatable.xml @@ -7,7 +7,6 @@ "OpenVPN" is a trademark of OpenVPN Technologies, Inc.\n openvpn.uni-paderborn.de 1194 - File Dialog based on work by Alexander Ponomarev Copyright © 1996 – 2011 Markus Franz Xaver Johannes Oberhumer This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit\n Copyright © 1998-2008 The OpenSSL Project. All rights reserved.\n\n -- cgit v1.2.3