diff --git a/app/build.gradle b/app/build.gradle index a809e86afa5f7a4821fda6d4bab642d849e64780..cb773dcd40c974a98d1b8379be270817d848bde0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -108,6 +108,25 @@ android { //************************************************************************** } + + custom2 { + dimension "branding" + + applicationId "se.leap.calyxvpn" + appName = "Calyx VPN" + resValue "string", "app_name", appName + def customProviderUrl = '"https://calyx.net"' + buildConfigField "String", "customProviderUrl", customProviderUrl + //versionCode 1 + //versionName "0.9.9RC1" + + buildConfigField 'boolean', 'priotize_anonymous_usage', 'false' + + buildConfigField 'String', 'donation_url', '"https://calyxinstitute.org"' + buildConfigField 'boolean', 'enable_donation', 'true' + buildConfigField 'boolean', 'enable_donation_reminder', 'true' + buildConfigField 'int', 'donation_reminder_duration', '30' + } } buildTypes { @@ -434,7 +453,7 @@ def getCurrentFlavor() { task checkApplicationIdForCustomFlavor(type: Exec) { def currFlavor = getCurrentFlavor() - if (currFlavor.contains("custom")) { + if (currFlavor.startsWith("custom")) { android.applicationVariants.all { variant -> def mergedFlavor = variant.mergedFlavor if (variant.flavorName.toString().equalsIgnoreCase(currFlavor) && diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/StartActivityDrawerTest.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/StartActivityDrawerTest.java index 2d3fe6bbc86c69f4b4103f93a247021afb470af0..9f27706572aeb8a5554f061891ef6ac9ce0e265e 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/StartActivityDrawerTest.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/StartActivityDrawerTest.java @@ -135,7 +135,7 @@ public class StartActivityDrawerTest { @Test public void testClickSwitchProvider_closeDrawerAndShowProviderListView() throws InterruptedException { - if (BuildConfig.FLAVOR_branding.equals("custom")) { + if (BuildConfig.FLAVOR_branding.startsWith("custom")) { return; } preferencesEditor.putBoolean("navigation_drawer_learned", true).commit(); @@ -172,7 +172,7 @@ public class StartActivityDrawerTest { } private int getPositionBasedOnFlavor(int custom, int defaultNumber) { - if (BuildConfig.FLAVOR_branding.equals("custom")) { + if (BuildConfig.FLAVOR_branding.starsWith("custom")) { return custom; } else { return defaultNumber; diff --git a/app/src/custom2/assets/calyx.net.json b/app/src/custom2/assets/calyx.net.json new file mode 100644 index 0000000000000000000000000000000000000000..69e1c2a6d3c341c199a9d24157bc2a532552d3f1 --- /dev/null +++ b/app/src/custom2/assets/calyx.net.json @@ -0,0 +1,37 @@ +{ + "api_uri": "https://api.calyx.net:4430", + "api_version": "1", + "ca_cert_fingerprint": "SHA256: 43683c9ba3862c5384a8c1885072fcac40b5d2d4dd67331443f13a3077fa2e69", + "ca_cert_uri": "https://calyx.net/ca.crt", + "default_language": "en", + "description": { + "en": "Calyx Institute privacy focused ISP testbed" + }, + "domain": "calyx.net", + "enrollment_policy": "open", + "languages": [ + "en" + ], + "name": { + "en": "calyx" + }, + "service": { + "allow_anonymous": false, + "allow_free": true, + "allow_limited_bandwidth": false, + "allow_paid": false, + "allow_registration": true, + "allow_unlimited_bandwidth": true, + "bandwidth_limit": 102400, + "default_service_level": 1, + "levels": { + "1": { + "description": "Please donate.", + "name": "free" + } + } + }, + "services": [ + "openvpn" + ] +} \ No newline at end of file diff --git a/app/src/custom2/assets/calyx.net.pem b/app/src/custom2/assets/calyx.net.pem new file mode 100644 index 0000000000000000000000000000000000000000..cedb2e38219fc350e014b6871a45fe65efa34e4d --- /dev/null +++ b/app/src/custom2/assets/calyx.net.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQ0FADBEMQ4wDAYDVQQKDAVjYWx5 +eDEaMBgGA1UECwwRaHR0cHM6Ly9jYWx5eC5uZXQxFjAUBgNVBAMMDWNhbHl4IFJv +b3QgQ0EwHhcNMTMwNzAyMDAwMDAwWhcNMjMwNzAyMDAwMDAwWjBEMQ4wDAYDVQQK +DAVjYWx5eDEaMBgGA1UECwwRaHR0cHM6Ly9jYWx5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+dikSuMoA399f/7BlUIEpVLUiV/emTtbkjFnDeKEV9zql6ypR0BtR8Knf8ALvL +YfMsWLvTe4rXeypzxIaE2pn8ttcXLYAX0ml2MofTi5xcDhMn1vznKIvs82xhncQx +I1MJMWqPHNHgJUJpA+y1IFh5LPbpag9PKQ0yQ9sM+/dyGumF2jElsMw71flh/Txr +2dEv8+FNV1pPK26XJZBK24rNWFs30eAFfH9EQCwVla174I4PDoWqsIR7vtQMObDt +Bq34R3TjjJJIt2sCSlYLooWwiK7Q+d/SgYqA+MSDmmwhzm86ToK6cwbCsvuw1AxR +X6VIs4U8wOotgljzX/CSpKqlxcqZjhnAuelZ1+KiN8RHKPj7AzSLYOv/YwTjLTIq +EOxquoNR58uDa5pBG22a7xWbSaKosn/mEl8SrUr6klzzc8Vh09IMoxrw74uLdAg2 +1jnrhm7qg91Ttb0aXiqbV+Kg/qQzojdewnnoBFnv4jaQ3y8zDCfMhsBtWlWz4Knb +Zqga1WyRm3Gj1j6IV0oOincYMrw5YA7bgXpwop/Lo/mmliMA14ps +-----END CERTIFICATE----- \ No newline at end of file diff --git a/app/src/custom2/res/drawable-land/background_main.png b/app/src/custom2/res/drawable-land/background_main.png new file mode 100644 index 0000000000000000000000000000000000000000..2ba0d85a2e403858f7bd657bb2d2becfa5a9f843 Binary files /dev/null and b/app/src/custom2/res/drawable-land/background_main.png differ diff --git a/app/src/custom2/res/drawable-land/ic_splash_background.png b/app/src/custom2/res/drawable-land/ic_splash_background.png new file mode 100644 index 0000000000000000000000000000000000000000..4caa97e30224b76e65f2d96585f0e6c9fbf29d57 Binary files /dev/null and b/app/src/custom2/res/drawable-land/ic_splash_background.png differ diff --git a/app/src/custom2/res/drawable-ldpi/logo.png b/app/src/custom2/res/drawable-ldpi/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..7e68a603ace3859c8be7d9c79f8e76edea0264fb Binary files /dev/null and b/app/src/custom2/res/drawable-ldpi/logo.png differ diff --git a/app/src/custom2/res/drawable-mdpi/logo.png b/app/src/custom2/res/drawable-mdpi/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..afee9ceac306e918e142602dd424ff0baea15f19 Binary files /dev/null and b/app/src/custom2/res/drawable-mdpi/logo.png differ diff --git a/app/src/custom2/res/drawable-sw600dp-port/background_main.png b/app/src/custom2/res/drawable-sw600dp-port/background_main.png new file mode 100644 index 0000000000000000000000000000000000000000..ea5af855b71fe52bf6b815a5f39d08ab3431e2f4 Binary files /dev/null and b/app/src/custom2/res/drawable-sw600dp-port/background_main.png differ diff --git a/app/src/custom2/res/drawable-sw600dp-port/ic_splash_background.png b/app/src/custom2/res/drawable-sw600dp-port/ic_splash_background.png new file mode 100644 index 0000000000000000000000000000000000000000..ee2f5c3b87591c8d3f0b1f8d0572855c093a1728 Binary files /dev/null and b/app/src/custom2/res/drawable-sw600dp-port/ic_splash_background.png differ diff --git a/app/src/custom2/res/drawable-sw600dp/background_main.png b/app/src/custom2/res/drawable-sw600dp/background_main.png new file mode 100644 index 0000000000000000000000000000000000000000..495c31bf008a8aba97dbf1daff1d75f77c75fe4b Binary files /dev/null and b/app/src/custom2/res/drawable-sw600dp/background_main.png differ diff --git a/app/src/custom2/res/drawable-sw600dp/ic_splash_background.png b/app/src/custom2/res/drawable-sw600dp/ic_splash_background.png new file mode 100644 index 0000000000000000000000000000000000000000..743e5459f258768869d0f7c860ed0945411893f9 Binary files /dev/null and b/app/src/custom2/res/drawable-sw600dp/ic_splash_background.png differ diff --git a/app/src/custom2/res/drawable-xxxhdpi/logo.png b/app/src/custom2/res/drawable-xxxhdpi/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..eba1e819ad0f995ed12fdd027173cd9cfb99ba69 Binary files /dev/null and b/app/src/custom2/res/drawable-xxxhdpi/logo.png differ diff --git a/app/src/custom2/res/drawable/background_drawer.png b/app/src/custom2/res/drawable/background_drawer.png new file mode 100644 index 0000000000000000000000000000000000000000..fc727b1ef6c8f71dfa6e5b77ea2af9960b59355a Binary files /dev/null and b/app/src/custom2/res/drawable/background_drawer.png differ diff --git a/app/src/custom2/res/drawable/background_eip.xml b/app/src/custom2/res/drawable/background_eip.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2364794420239e4cda2605bae97a0ca852c8543 --- /dev/null +++ b/app/src/custom2/res/drawable/background_eip.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ***************************************************** + Background image for the main vpn screem + example: <item android:drawable="@drawable/mybackground" /> + ***************************************************** +--> + +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@drawable/background_main" /> +</layer-list> \ No newline at end of file diff --git a/app/src/custom2/res/drawable/background_main.png b/app/src/custom2/res/drawable/background_main.png new file mode 100644 index 0000000000000000000000000000000000000000..ea5af855b71fe52bf6b815a5f39d08ab3431e2f4 Binary files /dev/null and b/app/src/custom2/res/drawable/background_main.png differ diff --git a/app/src/custom2/res/drawable/donation_img.xml b/app/src/custom2/res/drawable/donation_img.xml new file mode 100644 index 0000000000000000000000000000000000000000..91801baf4095cc83019aa470840d358df079387f --- /dev/null +++ b/app/src/custom2/res/drawable/donation_img.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ***************************************************** + Used to create the image to be shown in the donation popup + example: <item android:drawable="@drawable/mybackground" /> + ***************************************************** +--> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@drawable/logo_square" + android:gravity="fill_horizontal|fill_vertical"/> +</layer-list> diff --git a/app/src/custom2/res/drawable/drawer_logo.xml b/app/src/custom2/res/drawable/drawer_logo.xml new file mode 100644 index 0000000000000000000000000000000000000000..3771c681a59db4b988e28483518abf263861e13f --- /dev/null +++ b/app/src/custom2/res/drawable/drawer_logo.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- + ***************************************************** + Foreground logo for the drawer header + example: <item android:drawable="@drawable/mylogo" /> + ***************************************************** +--> + +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <!-- <item android:drawable="@drawable/logo" /> --> +</layer-list> \ No newline at end of file diff --git a/app/src/custom2/res/drawable/ic_launcher.png b/app/src/custom2/res/drawable/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..33e8d5079a504fe1c1b140535393186db51295f7 Binary files /dev/null and b/app/src/custom2/res/drawable/ic_launcher.png differ diff --git a/app/src/custom2/res/drawable/ic_splash_background.png b/app/src/custom2/res/drawable/ic_splash_background.png new file mode 100644 index 0000000000000000000000000000000000000000..d076f6bf0f737fb2a8eb0c97c2bc091799df9de0 Binary files /dev/null and b/app/src/custom2/res/drawable/ic_splash_background.png differ diff --git a/app/src/custom2/res/drawable/logo_square.png b/app/src/custom2/res/drawable/logo_square.png new file mode 100644 index 0000000000000000000000000000000000000000..62b7b0ad6c068e2ab815907cc17ec0aadbc996f1 Binary files /dev/null and b/app/src/custom2/res/drawable/logo_square.png differ diff --git a/app/src/custom2/res/drawable/splash_page.xml b/app/src/custom2/res/drawable/splash_page.xml new file mode 100644 index 0000000000000000000000000000000000000000..4c72dfe2e7e1dc19a927ecb71cf905fd2c9efa07 --- /dev/null +++ b/app/src/custom2/res/drawable/splash_page.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> + <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + + <!--Replace custom/res/drawable-hdpi/ic_splash_background with background image--> + <!--Replace custom/res/drawable-xhdpi/ic_splash_background with background image--> + <!--Replace custom/res/drawable-xxxhdpi/ic_splash_background with background image--> + <!--Change gravity to best fit background image to screen--> + <item android:drawable="@drawable/ic_splash_background" + android:gravity="fill_horizontal|fill_vertical" /> + + <!--If a foreground image is not need remove this <item> tag--> + <!--<item> --> + <!--Replace custom/res/drawable/logo with foreground image--> + <!--Replace custom/res/drawable-ldpi/logo with foreground image--> + <!--Replace custom/res/drawable-xxxhdpi/logo with foreground image--> + <!--<bitmap + android:src="@drawable/logo" + android:gravity="center" /> --> +<!--</item>--> + +</layer-list> \ No newline at end of file diff --git a/app/src/custom2/res/mipmap-hdpi/ic_launcher.png b/app/src/custom2/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4f5b8a1ecf8d72257a539a0a1e8eeeb4ff631f1a Binary files /dev/null and b/app/src/custom2/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/custom2/res/mipmap-mdpi/ic_launcher.png b/app/src/custom2/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..5ad0035fc0e222c5a51a0d3ef959b9bc012e8c61 Binary files /dev/null and b/app/src/custom2/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/custom2/res/mipmap-xhdpi/ic_launcher.png b/app/src/custom2/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..f138b2f8e3308803e1f582927b157821f10a9d20 Binary files /dev/null and b/app/src/custom2/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/custom2/res/values/custom-theme.xml b/app/src/custom2/res/values/custom-theme.xml new file mode 100644 index 0000000000000000000000000000000000000000..dba399d337a1c04818dc011c2020891ed418b1cd --- /dev/null +++ b/app/src/custom2/res/values/custom-theme.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!--Colors--> + <!--Color of the action bar--> + <color name="colorPrimary">#8ea844</color> + <!--Color of the status bar--> + <color name="colorPrimaryDark">#8ea844</color> + <!--Font color of the action bar title--> + <color name="colorActionBarTitleFont">#ffffff</color> + <!--Font color of the action bar subtitle--> + <color name="colorActionBarSubtitleFont">#cccccc</color> +</resources> diff --git a/app/src/custom2/res/values/strings.xml b/app/src/custom2/res/values/strings.xml new file mode 100644 index 0000000000000000000000000000000000000000..aed5f66f22d313bcc52365c09211104a98eca19e --- /dev/null +++ b/app/src/custom2/res/values/strings.xml @@ -0,0 +1,5 @@ +<?xml version='1.0' encoding='UTF-8'?> +<resources> + <string name="donate_message">Calyx VPN is an easy, fast and secure VPN service from The Calyx Institute Please donate at https://calyxinstitute.org. </string> + <string name="terms_of_service">By using this application you agree to the Terms of Service available at https://calyx.net/terms-of-service. This service is provide as-is, without any warranty and is intended for people who work to make the world a better place.</string> +</resources> \ No newline at end of file diff --git a/app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java b/app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java index 252493713c8b535e5cace745e18ea18099c2f5df..9f8bc707e70a336c6ecca7b8b4f7fd29ea42fb75 100644 --- a/app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/fragments/AboutFragment.java @@ -50,7 +50,7 @@ public class AboutFragment extends Fragment { versionTextView.setText(getString(R.string.version_info, name, version)); - if (BuildConfig.FLAVOR_branding.equals("custom") && hasTermsOfServiceResource()) { + if (BuildConfig.FLAVOR_branding.startsWith("custom") && hasTermsOfServiceResource()) { termsOfService.setText(getString(getTermsOfServiceResource())); termsOfService.setVisibility(VISIBLE); }