-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
1,286 additions
and
316 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
ru.n00byara.notificationcode.components.hook.Hook_YukiHookXposedInit | ||
ru.n00byara.notificationcode.hook.Hook_YukiHookXposedInit |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/ru/n00byara/notificationcode/Constants.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,10 @@ | ||
package ru.n00byara.notificationcode | ||
|
||
object Constants { | ||
const val HOOK_PACKAGE_NAME = "com.android.systemui" | ||
const val SETTINGS_NAME = "global_settings" | ||
const val APPLICATION_PREF = "application_" | ||
const val SWITCH_CODE = "switch_code" | ||
const val SWITCH_PHONE = "switch_phone" | ||
const val SWITHC_TRACK_NUMBER = "switch_track_number" | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/ru/n00byara/notificationcode/applicationinfo/HookedAppInfo.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,23 @@ | ||
package ru.n00byara.notificationcode.applicationinfo | ||
|
||
import android.content.Context | ||
import android.content.pm.ApplicationInfo | ||
import com.highcapable.yukihookapi.hook.factory.prefs | ||
import com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication | ||
import ru.n00byara.notificationcode.Constants | ||
|
||
class HookedAppInfo(hookedContext: Context) { | ||
val prefs = ModuleApplication().prefs(Constants.SETTINGS_NAME) | ||
val isActive: Boolean | ||
val isSystem: Boolean | ||
val name: String | ||
|
||
init { | ||
val pm = hookedContext.packageManager | ||
val applicationInfo = hookedContext.applicationInfo | ||
|
||
name = applicationInfo.loadLabel(pm).toString() | ||
isSystem = !((applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM) == 0) | ||
isActive = prefs.getBoolean(Constants.APPLICATION_PREF + name) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
app/src/main/java/ru/n00byara/notificationcode/applicationinfo/InstalledAppInfo.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,18 @@ | ||
package ru.n00byara.notificationcode.applicationinfo | ||
|
||
import android.content.pm.ApplicationInfo | ||
import android.content.pm.PackageManager | ||
import android.graphics.drawable.Drawable | ||
|
||
class InstalledAppInfo(private val pm: PackageManager, private val applicationInfo: ApplicationInfo) { | ||
val name: String | ||
val icon: Drawable | ||
val isSystem: Boolean | ||
|
||
init { | ||
name = applicationInfo.loadLabel(pm).toString() | ||
isSystem = !((applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM) == 0) | ||
|
||
icon = applicationInfo.loadIcon(pm) | ||
} | ||
} |
Oops, something went wrong.