forked from TeamVanced/VancedManager
-
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.
start migrating packagemanager to di
- Loading branch information
Showing
17 changed files
with
702 additions
and
213 deletions.
There are no files selected for viewing
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
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,25 @@ | ||
package com.vanced.manager.di | ||
|
||
import android.content.Context | ||
import com.vanced.manager.repository.manager.NonrootPackageManager | ||
import com.vanced.manager.repository.manager.RootPackageManager | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.dsl.module | ||
|
||
val managerModule = module { | ||
|
||
fun provideNonrootPackageManager( | ||
context: Context | ||
): NonrootPackageManager { | ||
return NonrootPackageManager( | ||
context = context | ||
) | ||
} | ||
|
||
fun provideRootPackageManager(): RootPackageManager { | ||
return RootPackageManager() | ||
} | ||
|
||
single { provideNonrootPackageManager(androidContext()) } | ||
single { provideRootPackageManager() } | ||
} |
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: 3 additions & 3 deletions
6
app/src/main/java/com/vanced/manager/installer/base/AppInstaller.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,11 +1,11 @@ | ||
package com.vanced.manager.installer.base | ||
|
||
import com.vanced.manager.installer.util.PMRootResult | ||
import com.vanced.manager.repository.manager.PackageManagerResult | ||
|
||
abstract class AppInstaller { | ||
|
||
abstract fun install(appVersions: List<String>?) | ||
abstract suspend fun install(appVersions: List<String>?) | ||
|
||
abstract fun installRoot(appVersions: List<String>?): PMRootResult<Nothing> | ||
abstract suspend fun installRoot(appVersions: List<String>?): PackageManagerResult<Nothing> | ||
|
||
} |
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
Oops, something went wrong.