Skip to content

Commit

Permalink
Added Koin DI
Browse files Browse the repository at this point in the history
  • Loading branch information
n00byara committed Jun 15, 2024
1 parent 9ecedb4 commit afc0f04
Show file tree
Hide file tree
Showing 29 changed files with 161 additions and 346 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

123 changes: 0 additions & 123 deletions .idea/codeStyles/Project.xml

This file was deleted.

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

This file was deleted.

1 change: 0 additions & 1 deletion .idea/gradle.xml

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

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

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
/release
72 changes: 28 additions & 44 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp")
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.ksp)
}

android {
Expand All @@ -10,10 +10,10 @@ android {

defaultConfig {
applicationId = "ru.n00byara.notificationcode"
minSdk = 30
minSdk = 31
targetSdk = 34
versionCode = 1
versionName = "4.0.0"
versionName = "4.0.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -30,17 +30,17 @@ android {
)
}
}
buildFeatures {
buildConfig = true
compose = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
buildConfig = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
Expand All @@ -52,44 +52,28 @@ android {
}

dependencies {
// Xposed
compileOnly(libs.xposed.api)

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

// RootBear
implementation("com.scottyab:rootbeer-lib:0.1.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")
implementation(libs.yuki.hook.api)
ksp(libs.yuki.hook.api.ksp)

// ksp
ksp ("com.highcapable.yukihookapi:ksp-xposed:1.2.0")
// Koin
implementation(libs.koin.android)

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
// AndroidX core
implementation(libs.androidx.core.ktx)

// Tests
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")
// Ui
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.navigation)
implementation(libs.accompanist.drawablepainter)
implementation(libs.accompanist.systemuicontroller)
}

This file was deleted.

9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
<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" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

<application
android:name="com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication"
android:name=".NCApplication"
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"
android:supportsRtl="true"
android:theme="@style/Theme.NotificationCode"
tools:targetApi="31" >

tools:targetApi="31">
<activity
android:name=".ui.activities.SettingsActivity"
android:exported="true"
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/java/ru/n00byara/notificationcode/NCApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ru.n00byara.notificationcode

import com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin

class NCApplication : ModuleApplication() {
override fun onCreate() {
super.onCreate()

startKoin {
androidLogger()
androidContext(this@NCApplication)
modules(appModule)
}
}
}
16 changes: 16 additions & 0 deletions app/src/main/java/ru/n00byara/notificationcode/appModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ru.n00byara.notificationcode

import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module
import ru.n00byara.notificationcode.settings.Settings
import ru.n00byara.notificationcode.ui.viewmodels.ApplicationsScreenViewModel
import ru.n00byara.notificationcode.ui.viewmodels.SettingsActivityViewModel
import ru.n00byara.notificationcode.ui.viewmodels.SettingsScreenViewModel

val appModule = module {
single { Settings() }

viewModel { SettingsActivityViewModel(get()) }
viewModel { SettingsScreenViewModel(get()) }
viewModel { ApplicationsScreenViewModel(get()) }
}
Loading

0 comments on commit afc0f04

Please sign in to comment.