Skip to content

Commit

Permalink
Merge pull request #380 from doubleangels/dev
Browse files Browse the repository at this point in the history
Fix broken URL for NextDNS Manager privacy policy
  • Loading branch information
doubleangels authored Jan 24, 2025
2 parents 5284487 + e4ec769 commit f88a819
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 46 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.doubleangels.nextdnsmanagement"
minSdkVersion 32
targetSdk 35
versionCode 241
versionName '5.4.7'
versionCode 242
versionName '5.4.8'
resourceConfigurations += ["en", "zh", "nl", "fi", "fr", "de", "in", "it", "ja", "pl", "pt", "es", "sv", "tr"]
}

Expand All @@ -19,6 +19,7 @@ android {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable true
}
debugSentryOn {
}
Expand Down
84 changes: 47 additions & 37 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,48 +1,58 @@
# Keep all classes in the support libraries
# Keep all classes and methods in your package
-keep class com.doubleangels.nextdnsmanagement.** { *; }
-keepattributes *Annotation*
-dontwarn com.doubleangels.nextdnsmanagement.**

# General ProGuard rules
-dontwarn javax.annotation.**

# AndroidX libraries
-keep class androidx.** { *; }
-dontwarn androidx.**

# Material Design components
-keep class com.google.android.material.** { *; }
-dontwarn com.google.android.material.**

# Webkit
-keep class androidx.webkit.** { *; }
-dontwarn androidx.webkit.**

# Appcompat and Preferences
-keep class androidx.appcompat.** { *; }
-keep class androidx.preference.** { *; }
-keep class com.google.android.material.** { *; }
-dontwarn androidx.appcompat.**
-dontwarn androidx.preference.**

# Keep all classes in other dependencies
# Process Phoenix (Jake Wharton)
-keep class com.jakewharton.processphoenix.** { *; }
-keep class com.squareup.retrofit2.** { *; }
-keep class io.sentry.** { *; }
-keep class org.mozilla.geckoview.** { *; }

# Keep all public and protected methods in the above libraries
-keepclassmembers class androidx.appcompat.** { public protected *; }
-keepclassmembers class androidx.preference.** { public protected *; }
-keepclassmembers class com.google.android.material.** { public protected *; }
-keepclassmembers class com.jakewharton.processphoenix.** { public protected *; }
-keepclassmembers class com.squareup.retrofit2.** { public protected *; }
-keepclassmembers class io.sentry.** { public protected *; }
-keepclassmembers class org.mozilla.geckoview.** { public protected *; }

# Keep the Retrofit interfaces and their methods
-keep interface retrofit2.** { *; }
-keepclassmembers,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}
-dontwarn com.jakewharton.processphoenix.**

# Keep the Gson classes
# Retrofit (Gson Converter)
-keep class com.squareup.retrofit2.** { *; }
-dontwarn com.squareup.retrofit2.**
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.google.gson.** { *; }
-keep class org.apache.commons.** { *; }
-dontwarn com.google.gson.**

# Keep enum types and fields
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# CircleImageView
-keep class de.hdodenhof.circleimageview.** { *; }
-dontwarn de.hdodenhof.circleimageview.**

# Keep the entry point for apps
# Sentry Android
-keep class io.sentry.** { *; }
-dontwarn io.sentry.**
-keepattributes *Annotation*

# LeakCanary (debug only, no need to obfuscate for debug builds)
-dontwarn com.squareup.leakcanary.**
-keep class com.squareup.leakcanary.** { *; }

# General Gson rules
-keepclassmembers class * {
public static void main(java.lang.String[]);
@com.google.gson.annotations.SerializedName <fields>;
}
-keepclassmembers class * {
@com.google.gson.annotations.Expose <fields>;
}

# This is generated automatically by the Android Gradle plugin.
-dontwarn java.beans.BeanInfo
-dontwarn java.beans.FeatureDescriptor
-dontwarn java.beans.IntrospectionException
-dontwarn java.beans.Introspector
-dontwarn java.beans.PropertyDescriptor
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.widget.Toast;

Expand Down Expand Up @@ -89,7 +88,6 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
SwitchPreference sentryEnablePreference = findPreference("sentry_enable");
ListPreference darkModePreference = findPreference("dark_mode");
if (sentryEnablePreference != null) {
Log.d("TEST", sentryEnablePreference.toString());
setupSentryChangeListener(sentryEnablePreference);
}
if (darkModePreference != null) {
Expand Down Expand Up @@ -159,7 +157,7 @@ private void setupButtonForIntent(String buttonKey) {

private void setupDarkModeChangeListener(ListPreference setting) {
setting.setOnPreferenceChangeListener((preference, newValue) -> {
Log.i("Output","Output: " + newValue.toString());
new SentryManager(requireContext()).captureMessage("Dark mode set to" + newValue.toString() + ".");
SharedPreferencesManager.putString("dark_mode", newValue.toString());
ProcessPhoenix.triggerRebirth(requireContext());
return true;
Expand All @@ -169,11 +167,13 @@ private void setupDarkModeChangeListener(ListPreference setting) {
private void setupSentryChangeListener(SwitchPreference switchPreference) {
if (switchPreference != null) {
switchPreference.setOnPreferenceChangeListener((preference, newValue) -> {
new SentryManager(requireContext()).captureMessage("Sentry set to " + newValue.toString() + ".");
boolean isEnabled = (boolean) newValue;
SharedPreferencesManager.putBoolean("sentry_enable", isEnabled);
setPreferenceVisibility("whitelist_domains", isEnabled);
setPreferenceVisibility("whitelist_domain_1_button", isEnabled);
setPreferenceVisibility("whitelist_domain_2_button", isEnabled);
ProcessPhoenix.triggerRebirth(requireContext());
return true;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class SentryManager {

private final Context context;
public String TAG = "NextDNS Manager Logging";
public String TAG = "DebugLogging";
public SharedPreferences sharedPreferences;
public SentryManager(Context context) {
this.context = context;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-night/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<string name="nextdns_status">status</string>
<string name="nextdns_user_agreement_url">https://help.nextdns.io/terms</string>
<string name="ping_url">https://ping.nextdns.io</string>
<string name="privacy_policy_url">https://doubleangels.github.io/privacyPolicy/nextdns.html</string>
<string name="privacy_policy_url">https://doubleangels.github.io/privacypolicy/nextdns.html</string>
<string name="sentry_info_url">https://github.com/getsentry/sentry</string>
<string name="test_url">https://test.nextdns.io</string>
<string name="translate_url">https://poeditor.com/join/project/EupqZ3cGCJ</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<string name="nextdns_status">status</string>
<string name="nextdns_user_agreement_url">https://help.nextdns.io/terms</string>
<string name="ping_url">https://ping.nextdns.io</string>
<string name="privacy_policy_url">https://doubleangels.github.io/privacyPolicy/nextdns.html</string>
<string name="privacy_policy_url">https://doubleangels.github.io/privacypolicy/nextdns.html</string>
<string name="sentry_info_url">https://github.com/getsentry/sentry</string>
<string name="test_url">https://test.nextdns.io</string>
<string name="translate_url">https://poeditor.com/join/project/EupqZ3cGCJ</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<SwitchPreference
app:key="sentry_enable"
app:title="@string/sentry_enable_instructions"
app:defaultValue="false" />
app:defaultValue="true" />
<Preference
app:key="whitelist_domains"
app:summary="@string/whitelist_domains"
Expand Down

0 comments on commit f88a819

Please sign in to comment.