mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-25 10:25:03 +01:00
Added intent to download AdGuard lists
This commit is contained in:
@@ -622,6 +622,7 @@
|
||||
<action android:name="${applicationId}.RULE" />
|
||||
<action android:name="${applicationId}.TEMPLATE" />
|
||||
<action android:name="${applicationId}.DISCONNECT.ME" />
|
||||
<action android:name="${applicationId}.ADGUARD" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
@@ -629,6 +629,7 @@
|
||||
<action android:name="${applicationId}.RULE" />
|
||||
<action android:name="${applicationId}.TEMPLATE" />
|
||||
<action android:name="${applicationId}.DISCONNECT.ME" />
|
||||
<action android:name="${applicationId}.ADGUARD" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
@@ -628,6 +628,7 @@
|
||||
<action android:name="${applicationId}.RULE" />
|
||||
<action android:name="${applicationId}.TEMPLATE" />
|
||||
<action android:name="${applicationId}.DISCONNECT.ME" />
|
||||
<action android:name="${applicationId}.ADGUARD" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
@@ -628,6 +628,7 @@
|
||||
<action android:name="${applicationId}.RULE" />
|
||||
<action android:name="${applicationId}.TEMPLATE" />
|
||||
<action android:name="${applicationId}.DISCONNECT.ME" />
|
||||
<action android:name="${applicationId}.ADGUARD" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
@@ -623,6 +623,7 @@
|
||||
<action android:name="${applicationId}.RULE" />
|
||||
<action android:name="${applicationId}.TEMPLATE" />
|
||||
<action android:name="${applicationId}.DISCONNECT.ME" />
|
||||
<action android:name="${applicationId}.ADGUARD" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ public class ServiceExternal extends ServiceBase {
|
||||
private static final String ACTION_RULE = BuildConfig.APPLICATION_ID + ".RULE";
|
||||
private static final String ACTION_TEMPLATE = BuildConfig.APPLICATION_ID + ".TEMPLATE";
|
||||
private static final String ACTION_DISCONNECT_ME = BuildConfig.APPLICATION_ID + ".DISCONNECT.ME";
|
||||
private static final String ACTION_ADGUARD = BuildConfig.APPLICATION_ID + ".ADGUARD";
|
||||
|
||||
// adb shell am start-foreground-service -a eu.faircode.email.POLL --es account Gmail
|
||||
// adb shell am start-foreground-service -a eu.faircode.email.ENABLE --es account Gmail
|
||||
@@ -62,6 +63,7 @@ public class ServiceExternal extends ServiceBase {
|
||||
// adb shell am start-foreground-service -a eu.faircode.email.RULE --es account Gmail -es rule Test
|
||||
// adb shell am start-foreground-service -a eu.faircode.email.TEMPLATE --es template ... --es identity ... --es to ... --es cc ... --es subject ...
|
||||
// adb shell am start-foreground-service -a eu.faircode.email.DISCONNECT
|
||||
// adb shell am start-foreground-service -a eu.faircode.email.ADGUARD
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
@@ -118,6 +120,9 @@ public class ServiceExternal extends ServiceBase {
|
||||
case ACTION_DISCONNECT_ME:
|
||||
disconnect(context, intent);
|
||||
break;
|
||||
case ACTION_ADGUARD:
|
||||
adguard(context, intent);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException(action);
|
||||
}
|
||||
@@ -330,4 +335,8 @@ public class ServiceExternal extends ServiceBase {
|
||||
private static void disconnect(Context context, Intent intent) throws IOException, JSONException {
|
||||
DisconnectBlacklist.download(context);
|
||||
}
|
||||
|
||||
private static void adguard(Context context, Intent intent) throws IOException, JSONException {
|
||||
Adguard.download(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,6 +622,7 @@
|
||||
<action android:name="${applicationId}.RULE" />
|
||||
<action android:name="${applicationId}.TEMPLATE" />
|
||||
<action android:name="${applicationId}.DISCONNECT.ME" />
|
||||
<action android:name="${applicationId}.ADGUARD" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user