Skip to content

Commit

Permalink
Issue #62: Prepare Onion Browser advertisement.
Browse files Browse the repository at this point in the history
  • Loading branch information
tladesignz committed Jul 26, 2023
1 parent 7f5b7e9 commit ffea9e8
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Orbot/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>onionhttps</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
19 changes: 17 additions & 2 deletions Orbot/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ class MainViewController: UIViewController {
@IBOutlet weak var logTv: UITextView!


private static let obName = "Onion Browser"

private var obInstalled: Bool {
UIApplication.shared.canOpenURL(URL.obCheckTor)
}


override func viewDidLoad() {
super.viewDidLoad()

Expand Down Expand Up @@ -376,7 +383,6 @@ class MainViewController: UIViewController {
self?.changeExit()
}))


elements.append(UIAction(
title: L10n.settings,
image: UIImage(systemName: "gearshape"),
Expand All @@ -385,6 +391,15 @@ class MainViewController: UIViewController {
}))
elements.last?.accessibilityIdentifier = "settings"

// elements.append(UIMenu(options: .displayInline, children: [UIAction(
// title: obInstalled
// ? String(format: NSLocalizedString("Open %@", comment: "Placeholder is 'Onion Browser'"), Self.obName)
// : String(format: NSLocalizedString("Install %@", comment: "Placeholder is 'Onion Browser'"), Self.obName),
// image: UIImage(systemName: "network.badge.shield.half.filled"),
// handler: { [weak self] _ in
// UIApplication.shared.open(self?.obInstalled ?? false ? URL.obCheckTor : URL.obAppStore)
// })]))

// elements.append(UIAction(
// title: LocalizedString("About", comment: ""),
// image: nil,
Expand All @@ -395,7 +410,7 @@ class MainViewController: UIViewController {

settingsBt?.menu = nil

settingsBt?.menu = UIMenu(title: "", children: elements)
settingsBt?.menu = UIMenu(children: elements)
}


