Skip to content

Commit

Permalink
Fixed Notification Translate
Browse files Browse the repository at this point in the history
Signed-off-by: Akhil Kedia <akhilkedia94@gmail.com>
  • Loading branch information
akhilkedia committed Dec 29, 2021
1 parent 790da2b commit 0e275ac
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,7 @@ private void changeText(Notification notification, String originalString, String
protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
utils.debugLog("Notification : in notificationhook ");
Notification notification = (Notification) methodHookParam.args[methodHookParam.args.length - 1];
Object[] userDataOut = new Object[3];
userDataOut[0] = methodHookParam;
userDataOut[1] = "";
NotificationHookUserData userDataOut = new NotificationHookUserData(methodHookParam, "");
callOriginalMethod("", userDataOut);

CharSequence[] allNotificationTexts = getAllText(notification);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/akhil/alltrans/PreferenceList.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static void getPref(String globalPref, String localPref, String packageNa
SetHint = (boolean) getValue(gPref, "SetHint", true);
LoadURL = (boolean) getValue(gPref, "LoadURL", true);
DrawText = (boolean) getValue(gPref, "DrawText", false);
Notif = (boolean) getValue(gPref, "Notif", false);
Notif = (boolean) getValue(gPref, "Notif", true);

Caching = (boolean) getValue(gPref, "Cache", true);
Delay = Integer.parseInt((String) getValue(gPref, "Delay", "0"));
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
<string name="webView_summary_on">"Translating Text inside WebView - Safe, May Not Work Always. Turn off to disable."</string>

<!-- notif -->
<string name="notif">"Translate Notifications (Unstable, May Crash)"</string>
<string name="notif">"Translate Notifications"</string>
<string name="notif_summary_off">"Not Translating Text in Notifications. Turn on to enable."</string>
<string name="notif_summary_on">"Translating Text inside Notifications - Unstable, May Crash Apps. Turn off to disable."</string>
<string name="notif_summary_on">"Translating Text inside Notifications - Safe, May sometimes crash apps. Turn off to disable."</string>

<!-- drawText -->
<string name="drawText">"Aggressive Mode"</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/perappprefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
android:title="@string/caching" />
<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="false"
android:defaultValue="true"
android:key="Notif"
android:summaryOff="@string/notif_summary_off"
android:summaryOn="@string/notif_summary_on"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
android:title="@string/webView" />
<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="false"
android:defaultValue="true"
android:key="Notif"
android:summaryOff="@string/notif_summary_off"
android:summaryOn="@string/notif_summary_on"
Expand Down

0 comments on commit 0e275ac

Please sign in to comment.