Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
n00byara committed Apr 9, 2024
1 parent 9bca10b commit b59dccc
Show file tree
Hide file tree
Showing 56 changed files with 1,286 additions and 316 deletions.
123 changes: 123 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 32 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ android {
minSdk = 31
targetSdk = 34
versionCode = 1
versionName = "1.0"
versionName = "2.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
Expand All @@ -29,6 +32,7 @@ android {
}
buildFeatures {
buildConfig = true
compose = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -37,15 +41,40 @@ android {
kotlinOptions {
jvmTarget = "17"
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {

// YukiHook
implementation ("com.highcapable.yukihookapi:api:1.2.0")

// Compose
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
implementation("com.google.accompanist:accompanist-systemuicontroller:0.27.0")
implementation("androidx.navigation:navigation-compose:2.7.7")

// Accompanist drawablepainter
implementation("com.google.accompanist:accompanist-drawablepainter:0.34.0")

// Xposed
compileOnly("de.robv.android.xposed:api:82")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

// ksp
ksp ("com.highcapable.yukihookapi:ksp-xposed:1.2.0")
Expand All @@ -58,4 +87,6 @@ dependencies {
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
}
18 changes: 16 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

<application
android:name="com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.NotificationCode"
tools:targetApi="31" >
<activity
android:name=".ui.activities.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.NotificationCode"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="xposedmodule"
Expand All @@ -21,7 +35,7 @@
android:value="@string/xposed_description" />
<meta-data
android:name="xposedminversion"
android:value="90" />
android:value="93" />
<meta-data
android:name="xposedscope"
android:resource="@array/scope" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/xposed_init
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 app/src/main/java/ru/n00byara/notificationcode/Constants.kt
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"
}
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)
}
}
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)
}
}
Loading

0 comments on commit b59dccc

Please sign in to comment.