Expand Down
4 changes: 4 additions & 0 deletions Shared/Helpers/URL+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ extension URL {

static var neverSsl = URL(string: "http://neverssl.com")!

static var obCheckTor = URL(string: "onionhttps://check.torproject.org/")!

static var obAppStore = URL(string: "itms-apps://apple.com/app/id519296448")!


var contents: String? {
guard self.isFileURL else {
Expand Down
Binary file modified Shared/ar.lproj/Localizable.strings
Binary file not shown.
6 changes: 6 additions & 0 deletions Shared/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@
/* No comment provided by engineer. */
"Install" = "Installieren";

/* Placeholder is 'Onion Browser' */
"Install %@" = "Install %@";

/* No comment provided by engineer. */
"Install Orbot as a VPN on your device to continue." = "Installiere Orbot auf Deinem Gerät als ein VPN, um weiterzumachen.";

Expand Down Expand Up @@ -433,6 +436,9 @@
/* No comment provided by engineer. */
"Only use these nodes to connect outside the Tor network. You will degrade functionality if you list too few!" = "Nur diese Netzknoten verwenden, um aus dem Tor-Netzwerk hinauszuverbinden. Funktionalität wird eingeschränkt, wenn zu wenige angegeben werden!";

/* Placeholder is 'Onion Browser' */
"Open %@" = "Open %@";

/* No comment provided by engineer. */
"Open or Close Log" = "Log öffnen oder schließen";

Expand Down
6 changes: 6 additions & 0 deletions Shared/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@
/* No comment provided by engineer. */
"Install" = "Install";

/* Placeholder is 'Onion Browser' */
"Install %@" = "Install %@";

/* No comment provided by engineer. */
"Install Orbot as a VPN on your device to continue." = "Install Orbot as a VPN on your device to continue.";

Expand Down Expand Up @@ -433,6 +436,9 @@
/* No comment provided by engineer. */
"Only use these nodes to connect outside the Tor network. You will degrade functionality if you list too few!" = "Only use these nodes to connect outside the Tor network. You will degrade functionality if you list too few!";

/* Placeholder is 'Onion Browser' */
"Open %@" = "Open %@";

/* No comment provided by engineer. */
"Open or Close Log" = "Open or Close Log";

Expand Down
6 changes: 6 additions & 0 deletions Shared/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@
/* No comment provided by engineer. */
"Install" = "Instalar";

/* Placeholder is 'Onion Browser' */
"Install %@" = "Install %@";

/* No comment provided by engineer. */
"Install Orbot as a VPN on your device to continue." = "Instala Orbot como una VPN en tu dispositivo para continuar.";

Expand Down Expand Up @@ -433,6 +436,9 @@
/* No comment provided by engineer. */
"Only use these nodes to connect outside the Tor network. You will degrade functionality if you list too few!" = "Solo usa estos nodos para conectarte fuera de la red Tor. ¡Degradará la funcionalidad si enumeras muy pocos!";

/* Placeholder is 'Onion Browser' */
"Open %@" = "Open %@";

/* No comment provided by engineer. */
"Open or Close Log" = "Abrir o Cerrar Registro";

Expand Down
6 changes: 6 additions & 0 deletions Shared/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@
/* No comment provided by engineer. */
"Install" = "Installer";

/* Placeholder is 'Onion Browser' */
"Install %@" = "Install %@";

/* No comment provided by engineer. */
"Install Orbot as a VPN on your device to continue." = "Install Orbot as a VPN on your device to continue.";

Expand Down Expand Up @@ -433,6 +436,9 @@
/* No comment provided by engineer. */
"Only use these nodes to connect outside the Tor network. You will degrade functionality if you list too few!" = "N’utiliser ces nœuds que pour se connecter à l’extérieur du réseau Tor. La fonctionnalité sera diminuée si vous en indiquez trop peu.";

/* Placeholder is 'Onion Browser' */
"Open %@" = "Open %@";

/* No comment provided by engineer. */
"Open or Close Log" = "Ouvrir ou fermer le journal";

Expand Down
6 changes: 6 additions & 0 deletions Shared/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@
/* No comment provided by engineer. */
"Install" = "Установить";

/* Placeholder is 'Onion Browser' */
"Install %@" = "Install %@";

/* No comment provided by engineer. */
"Install Orbot as a VPN on your device to continue." = "Install Orbot as a VPN on your device to continue.";

Expand Down Expand Up @@ -433,6 +436,9 @@
/* No comment provided by engineer. */
"Only use these nodes to connect outside the Tor network. You will degrade functionality if you list too few!" = "Использовать эти узлы только для подключения вне сети Tor. Вы снизите функциональность, если укажете слишком мало узлов!";

/* Placeholder is 'Onion Browser' */
"Open %@" = "Open %@";

/* No comment provided by engineer. */
"Open or Close Log" = "Открыть или закрыть журнал";

Expand Down
6 changes: 6 additions & 0 deletions Shared/uk.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@
/* No comment provided by engineer. */
"Install" = "Встановити";

/* Placeholder is 'Onion Browser' */
"Install %@" = "Install %@";

/* No comment provided by engineer. */
"Install Orbot as a VPN on your device to continue." = "Install Orbot as a VPN on your device to continue.";

Expand Down Expand Up @@ -433,6 +436,9 @@
/* No comment provided by engineer. */
"Only use these nodes to connect outside the Tor network. You will degrade functionality if you list too few!" = "Використовуйте ці вузли лише для підключення за межами мережі Tor. Ви погіршите функціональність, якщо вкажете занадто мало!";

/* Placeholder is 'Onion Browser' */
"Open %@" = "Open %@";

/* No comment provided by engineer. */
"Open or Close Log" = "Відкрити чи закрити журнал";

Expand Down

0 comments on commit ffea9e8

Please sign in to comment.