-
-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #593 from d4rken-org/systemcleaner_filter_imexport
SystemCleaner: Support filter import & export
- Loading branch information
Showing
12 changed files
with
242 additions
and
4 deletions.
There are no files selected for viewing
11 changes: 10 additions & 1 deletion
11
app-common/src/main/java/eu/darken/sdmse/common/UriExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
package eu.darken.sdmse.common | ||
|
||
import android.annotation.SuppressLint | ||
import android.content.Context | ||
import android.net.Uri | ||
import okio.buffer | ||
import okio.source | ||
|
||
fun Uri.dropLastColon(): Uri = Uri.parse(toString().removeSuffix(Uri.encode(":"))) | ||
fun Uri.dropLastColon(): Uri = Uri.parse(toString().removeSuffix(Uri.encode(":"))) | ||
|
||
@SuppressLint("Recycle") | ||
fun Uri.read(context: Context) = context.contentResolver.openInputStream(this)?.source() | ||
|
||
fun Uri.readAsText(context: Context) = read(context)?.buffer()?.readUtf8() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package eu.darken.sdmse.common | ||
|
||
sealed class MimeTypes(val value: String) { | ||
|
||
object Json : MimeTypes("application/json") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
app/src/main/java/eu/darken/sdmse/systemcleaner/core/filter/custom/RawFilter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package eu.darken.sdmse.systemcleaner.core.filter.custom | ||
|
||
data class RawFilter( | ||
val name: String, | ||
val payload: String, | ||
) |
4 changes: 4 additions & 0 deletions
4
...rc/main/java/eu/darken/sdmse/systemcleaner/ui/customfilter/list/CustomFilterListEvents.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
package eu.darken.sdmse.systemcleaner.ui.customfilter.list | ||
|
||
import android.content.Intent | ||
import eu.darken.sdmse.systemcleaner.core.filter.custom.CustomFilterConfig | ||
import eu.darken.sdmse.systemcleaner.core.filter.custom.RawFilter | ||
|
||
sealed class CustomFilterListEvents { | ||
data class UndoRemove(val exclusions: Set<CustomFilterConfig>) : CustomFilterListEvents() | ||
data class ImportEvent(val intent: Intent) : CustomFilterListEvents() | ||
data class ExportEvent(val intent: Intent, val filter: Collection<RawFilter>) : CustomFilterListEvents() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:tint="?attr/colorControlNormal" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2M18 20H6V4H13V9H18V20M16 11V18.1L13.9 16L11.1 18.8L8.3 16L11.1 13.2L8.9 11H16Z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:tint="?attr/colorControlNormal" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M15 11.93V19H7.93L10.05 16.88L7.22 14.05L10.05 11.22L12.88 14.05L15 11.93Z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters