Skip to content

Commit

Permalink
Merge branch 'upstream' mooltipass#9 mooltipass#10
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Rauch committed Mar 6, 2022
2 parents 5e071e0 + 6c64487 commit df63bba
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class SettingsActivity : AppCompatActivity() {

private fun getUrlSubstitutionPolicy(context: Context): SubstitutionPolicy = stringSetting(context, "www_substitution", null)
?.let { UrlSubstitutionPolicies.valueOf(it) }
?: UrlSubstitutionPolicies.Nochange
?: UrlSubstitutionPolicies.RemoveWww
private fun getPackageSubstitutionPolicy(context: Context): SubstitutionPolicy =
PkgSubstitutionPolicies(
booleanSetting(context, "pkg_substitution_reverse", false),
Expand Down
25 changes: 7 additions & 18 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
<resources>
<!-- Reply Preference -->
<string-array name="paranoia_entries">
<item>High</item>
<item>Low</item>
</string-array>

<string-array name="paranoia_values">
<item>high</item>
<item>low</item>
</string-array>

<string-array name="debug_level_entries">
<item>Off</item>
<item>On</item>
Expand All @@ -22,17 +11,17 @@
<item>2</item>
</string-array>
<string-array name="www_substitution_entries">
<item>Do not change subdomain part</item>
<item>Try with www. subdomain first, then without</item>
<item>Try without www. subdomain first, then with</item>
<item>Always add www. subdomain</item>
<item>Always remove www. subdomain</item>
<item>Try without www. subdomain first</item>
<item>Try with www. subdomain first</item>
<item>Always add www. subdomain</item>
<item>Do not change subdomain part</item>
</string-array>
<string-array name="www_substitution_values">
<item>Nochange</item>
<item>PreferWww</item>
<item>RemoveWww</item>
<item>PreferNowww</item>
<item>PreferWww</item>
<item>AddWww</item>
<item>RemoveWww</item>
<item>Nochange</item>
</string-array>
</resources>
3 changes: 1 addition & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
<string name="title_activity_settings">Settings</string>

<!-- Preference Titles -->
<string name="settings_header">Settings</string>
<string name="settings_header">Main Settings</string>

<string name="paranoia_title">Paranoia level</string>
<string name="awareness_title">Mooltipass Device Status</string>
<string name="default_awareness_message">Disconnected</string>

Expand Down
20 changes: 6 additions & 14 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
app:key="test_ping"
app:title="Test Mooltipass Device Connection"
app:summary="Please enable Bluetooth and be sure to have the ble device paired before testing the connection." />
<ListPreference
app:key="security"
app:title="@string/paranoia_title"
app:entries="@array/paranoia_entries"
app:entryValues="@array/paranoia_values"
app:defaultValue="high"
app:enabled="false"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:key="debug_level"
app:title="Debug Output to logcat"
Expand All @@ -43,25 +35,25 @@
app:title="Substitution of www. subdomain part from browser urls"
app:entries="@array/www_substitution_entries"
app:entryValues="@array/www_substitution_values"
app:defaultValue="Nochange"
app:defaultValue="RemoveWww"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>

<PreferenceCategory
app:title="Service Mapping (app names)">
app:title="Service Mapping (apps)">
<SeekBarPreference
app:key="pkg_substitution_max_components"
app:title="Max. package name component count"
app:summary="Cut-off package name after specified amount of components"
app:title="Max. app id component count"
app:summary="Cut-off app ids after specified amount of components"
app:defaultValue="15"
app:showSeekBarValue="true"
app:seekBarIncrement="1"
app:min="2"
android:max="15" />
<SwitchPreference
app:key="pkg_substitution_reverse"
app:title="Reverse package name components of apps"
app:title="Revert components of app ids"
app:defaultValue="false" />
</PreferenceCategory>

</PreferenceScreen>
</PreferenceScreen>

0 comments on commit df63bba

Please sign in to comment.