Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask_android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kwadronaut
bitmask_android
Commits
05205190
Commit
05205190
authored
5 years ago
by
cyberta
Browse files
Options
Downloads
Patches
Plain Diff
fix tethering hint (
#8979
)
parent
e5fab9c5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/se/leap/bitmaskclient/fragments/TetheringDialog.java
+27
-20
27 additions, 20 deletions
...java/se/leap/bitmaskclient/fragments/TetheringDialog.java
app/src/main/res/values/strings.xml
+1
-2
1 addition, 2 deletions
app/src/main/res/values/strings.xml
with
28 additions
and
22 deletions
app/src/main/java/se/leap/bitmaskclient/fragments/TetheringDialog.java
+
27
−
20
View file @
05205190
...
@@ -22,35 +22,37 @@ import android.view.LayoutInflater;
...
@@ -22,35 +22,37 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
java.util.Observable
;
import
java.util.Observer
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
butterknife.ButterKnife
;
import
butterknife.InjectView
;
import
de.blinkt.openvpn.core.VpnStatus
;
import
se.leap.bitmaskclient.R
;
import
se.leap.bitmaskclient.firewall.FirewallManager
;
import
se.leap.bitmaskclient.tethering.TetheringObservable
;
import
se.leap.bitmaskclient.utils.PreferenceHelper
;
import
se.leap.bitmaskclient.views.IconCheckboxEntry
;
/**
/**
* Copyright (c) 2020 LEAP Encryption Access Project and contributers
* Copyright (c) 2020 LEAP Encryption Access Project and contributers
*
*
<p>
* This program is free software: you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* (at your option) any later version.
*
*
<p>
* This program is distributed in the hope that it will be useful,
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* GNU General Public License for more details.
*
*
<p>
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
import
java.util.Observable
;
import
java.util.Observer
;
import
butterknife.ButterKnife
;
import
butterknife.InjectView
;
import
de.blinkt.openvpn.core.VpnStatus
;
import
se.leap.bitmaskclient.R
;
import
se.leap.bitmaskclient.firewall.FirewallManager
;
import
se.leap.bitmaskclient.tethering.TetheringObservable
;
import
se.leap.bitmaskclient.utils.PreferenceHelper
;
import
se.leap.bitmaskclient.views.IconCheckboxEntry
;
public
class
TetheringDialog
extends
AppCompatDialogFragment
implements
Observer
{
public
class
TetheringDialog
extends
AppCompatDialogFragment
implements
Observer
{
public
final
static
String
TAG
=
TetheringDialog
.
class
.
getName
();
public
final
static
String
TAG
=
TetheringDialog
.
class
.
getName
();
...
@@ -191,12 +193,17 @@ public class TetheringDialog extends AppCompatDialogFragment implements Observer
...
@@ -191,12 +193,17 @@ public class TetheringDialog extends AppCompatDialogFragment implements Observer
private
CharSequence
createUserMessage
()
{
private
CharSequence
createUserMessage
()
{
String
tetheringMessage
=
getString
(
R
.
string
.
tethering_message
);
String
tetheringMessage
=
getString
(
R
.
string
.
tethering_message
);
String
systemSettings
=
getString
(
R
.
string
.
tethering_system_settings
);
String
systemSettingsMessage
=
getString
(
R
.
string
.
tethering_enabled_message
);
String
systemSettingsMessage
=
getString
(
R
.
string
.
tethering_enabled_message
,
systemSettings
);
Pattern
pattern
=
Pattern
.
compile
(
"([\\w .]*)(<b>)+([\\w ]*)(</b>)([\\w .]*)"
);
Matcher
matcher
=
pattern
.
matcher
(
systemSettingsMessage
);
int
startIndex
=
0
;
int
endIndex
=
0
;
if
(
matcher
.
matches
())
{
startIndex
=
matcher
.
start
(
2
);
endIndex
=
startIndex
+
matcher
.
group
(
3
).
length
();
}
systemSettingsMessage
=
systemSettingsMessage
.
replace
(
"<b>"
,
""
).
replace
(
"</b>"
,
""
);
String
wholeMessage
=
systemSettingsMessage
+
"\n\n"
+
tetheringMessage
;
String
wholeMessage
=
systemSettingsMessage
+
"\n\n"
+
tetheringMessage
;
int
startIndex
=
wholeMessage
.
indexOf
(
systemSettings
,
0
);
int
endIndex
=
startIndex
+
systemSettings
.
length
();
Spannable
spannable
=
new
SpannableString
(
wholeMessage
);
Spannable
spannable
=
new
SpannableString
(
wholeMessage
);
spannable
.
setSpan
(
new
ClickableSpan
()
{
spannable
.
setSpan
(
new
ClickableSpan
()
{
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
app/src/main/res/values/strings.xml
+
1
−
2
View file @
05205190
...
@@ -111,8 +111,7 @@
...
@@ -111,8 +111,7 @@
<string
name=
"require_root"
>
Requires root permissions
</string>
<string
name=
"require_root"
>
Requires root permissions
</string>
<string
name=
"show_experimental"
>
Show experimental features
</string>
<string
name=
"show_experimental"
>
Show experimental features
</string>
<string
name=
"hide_experimental"
>
Hide experimental features
</string>
<string
name=
"hide_experimental"
>
Hide experimental features
</string>
<string
name=
"tethering_enabled_message"
>
Please make sure to enable tethering in the %s first!
</string>
<string
name=
"tethering_enabled_message"
>
Please make sure to enable tethering in the
<![CDATA[<b>system settings</b>]]>
first.
</string>
<string
name=
"tethering_system_settings"
>
system settings
</string>
<string
name=
"tethering_message"
>
Share your VPN with other devices via:
</string>
<string
name=
"tethering_message"
>
Share your VPN with other devices via:
</string>
<string
name=
"tethering_wifi"
>
Wifi hotspot
</string>
<string
name=
"tethering_wifi"
>
Wifi hotspot
</string>
<string
name=
"tethering_usb"
>
USB tethering
</string>
<string
name=
"tethering_usb"
>
USB tethering
</string>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment