From 4e5bfa766c51584457c292985de0f29dd8270503 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 6 Jun 2023 15:21:26 +0200 Subject: Use a different singning key for OpenVPN 2 only builds --- .../src/main/java/de/blinkt/openvpn/core/LogItem.java | 19 +++++++++++++++++-- .../main/java/de/blinkt/openvpn/core/VpnStatus.java | 1 + main/src/main/res/values/strings.xml | 3 ++- main/src/ui/res/values-ar/strings.xml | 1 - main/src/ui/res/values-be/strings.xml | 1 - main/src/ui/res/values-ca/strings.xml | 1 - main/src/ui/res/values-cs/strings.xml | 1 - main/src/ui/res/values-da/strings.xml | 1 - main/src/ui/res/values-de/strings.xml | 1 - main/src/ui/res/values-el/strings.xml | 1 - main/src/ui/res/values-es/strings.xml | 1 - main/src/ui/res/values-et/strings.xml | 1 - main/src/ui/res/values-fa/strings.xml | 1 - main/src/ui/res/values-fr/strings.xml | 1 - main/src/ui/res/values-he/strings.xml | 1 - main/src/ui/res/values-hu/strings.xml | 1 - main/src/ui/res/values-in/strings.xml | 1 - main/src/ui/res/values-it/strings.xml | 1 - main/src/ui/res/values-ja/strings.xml | 1 - main/src/ui/res/values-ko/strings.xml | 1 - main/src/ui/res/values-nl/strings.xml | 1 - main/src/ui/res/values-no/strings.xml | 1 - main/src/ui/res/values-pl/strings.xml | 1 - main/src/ui/res/values-pt-rBR/strings.xml | 1 - main/src/ui/res/values-pt/strings.xml | 1 - main/src/ui/res/values-ro/strings.xml | 1 - main/src/ui/res/values-ru/strings.xml | 1 - main/src/ui/res/values-si/strings.xml | 1 - main/src/ui/res/values-sk/strings.xml | 1 - main/src/ui/res/values-sl/strings.xml | 1 - main/src/ui/res/values-sr-rSP/strings.xml | 1 - main/src/ui/res/values-sv/strings.xml | 1 - main/src/ui/res/values-tr/strings.xml | 1 - main/src/ui/res/values-uk/strings.xml | 1 - main/src/ui/res/values-vi/strings.xml | 1 - main/src/ui/res/values-zh-rCN/strings.xml | 1 - main/src/ui/res/values-zh-rTW/strings.xml | 1 - 37 files changed, 20 insertions(+), 37 deletions(-) (limited to 'main/src') diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java index 74601349..b6f51928 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java +++ b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java @@ -13,9 +13,11 @@ import android.content.pm.Signature; import android.content.res.Resources; import android.os.Parcel; import android.os.Parcelable; +import android.text.TextUtils; import java.io.ByteArrayInputStream; import java.io.UnsupportedEncodingException; +import java.lang.reflect.Array; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -28,6 +30,7 @@ import java.util.Arrays; import java.util.FormatFlagsConversionMismatchException; import java.util.Locale; import java.util.UnknownFormatConversionException; +import java.util.Vector; import de.blinkt.openvpn.R; @@ -336,10 +339,15 @@ public class LogItem implements Parcelable { CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate cert = (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(raw.toByteArray())); MessageDigest md = MessageDigest.getInstance("SHA-1"); + MessageDigest mdsha256 = MessageDigest.getInstance("SHA-256"); + byte[] der = cert.getEncoded(); md.update(der); byte[] digest = md.digest(); + mdsha256.update(der); + byte[] digestSha256 = mdsha256.digest(); + if (Arrays.equals(digest, VpnStatus.officalkey)) apksign = c.getString(R.string.official_build); else if (Arrays.equals(digest, VpnStatus.officaldebugkey)) @@ -348,8 +356,15 @@ public class LogItem implements Parcelable { apksign = "amazon version"; else if (Arrays.equals(digest, VpnStatus.fdroidkey)) apksign = "F-Droid built and signed version"; - else - apksign = c.getString(R.string.built_by, cert.getSubjectX500Principal().getName()); + else if (Arrays.equals(digestSha256, VpnStatus.officialO2Key)) + apksign = c.getString(R.string.official_o2build); + else { + Vector hexnums = new Vector<>(); + for (byte b: digestSha256) { + hexnums.add(String.format(Locale.US, "%02x", b)); + } + apksign = c.getString(R.string.built_by, cert.getSubjectX500Principal().getName(), TextUtils.join(":", hexnums)); + } PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0); version = packageinfo.versionName; diff --git a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java index 63e4547d..d1814fc2 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java +++ b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java @@ -190,6 +190,7 @@ public class VpnStatus { static final byte[] officaldebugkey = {-99, -69, 45, 71, 114, -116, 82, 66, -99, -122, 50, -70, -56, -111, 98, -35, -65, 105, 82, 43}; static final byte[] amazonkey = {-116, -115, -118, -89, -116, -112, 120, 55, 79, -8, -119, -23, 106, -114, -85, -56, -4, 105, 26, -57}; static final byte[] fdroidkey = {-92, 111, -42, -46, 123, -96, -60, 79, -27, -31, 49, 103, 11, -54, -68, -27, 17, 2, 121, 104}; + static final byte[] officialO2Key = {-50, -119, -11, 121, 121, 122, -115, 84, 90, -122, 27, -117, -14, 60, 54, 127, 41, -45, 27, 55, -14, 90, 31, 72, -26, -85, -85, 67, 35, 54, 100, 42}; private static ConnectionStatus mLastLevel = ConnectionStatus.LEVEL_NOTCONNECTED; diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml index a83d091b..37145870 100755 --- a/main/src/main/res/values/strings.xml +++ b/main/src/main/res/values/strings.xml @@ -260,9 +260,10 @@ Encryption ciphers Packet authentication Enter packet authentication method - built by %s + built by %1$s (FP: %2$s) debug build official build + official OpenVPN2 only build Copy into profile Crashdump Add diff --git a/main/src/ui/res/values-ar/strings.xml b/main/src/ui/res/values-ar/strings.xml index acc98475..0b622804 100644 --- a/main/src/ui/res/values-ar/strings.xml +++ b/main/src/ui/res/values-ar/strings.xml @@ -259,7 +259,6 @@ خوارزمية التشفير حزمة المصادقة أدخل طريقة مصادقة الحزمة - طوره %s بناء التصحيح البنية الرسمية نسخ إلى الملف الشخصي diff --git a/main/src/ui/res/values-be/strings.xml b/main/src/ui/res/values-be/strings.xml index 5ab837f8..ee7c5e66 100644 --- a/main/src/ui/res/values-be/strings.xml +++ b/main/src/ui/res/values-be/strings.xml @@ -256,7 +256,6 @@ Алгарытм шыфравання Пакет праверкі сапраўднасці Увядзіце метад праверкі сапраўднасці пакетаў - стварыў(-ла) %s зборка для адладкі афіцыйная зборка Скапіяваць у профіль diff --git a/main/src/ui/res/values-ca/strings.xml b/main/src/ui/res/values-ca/strings.xml index 977a9aae..907fa160 100644 --- a/main/src/ui/res/values-ca/strings.xml +++ b/main/src/ui/res/values-ca/strings.xml @@ -157,7 +157,6 @@ Tipus de xifratge Autentificació de paquet Introdueix el mètode de autentificació de paquet - fet per %s Copia al perfil Volcat de fallada Afegeix diff --git a/main/src/ui/res/values-cs/strings.xml b/main/src/ui/res/values-cs/strings.xml index 2d26b8f8..58769658 100644 --- a/main/src/ui/res/values-cs/strings.xml +++ b/main/src/ui/res/values-cs/strings.xml @@ -256,7 +256,6 @@ Šifrovací algoritmus Ověřování paketů Zadej způsob ověřování paketů - sestaveno od %s ladící verze oficiální verze Zkopírovat do profilu diff --git a/main/src/ui/res/values-da/strings.xml b/main/src/ui/res/values-da/strings.xml index 67bdc845..0c0bb216 100644 --- a/main/src/ui/res/values-da/strings.xml +++ b/main/src/ui/res/values-da/strings.xml @@ -259,7 +259,6 @@ Krypteringsstreng Pakkegodkendelse Angiv pakkegodkendelsesmetode - bygget af %s fejlfindingskompilering officiel kompilering Kopiér til profil diff --git a/main/src/ui/res/values-de/strings.xml b/main/src/ui/res/values-de/strings.xml index 85e7882e..3481df90 100644 --- a/main/src/ui/res/values-de/strings.xml +++ b/main/src/ui/res/values-de/strings.xml @@ -261,7 +261,6 @@ Verschlüsselungsalgorithmus Paket-Authentifizierung Geben Sie den Authentifizierungsalgorithmus an - compiliert von %s Testversion offizielle Version In das Profil einbetten diff --git a/main/src/ui/res/values-el/strings.xml b/main/src/ui/res/values-el/strings.xml index 952878bf..2ea2d624 100644 --- a/main/src/ui/res/values-el/strings.xml +++ b/main/src/ui/res/values-el/strings.xml @@ -256,7 +256,6 @@ Κρυπτογράφηση cipher Πιστοποίηση πακέτων Εισάγετε τη μέθοδο πιστοποίησης πακέτων - αναπτύχθηκε από %s build εντοπισμού σφαλμάτων Επίσημη έκδοση Αντιγραφή στο προφίλ diff --git a/main/src/ui/res/values-es/strings.xml b/main/src/ui/res/values-es/strings.xml index d516213b..5c158581 100644 --- a/main/src/ui/res/values-es/strings.xml +++ b/main/src/ui/res/values-es/strings.xml @@ -260,7 +260,6 @@ hacia/de Móvil) Algoritmo de encriptación Autenticación de paquetes Introduzca método de autenticación de paquetes - compilado por %s versión de depuración versión oficial Copiar en perfil diff --git a/main/src/ui/res/values-et/strings.xml b/main/src/ui/res/values-et/strings.xml index 3f89f590..e75be966 100644 --- a/main/src/ui/res/values-et/strings.xml +++ b/main/src/ui/res/values-et/strings.xml @@ -257,7 +257,6 @@ Krüptošiffer Pakettide autentimine Sisestage pakettide autentimismeetod - Kompileerija: %s Silumisversioon Ametlik versioon Kopeeri profiili diff --git a/main/src/ui/res/values-fa/strings.xml b/main/src/ui/res/values-fa/strings.xml index 9a2b3959..efcefc7c 100644 --- a/main/src/ui/res/values-fa/strings.xml +++ b/main/src/ui/res/values-fa/strings.xml @@ -259,7 +259,6 @@ رمزنگاری سری بسته تأیید هویت روش اعتبار سنجی بسته را وارد کنید - ساخته شده توسط %s اشکال زدایی ساخت ساخت رسمی کپی به نمایه diff --git a/main/src/ui/res/values-fr/strings.xml b/main/src/ui/res/values-fr/strings.xml index 51e928db..ed1a04bd 100644 --- a/main/src/ui/res/values-fr/strings.xml +++ b/main/src/ui/res/values-fr/strings.xml @@ -260,7 +260,6 @@ Sur certaines ROM, cette notification joue un son.\nAndroid a introduit ces noti Algorithme de chiffrement Authentification des paquets Méthode d\'authentification des paquets - compilé par %s version de debug version officielle Copier dans le profil diff --git a/main/src/ui/res/values-he/strings.xml b/main/src/ui/res/values-he/strings.xml index 3848baff..bfcde01e 100644 --- a/main/src/ui/res/values-he/strings.xml +++ b/main/src/ui/res/values-he/strings.xml @@ -260,7 +260,6 @@ צופן הצפנה אימות מנות נא למלא את שיטת אימות המנות - נבנה על ידי %s מהדורה לפיתוח מהדורה רשמית העתקה לפרופיל diff --git a/main/src/ui/res/values-hu/strings.xml b/main/src/ui/res/values-hu/strings.xml index 00e862de..9aa23312 100644 --- a/main/src/ui/res/values-hu/strings.xml +++ b/main/src/ui/res/values-hu/strings.xml @@ -259,7 +259,6 @@ Titkosítás rejtjelezés Csomag hitelesítés Adja meg a csomaghitelesítési metódust - %s fordítóval hibakeresési fordítás hivatalos build Másolás profilba diff --git a/main/src/ui/res/values-in/strings.xml b/main/src/ui/res/values-in/strings.xml index 80bffdb1..0a58623b 100644 --- a/main/src/ui/res/values-in/strings.xml +++ b/main/src/ui/res/values-in/strings.xml @@ -259,7 +259,6 @@ Enkripsi sandi Otentikasi paket Masukkan metode otentikasi paket - dibangun oleh %s Pengembangan debug Build Resmi Salin ke profil diff --git a/main/src/ui/res/values-it/strings.xml b/main/src/ui/res/values-it/strings.xml index e76e4159..228a2b99 100644 --- a/main/src/ui/res/values-it/strings.xml +++ b/main/src/ui/res/values-it/strings.xml @@ -260,7 +260,6 @@ Usa il tasto hardware Menù se non è visibile nella GUI. Algoritmo di crittografia Autenticazione pacchetti Seleziona il metodo di autenticazione dei pacchetti - compilato da %s versione di debug versione ufficiale Copia nel profilo diff --git a/main/src/ui/res/values-ja/strings.xml b/main/src/ui/res/values-ja/strings.xml index 67717413..75ab0c39 100644 --- a/main/src/ui/res/values-ja/strings.xml +++ b/main/src/ui/res/values-ja/strings.xml @@ -295,7 +295,6 @@ Android 4.4以上はポリシールーティングを使用します。route/ifc 暗号化方式 パケット認証 パケット認証方式を入力してください。 - %s によりビルドされました デバッグ ビルド 正式ビルド プロファイルにコピー diff --git a/main/src/ui/res/values-ko/strings.xml b/main/src/ui/res/values-ko/strings.xml index 00f6884c..3bacab69 100644 --- a/main/src/ui/res/values-ko/strings.xml +++ b/main/src/ui/res/values-ko/strings.xml @@ -256,7 +256,6 @@ 암호화 알고리즘 패킷 인증 패킷 인증 방법 입력 - %s가 빌드 디버그 빌드 공식 빌드 프로파일에 복사 diff --git a/main/src/ui/res/values-nl/strings.xml b/main/src/ui/res/values-nl/strings.xml index 4bbcd622..dbe1c61f 100644 --- a/main/src/ui/res/values-nl/strings.xml +++ b/main/src/ui/res/values-nl/strings.xml @@ -256,7 +256,6 @@ Encryptiecijfer Packet-authenticatie Voer de methode voor pakketauthenticatie in - gebouwd door %s debug build officiële build Kopieer naar profiel diff --git a/main/src/ui/res/values-no/strings.xml b/main/src/ui/res/values-no/strings.xml index 20ea61df..78893a1b 100644 --- a/main/src/ui/res/values-no/strings.xml +++ b/main/src/ui/res/values-no/strings.xml @@ -237,7 +237,6 @@ Kryptering chiffer Pakkegodkjenning Angi pakkeautentiseringsmetode - bygget av %s avlusings-delversjon offisiell delversjon Kopier til profil diff --git a/main/src/ui/res/values-pl/strings.xml b/main/src/ui/res/values-pl/strings.xml index f089422d..8db0c8dd 100644 --- a/main/src/ui/res/values-pl/strings.xml +++ b/main/src/ui/res/values-pl/strings.xml @@ -259,7 +259,6 @@ Szyfr kodujący Pakiety uwierzytelniania Wpisz metodę uwierzytelniania pakietów - zbudowany przez %s Kompilacja z debugiem Oficjalna kompilacja Skopiuj do profilu diff --git a/main/src/ui/res/values-pt-rBR/strings.xml b/main/src/ui/res/values-pt-rBR/strings.xml index bccd0ee9..c420eb7c 100644 --- a/main/src/ui/res/values-pt-rBR/strings.xml +++ b/main/src/ui/res/values-pt-rBR/strings.xml @@ -259,7 +259,6 @@ Cifra de criptografia Autenticação de pacotes Selecione o método de autenticação de pacotes - compilado por %s compilação de depuração compilação oficial Copiar para o perfil diff --git a/main/src/ui/res/values-pt/strings.xml b/main/src/ui/res/values-pt/strings.xml index 63b9631c..79a1a03e 100644 --- a/main/src/ui/res/values-pt/strings.xml +++ b/main/src/ui/res/values-pt/strings.xml @@ -234,7 +234,6 @@ Cifra de encriptação Autenticação de pacotes Selecione o método de autenticação de pacotes - Feito por %s compilação de debug compilação oficial Copiar para o perfil diff --git a/main/src/ui/res/values-ro/strings.xml b/main/src/ui/res/values-ro/strings.xml index 479a7b01..41745d40 100644 --- a/main/src/ui/res/values-ro/strings.xml +++ b/main/src/ui/res/values-ro/strings.xml @@ -258,7 +258,6 @@ Cifru criptare Autentificare pachete Introduceţi metoda de autentificare de pachete - compilat de %s versiune debug versiune oficială Copiaţi în profil diff --git a/main/src/ui/res/values-ru/strings.xml b/main/src/ui/res/values-ru/strings.xml index 435250d0..8130851c 100644 --- a/main/src/ui/res/values-ru/strings.xml +++ b/main/src/ui/res/values-ru/strings.xml @@ -262,7 +262,6 @@ API VPNService не позволяет указывать сети, которы Коды шифрования Аутентификация пакетов Укажите метод аутентификации пакетов - собрано с помощью %s Отладочная сборка официальная сборка Скопировать в конфигурацию diff --git a/main/src/ui/res/values-si/strings.xml b/main/src/ui/res/values-si/strings.xml index 897372f0..ed83a068 100644 --- a/main/src/ui/res/values-si/strings.xml +++ b/main/src/ui/res/values-si/strings.xml @@ -257,7 +257,6 @@ සංකේතාංකන කේතාංක පැකට් සත්‍යාපනය පැකට් සත්‍යාපන ක්‍රමය ඇතුලත් කරන්න - %sවිසින් ගොඩනගා ඇත නිදොස් ගොඩනැගීම නිල ගොඩනැගීම පැතිකඩට පිටපත් කරන්න diff --git a/main/src/ui/res/values-sk/strings.xml b/main/src/ui/res/values-sk/strings.xml index f9b8b421..8736d924 100644 --- a/main/src/ui/res/values-sk/strings.xml +++ b/main/src/ui/res/values-sk/strings.xml @@ -257,7 +257,6 @@ Šifrovacia šifra autentifikácia paketov Zadajte metódu autentifikácie paketov - zostavené od %s ladiaca verzia oficiálna verzia Skopírovať do profilu diff --git a/main/src/ui/res/values-sl/strings.xml b/main/src/ui/res/values-sl/strings.xml index 94c8bae9..48045339 100644 --- a/main/src/ui/res/values-sl/strings.xml +++ b/main/src/ui/res/values-sl/strings.xml @@ -254,7 +254,6 @@ Šifra Overitev paketov Vnesite način overitve paketov - izgradil %s razhroščevalna izgradnja uradna izgradnja Kopiraj v profil diff --git a/main/src/ui/res/values-sr-rSP/strings.xml b/main/src/ui/res/values-sr-rSP/strings.xml index e438fc3c..cf3aa892 100644 --- a/main/src/ui/res/values-sr-rSP/strings.xml +++ b/main/src/ui/res/values-sr-rSP/strings.xml @@ -257,7 +257,6 @@ Шифровање шифре Аутентификација пакета Унесите начин провјере аутентичности пакета - саградио %s дебуг буилд званична градња Копирајте у профил diff --git a/main/src/ui/res/values-sv/strings.xml b/main/src/ui/res/values-sv/strings.xml index 6fe48fc0..f5c264ce 100644 --- a/main/src/ui/res/values-sv/strings.xml +++ b/main/src/ui/res/values-sv/strings.xml @@ -259,7 +259,6 @@ Krypteringschiffer Paketautentisering Ange autentiseringsmetod för paket - byggd av %s felsöknings bygge officiellt bygge Kopiera till profil diff --git a/main/src/ui/res/values-tr/strings.xml b/main/src/ui/res/values-tr/strings.xml index e81d824c..39f958ed 100644 --- a/main/src/ui/res/values-tr/strings.xml +++ b/main/src/ui/res/values-tr/strings.xml @@ -259,7 +259,6 @@ Şifre şifresi Paket kimlik doğrulaması Paket kimlik doğrulama yöntemini girin - %s tarafından derlendi hata ayıklama yapısı resmi yapı Profile kopyala diff --git a/main/src/ui/res/values-uk/strings.xml b/main/src/ui/res/values-uk/strings.xml index 6db76c81..814435ac 100644 --- a/main/src/ui/res/values-uk/strings.xml +++ b/main/src/ui/res/values-uk/strings.xml @@ -259,7 +259,6 @@ Алгоритм шифрування Пакети автентифікації Введіть метод автентифікації пакетів - побудована по %s відлагоджувальна збірка Офіційна збірка Скопіювати в профіль diff --git a/main/src/ui/res/values-vi/strings.xml b/main/src/ui/res/values-vi/strings.xml index 0dbcbc92..a721c8b8 100644 --- a/main/src/ui/res/values-vi/strings.xml +++ b/main/src/ui/res/values-vi/strings.xml @@ -259,7 +259,6 @@ Mã hóa mật mã Gói xác thực Nhập phương thức xác thực gói - được xây dựng bởi %s bản dựng gỡ lỗi bản dựng chính thức Sao chép vào hồ sơ diff --git a/main/src/ui/res/values-zh-rCN/strings.xml b/main/src/ui/res/values-zh-rCN/strings.xml index e6d30715..894d0687 100644 --- a/main/src/ui/res/values-zh-rCN/strings.xml +++ b/main/src/ui/res/values-zh-rCN/strings.xml @@ -260,7 +260,6 @@ 加密算法(cipher) 数据包验证 输入数据包验证方式 - 由 %s 构建 调试版本 正式版本 复制进配置文件 diff --git a/main/src/ui/res/values-zh-rTW/strings.xml b/main/src/ui/res/values-zh-rTW/strings.xml index 56aaafb4..6b54dc03 100644 --- a/main/src/ui/res/values-zh-rTW/strings.xml +++ b/main/src/ui/res/values-zh-rTW/strings.xml @@ -257,7 +257,6 @@ 加密法 封包驗證 輸入封包驗證方法 - 由 %s 建立 除錯用版本 正式版本 複製到設定檔 -- cgit v1.2.3