Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
2624706c
Commit
2624706c
authored
May 10, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing repositories
parent
d39d885e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
6 deletions
+43
-6
PolicyDao.kt
...main/java/com/topjohnwu/magisk/data/database/PolicyDao.kt
+0
-1
StringDao.kt
...main/java/com/topjohnwu/magisk/data/database/StringDao.kt
+1
-1
AppRepository.kt
...ava/com/topjohnwu/magisk/data/repository/AppRepository.kt
+15
-0
SettingRepository.kt
...com/topjohnwu/magisk/data/repository/SettingRepository.kt
+11
-0
StringRepository.kt
.../com/topjohnwu/magisk/data/repository/StringRepository.kt
+11
-0
DatabaseModule.kt
app/src/main/java/com/topjohnwu/magisk/di/DatabaseModule.kt
+1
-1
RepositoryModule.kt
...src/main/java/com/topjohnwu/magisk/di/RepositoryModule.kt
+4
-3
No files found.
app/src/main/java/com/topjohnwu/magisk/data/database/PolicyDao.kt
View file @
2624706c
...
@@ -52,7 +52,6 @@ class PolicyDao(
...
@@ -52,7 +52,6 @@ class PolicyDao(
}
}
fun
update
(
policy
:
MagiskPolicy
)
=
query
<
Replace
>
{
fun
update
(
policy
:
MagiskPolicy
)
=
query
<
Replace
>
{
values
(
policy
.
toMap
())
values
(
policy
.
toMap
())
}.
ignoreElement
()
}.
ignoreElement
()
...
...
app/src/main/java/com/topjohnwu/magisk/data/database/String
s
Dao.kt
→
app/src/main/java/com/topjohnwu/magisk/data/database/StringDao.kt
View file @
2624706c
...
@@ -2,7 +2,7 @@ package com.topjohnwu.magisk.data.database
...
@@ -2,7 +2,7 @@ package com.topjohnwu.magisk.data.database
import
com.topjohnwu.magisk.data.database.base.*
import
com.topjohnwu.magisk.data.database.base.*
class
String
s
Dao
:
BaseDao
()
{
class
StringDao
:
BaseDao
()
{
override
val
table
=
DatabaseDefinition
.
Table
.
STRINGS
override
val
table
=
DatabaseDefinition
.
Table
.
STRINGS
...
...
app/src/main/java/com/topjohnwu/magisk/data/repository/AppRepository.kt
0 → 100644
View file @
2624706c
package
com.topjohnwu.magisk.data.repository
import
com.topjohnwu.magisk.data.database.PolicyDao
import
com.topjohnwu.magisk.model.entity.MagiskPolicy
class
AppRepository
(
private
val
policyDao
:
PolicyDao
)
{
fun
deleteOutdated
()
=
policyDao
.
deleteOutdated
()
fun
delete
(
packageName
:
String
)
=
policyDao
.
delete
(
packageName
)
fun
delete
(
uid
:
Int
)
=
policyDao
.
delete
(
uid
)
fun
fetch
(
uid
:
Int
)
=
policyDao
.
fetch
(
uid
)
fun
fetchAll
()
=
policyDao
.
fetchAll
()
fun
update
(
policy
:
MagiskPolicy
)
=
policyDao
.
update
(
policy
)
}
\ No newline at end of file
app/src/main/java/com/topjohnwu/magisk/data/repository/SettingRepository.kt
0 → 100644
View file @
2624706c
package
com.topjohnwu.magisk.data.repository
import
com.topjohnwu.magisk.data.database.SettingsDao
class
SettingRepository
(
private
val
settingsDao
:
SettingsDao
)
{
fun
fetch
(
key
:
String
)
=
settingsDao
.
fetch
(
key
)
fun
put
(
key
:
String
,
value
:
Int
)
=
settingsDao
.
put
(
key
,
value
)
fun
delete
(
key
:
String
)
=
settingsDao
.
delete
(
key
)
}
\ No newline at end of file
app/src/main/java/com/topjohnwu/magisk/data/repository/StringRepository.kt
0 → 100644
View file @
2624706c
package
com.topjohnwu.magisk.data.repository
import
com.topjohnwu.magisk.data.database.StringDao
class
StringRepository
(
private
val
stringDao
:
StringDao
)
{
fun
fetch
(
key
:
String
)
=
stringDao
.
fetch
(
key
)
fun
put
(
key
:
String
,
value
:
String
)
=
stringDao
.
put
(
key
,
value
)
fun
delete
(
key
:
String
)
=
stringDao
.
delete
(
key
)
}
\ No newline at end of file
app/src/main/java/com/topjohnwu/magisk/di/DatabaseModule.kt
View file @
2624706c
...
@@ -13,7 +13,7 @@ val databaseModule = module {
...
@@ -13,7 +13,7 @@ val databaseModule = module {
single
{
LogDao
()
}
single
{
LogDao
()
}
single
{
PolicyDao
(
get
())
}
single
{
PolicyDao
(
get
())
}
single
{
SettingsDao
()
}
single
{
SettingsDao
()
}
single
{
String
s
Dao
()
}
single
{
StringDao
()
}
single
{
createRepositoryDao
(
get
())
}
single
{
createRepositoryDao
(
get
())
}
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/di/RepositoryModule.kt
View file @
2624706c
package
com.topjohnwu.magisk.di
package
com.topjohnwu.magisk.di
import
com.topjohnwu.magisk.data.repository.LogRepository
import
com.topjohnwu.magisk.data.repository.*
import
com.topjohnwu.magisk.data.repository.MagiskRepository
import
com.topjohnwu.magisk.data.repository.ModuleRepository
import
org.koin.dsl.module
import
org.koin.dsl.module
...
@@ -10,4 +8,7 @@ val repositoryModule = module {
...
@@ -10,4 +8,7 @@ val repositoryModule = module {
single
{
MagiskRepository
(
get
(),
get
(),
get
())
}
single
{
MagiskRepository
(
get
(),
get
(),
get
())
}
single
{
ModuleRepository
(
get
(),
get
(),
get
(),
get
())
}
single
{
ModuleRepository
(
get
(),
get
(),
get
(),
get
())
}
single
{
LogRepository
(
get
())
}
single
{
LogRepository
(
get
())
}
single
{
AppRepository
(
get
())
}
single
{
SettingRepository
(
get
())
}
single
{
StringRepository
(
get
())
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment