Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit a8877af

Browse files
Tweak setup wizard and fix tests
Signed-off-by: androidacy-user <opensource@androidacy.com>
1 parent 414caf3 commit a8877af

File tree

5 files changed

+51
-57
lines changed

5 files changed

+51
-57
lines changed

app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ android {
126126
properties.load(fis)
127127
}
128128
buildConfigField "String", "SENTRY_TOKEN", '"' + properties.getProperty("auth." + "token") + '"'
129+
} else {
130+
buildConfigField "String", "SENTRY_TOKEN", '""'
129131
}
130132

131133
// Repo with ads or tracking feature are disabled by default for the

app/src/main/java/com/fox2code/mmm/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ public void commonNext() {
308308
ExternalHelper.INSTANCE.refreshHelper(this);
309309
this.initMode = false;
310310
// Show an material alert dialog if lastEventId is not "" or null in the private sentry shared preferences
311-
if (MainApplication.isCrashReportingEnabled()) {
311+
//noinspection ConstantConditions
312+
if (MainApplication.isCrashReportingEnabled() && !BuildConfig.SENTRY_TOKEN.isEmpty()) {
312313
SharedPreferences preferences = getSharedPreferences("sentry", MODE_PRIVATE);
313314
String lastExitReason = preferences.getString("lastExitReason", "");
314315
if (BuildConfig.DEBUG) Log.d("NoodleDebug", "Last Exit Reason: " + lastExitReason);

app/src/main/res/layout/setup_box.xml

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:layout_width="match_parent"
4-
android:layout_height="wrap_content"
5-
android:gravity="fill"
6-
android:orientation="vertical"
7-
android:paddingLeft="16dp"
8-
android:paddingRight="16dp"
9-
android:scrollbars="vertical">
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="fill" android:orientation="vertical" android:paddingLeft="20dp" android:paddingRight="20dp" android:scrollbars="vertical">
103

114
<com.google.android.material.textview.MaterialTextView
12-
android:layout_width="match_parent"
5+
android:layout_width="wrap_content"
136
android:layout_height="wrap_content"
14-
android:layout_margin="8dp"
15-
android:text="@string/setup_message"
16-
android:textSize="14sp" />
7+
android:layout_margin="4dp"
8+
android:text="@string/setup_message" />
179

1810
<ScrollView
1911
android:layout_width="match_parent"
@@ -28,80 +20,74 @@
2820
<com.google.android.material.textview.MaterialTextView
2921
android:layout_width="wrap_content"
3022
android:layout_height="wrap_content"
31-
android:layout_marginStart="8dp"
32-
android:layout_marginTop="6dp"
33-
android:layout_marginEnd="8dp"
34-
android:layout_marginBottom="6dp"
23+
android:layout_margin="4dp"
3524
android:text="@string/repos"
36-
android:textSize="18sp" />
25+
android:textAppearance="@android:style/TextAppearance.Material.Headline" />
3726

3827
<com.google.android.material.materialswitch.MaterialSwitch
3928
android:id="@+id/setup_androidacy_repo"
4029
android:layout_width="wrap_content"
4130
android:layout_height="wrap_content"
42-
android:layout_marginStart="8dp"
43-
android:layout_marginEnd="8dp"
44-
android:layout_marginBottom="4dp"
31+
android:layout_margin="4dp"
4532
android:checked="false"
4633
android:key="pref_androidacy_repo_enabled"
4734
android:text="@string/setup_androidacy_repo"
48-
android:textSize="14sp" />
35+
android:textAppearance="@android:style/TextAppearance.Material.Small" />
4936

5037
<com.google.android.material.materialswitch.MaterialSwitch
5138
android:id="@+id/setup_magisk_alt_repo"
5239
android:layout_width="wrap_content"
5340
android:layout_height="wrap_content"
54-
android:layout_marginStart="8dp"
55-
android:layout_marginEnd="8dp"
56-
android:layout_marginBottom="4dp"
41+
android:layout_margin="4dp"
42+
android:text="@string/setup_magisk_alt_repo"
5743
android:checked="false"
5844
android:key="pref_magisk_alt_repo_enabled"
59-
android:text="@string/setup_magisk_alt_repo"
60-
android:textSize="14sp" />
45+
android:textAppearance="@android:style/TextAppearance.Material.Small" />
6146

6247
<com.google.android.material.textview.MaterialTextView
6348
android:layout_width="match_parent"
6449
android:layout_height="wrap_content"
65-
android:layout_marginStart="8dp"
66-
android:layout_marginEnd="8dp"
67-
android:layout_marginBottom="2dp"
68-
android:checked="false"
50+
android:layout_margin="4dp"
6951
android:text="@string/setup_custom_repos"
70-
android:textSize="12sp" />
52+
android:textAppearance="@android:style/TextAppearance.Material.Caption" />
7153

7254
<com.google.android.material.textview.MaterialTextView
7355
android:layout_width="match_parent"
7456
android:layout_height="wrap_content"
75-
android:layout_marginStart="8dp"
76-
android:layout_marginTop="6dp"
77-
android:layout_marginEnd="8dp"
78-
android:layout_marginBottom="6dp"
57+
android:layout_margin="4dp"
7958
android:text="@string/misc"
80-
android:textSize="18sp" />
59+
android:textAppearance="@android:style/TextAppearance.Material.Headline" />
8160

8261
<com.google.android.material.materialswitch.MaterialSwitch
8362
android:id="@+id/setup_crash_reporting"
8463
android:layout_width="wrap_content"
8564
android:layout_height="wrap_content"
86-
android:layout_marginStart="8dp"
87-
android:layout_marginEnd="8dp"
88-
android:layout_marginBottom="4dp"
65+
android:layout_margin="4dp"
8966
android:checked="false"
9067
android:key="pref_crash_reporting_enabled"
9168
android:text="@string/setup_crash_reporting"
92-
android:textSize="14sp" />
69+
android:textAppearance="@android:style/TextAppearance.Material.Small" />
9370

9471
<com.google.android.material.materialswitch.MaterialSwitch
9572
android:id="@+id/setup_background_update_check"
9673
android:layout_width="wrap_content"
9774
android:layout_height="wrap_content"
98-
android:layout_marginStart="8dp"
99-
android:layout_marginEnd="8dp"
100-
android:layout_marginBottom="4dp"
75+
android:layout_margin="4dp"
10176
android:checked="false"
10277
android:key="pref_background_update_check"
10378
android:text="@string/setup_background_update_check"
104-
android:textSize="14sp" />
79+
android:textAppearance="@android:style/TextAppearance.Material.Small" />
80+
81+
<!-- Placeholder for future settings -->
82+
<!--<com.google.android.material.materialswitch.MaterialSwitch
83+
android:id="@+id/setup_app_analytics"
84+
android:layout_width="wrap_content"
85+
android:layout_height="wrap_content"
86+
android:layout_margin="4dp"
87+
android:checked="false"
88+
android:key="pref_app_analytics"
89+
android:textAppearance="@android:style/TextAppearance.Material.Small"
90+
android:text="@string/setup_app_analytics" />-->
10591
</LinearLayout>
10692

10793
</ScrollView>

app/src/main/res/values/strings.xml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<string name="remove_repo">Remove Repo</string>
133133
<string name="custom_url">Custom url</string>
134134
<string name="link_copied">Link copied</string>
135-
<string name="androidacy_repo_info">This repository may display some non-intrusive advertising to cover server and development costs.</string>
135+
<string name="androidacy_repo_info">This repository may display some non-intrusive dvertising to cover server and development costs. Features reviews, automatic virus scans, and more.</string>
136136
<string name="backup_module_list">Backup modules</string>
137137
<string name="restore_module_list">Restore modules</string>
138138
<string name="require_internet">This operation require an internet connection</string>
@@ -222,20 +222,19 @@
222222
<string name="official">Official</string>
223223
<string name="unofficial">Unofficial</string>
224224
<string name="setup_title">First time setup</string>
225-
<string name="setup_message">Welcome! This app will help you install and manage modules
226-
for Magisk. To get started, please select the options below. Everything can be
227-
configured from settings later.</string>
225+
<string name="setup_message">Welcome! This app will help you install and manage Magisk modules. To get started, please select the options below. These and more can be configured from settings later.</string>
228226
<string name="setup_button">Finish setup</string>
229-
<string name="setup_background_update_check">Allow us to check for updates in the background. May use more battery.</string>
230-
<string name="setup_androidacy_repo">Enable the Androidacy repo, which features user reviews, automatic virus scans, fast updates, a wide selection, and is backed by Androidacy.</string>
227+
<string name="setup_background_update_check">Allow us to check for updates in the background.\nThis feature may use more battery.</string>
228+
<string name="setup_androidacy_repo">Enable the Androidacy repo\nIt features user reviews, automatic virus scans, fast updates, a wide selection, and is backed by Androidacy.</string>
231229
<!-- Maybe once alt repo fixes their shit and stops allowing crappy modules or outright
232230
kanged modules, we'll reword this. -->
233-
<string name="setup_magisk_alt_repo">Enable the Magisk Alternative Repo. Significantly more lax
234-
than the original, but at the cost of some safety and privacy. Fully hosted on GitHub
235-
.</string>
236-
<string name="setup_crash_reporting">Enable automatic crash reporting and performance monitoring. Crash reports are anonymized with all personal info removed, and are onlly accessible to the developers. Uses sentry.io.</string>
231+
<string name="setup_magisk_alt_repo">Enable the Magisk Alt Repo\nIt is significantly more lax than the original. Has a lot of modules at the cost of some safety.</string>
232+
<string name="setup_crash_reporting">Enable Sentry crash reporting and performance monitoring.\nAll reports are striclty anonymous and confidential.</string>
237233
<string name="setup_custom_repos">You can add custom repos later in settings.</string>
238234
<string name="repos">Repos</string>
239-
<string name="misc">Misc settings</string>
240-
<string name="setup_button_skip">Skip</string><string name="low_performance_device_dialogue_title">Enabling blur on lower-end device</string><string name="low_performance_device_dialogue_message">You are trying to enable blur on a device that may not perform well with it.\nYou may enable it, but this may lead to a poor user experience and we recommend you don\'t.</string>
235+
<string name="misc">Miscellaneous</string>
236+
<string name="setup_button_skip">Skip</string>
237+
<string name="low_performance_device_dialogue_title">Enabling blur on lower-end device</string>
238+
<string name="low_performance_device_dialogue_message">You are trying to enable blur on a device that may not perform well with it.\nYou may enable it, but this may lead to a poor user experience and we recommend you don\'t.</string>
239+
<string name="alt_repo_info">This repo has less restrictions and reviews, which may lead to lower quality modules. Pretty barebones but has a lot of modules.</string>
241240
</resources>

app/src/main/res/xml/repo_preferences.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@
8686
app:key="pref_magisk_alt_repo_submit"
8787
app:singleLineTitle="false"
8888
app:title="@string/submit_modules" />
89+
<Preference
90+
app:enabled="false"
91+
app:icon="@drawable/ic_baseline_info_24"
92+
app:key="pref_alt_repo_disclaimer"
93+
app:singleLineTitle="false"
94+
app:summary="@string/alt_repo_info" />
8995
</PreferenceCategory>
9096
<PreferenceCategory
9197
app:key="pref_custom_repo_0"

0 commit comments

Comments
 (0)