Skip to content

Commit 95f6e58

Browse files
authored
Merge pull request #10 from kdroidFilter/dev
Add hasUnmodestImage and isPotentiallyDangerous parameters
2 parents c043b42 + 7aed13b commit 95f6e58

File tree

5 files changed

+59
-2
lines changed

5 files changed

+59
-2
lines changed

README.MD

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,51 @@ Both modes block all outbound Internet traffic; the distinction is mainly about
235235
* Pick **`OFFLINE`** for apps that work perfectly without any network so you avoid showing an unnecessary notification.
236236

237237
---
238+
239+
### ⚠️ Optional Flags: Content and Risk Warnings
240+
241+
You can optionally include the following boolean flags in your policy files to help with sensitive app filtering and user awareness:
242+
243+
* **`hasUnmodestImage`**: Set to `true` if the app contains unfiltered, inappropriate or immodest visual content (e.g. uncovered women in media banners, icons, or previews). This indicates that the user must explicitly accept the risk in order to use the app.
244+
245+
* **`isPotentiallyDangerous`**: Set to `true` if the app can pose a technical or security risk, such as remote access tools or apps capable of controlling other devices over open internet connections. This flag helps apply stricter rules or prompt additional warnings.
246+
247+
These fields are optional but enforced by default: apps with these flags will not appear in the store or be granted internet access unless the user has explicitly accepted the associated risk.
248+
249+
Apps marked with either of these flags will only appear in the store or receive internet access **if the user has explicitly acknowledged the risk** and chosen to enable them manually.
250+
251+
---
252+
253+
### 🔄 Example: Risky Applications
254+
255+
#### 1. Bank App with Inappropriate Visuals
256+
257+
```json
258+
{
259+
"type": "Fixed",
260+
"packageName": "com.example.fakebank",
261+
"category": "FINANCE",
262+
"minimumVersionCode": 100,
263+
"hasUnmodestImage": true,
264+
"networkPolicy": {
265+
"mode": "FULL_OPEN"
266+
}
267+
}
268+
```
269+
270+
#### 2. Remote Access Tool
271+
272+
```json
273+
{
274+
"type": "Fixed",
275+
"packageName": "com.example.remotecontrol",
276+
"category": "TOOLS",
277+
"minimumVersionCode": 50,
278+
"isPotentiallyDangerous": true,
279+
"networkPolicy": {
280+
"mode": "FULL_OPEN"
281+
}
282+
}
283+
```
284+
285+
Both of these apps are tagged for additional caution. They will only be functional or visible if the user has agreed to unlock them by accepting the risks.

core/src/commonMain/kotlin/io/github/kdroidfilter/database/core/policies/AppPolicy.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ sealed interface AppPolicy {
99
val packageName: String
1010
val category: AppCategory
1111
val minimumVersionCode: Int
12+
13+
val hasUnmodestImage : Boolean
14+
val isPotentiallyDangerous : Boolean
1215
val detectionRules: List<DetectionRule>
1316
}
1417

core/src/commonMain/kotlin/io/github/kdroidfilter/database/core/policies/FixedPolicy.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ data class FixedPolicy(
1414
override val category: AppCategory,
1515
val networkPolicy: NetworkPolicy,
1616
override val minimumVersionCode: Int,
17+
override val hasUnmodestImage: Boolean = false,
18+
override val isPotentiallyDangerous: Boolean = false,
1719
override val detectionRules: List<DetectionRule> = emptyList()
18-
) : AppPolicy
20+
) : AppPolicy

core/src/commonMain/kotlin/io/github/kdroidfilter/database/core/policies/ModeBasedPolicy.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ data class ModeBasedPolicy(
1515
override val category: AppCategory,
1616
val modePolicies: Map<UserMode, NetworkPolicy>,
1717
override val minimumVersionCode: Int,
18+
override val hasUnmodestImage: Boolean = false,
19+
override val isPotentiallyDangerous: Boolean = false,
1820
override val detectionRules: List<DetectionRule> = emptyList()
19-
) : AppPolicy
21+
) : AppPolicy

core/src/commonMain/kotlin/io/github/kdroidfilter/database/core/policies/MultiModePolicy.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ data class MultiModePolicy(
4040
override val category: AppCategory,
4141
val modeVariants: List<ModeVariants>,
4242
override val minimumVersionCode: Int,
43+
override val hasUnmodestImage: Boolean = false,
44+
override val isPotentiallyDangerous: Boolean = false,
4345
override val detectionRules: List<DetectionRule> = emptyList()
4446
) : AppPolicy {
4547

0 commit comments

Comments
 (0)