Skip to content

Commit

Permalink
Merge branch 'bmax121:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
anaelle-dev authored Jan 10, 2024
2 parents a1baadc + 9b1cfed commit 81580f7
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ To help translate APatch or improve existing translations, please use [Weblate](
- [常见问题解答](docs/cn/faq_cn.md)
- [常見問題解答](docs/cn_tw/faq_cn_tw.md)
- [Perguntas frequentes](docs/pt_br/faq_pt_br.md)
- [Domande frequenti](docs/it/faq_it.md)
## Credits
Expand Down
28 changes: 26 additions & 2 deletions app/src/main/java/me/bmax/apatch/ui/screen/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.filled.Warning
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.filled.VisibilityOff
import androidx.compose.material.icons.outlined.Block
import androidx.compose.material.icons.outlined.Cached
import androidx.compose.material.icons.outlined.CheckCircle
import androidx.compose.material.icons.outlined.Clear
import androidx.compose.material.icons.outlined.InstallMobile
import androidx.compose.material.icons.outlined.SystemUpdate
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.runtime.livedata.observeAsState
Expand Down Expand Up @@ -345,7 +349,8 @@ private fun KStatusCard(state: APApplication.State) {
when {
!state.equals(APApplication.State.UNKNOWN_STATE) -> {
val kernelPatchVersion = Natives.kerenlPatchVersion()
Column() {
Icon(Icons.Outlined.CheckCircle, stringResource(R.string.home_working))
Column(Modifier.padding(start = 16.dp)) {
Text(text = stringResource(R.string.home_working),
style = MaterialTheme.typography.titleMedium
)
Expand Down Expand Up @@ -374,7 +379,8 @@ private fun KStatusCard(state: APApplication.State) {
}
}
else -> {
Column(Modifier.padding(start = 6.dp)) {
Icon(Icons.Outlined.Block, stringResource(R.string.home_install_unknown))
Column(Modifier.padding(start = 16.dp)) {
Text(text = stringResource(R.string.home_install_unknown),
style = MaterialTheme.typography.titleMedium
)
Expand Down Expand Up @@ -405,8 +411,26 @@ private fun AStatusCard(state: APApplication.State, navigator: DestinationsNavig
modifier = Modifier
.fillMaxWidth()
.padding(10.dp), verticalAlignment = Alignment.CenterVertically) {
when {
state.equals(APApplication.State.KERNELPATCH_READY) -> {
Icon(Icons.Outlined.Block, stringResource(R.string.home_not_installed))
}
state.equals(APApplication.State.ANDROIDPATCH_INSTALLING) -> {
Icon(Icons.Outlined.InstallMobile, stringResource(R.string.home_installing))
}
state.equals(APApplication.State.ANDROIDPATCH_INSTALLED) -> {
Icon(Icons.Outlined.CheckCircle, stringResource(R.string.home_working))
}
state.equals(APApplication.State.ANDROIDPATCH_NEED_UPDATE) -> {
Icon(Icons.Outlined.SystemUpdate, stringResource(R.string.home_need_update))
}
else -> {
Icon(Icons.Outlined.Block, stringResource(R.string.home_install_unknown))
}
}
Column(Modifier
.weight(2f)
.padding(start = 16.dp)
) {
val managerVersion = getManagerVersion()
when {
Expand Down
18 changes: 9 additions & 9 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
<string name="home_not_installed">Not installed</string>
<string name="home_install_unknown">Unknown</string>
<string name="home_click_to_install">Click to install</string>
<string name="home_working">Working</string>
<string name="home_installing">Installing</string>
<string name="home_working">Working</string>
<string name="home_installing">Installing</string>
<string name="home_need_update">New version available</string>
<string name="kpatch_version">Version %d.%d.%d</string>
<string name="apatch_version">Version %s</string>
<string name="apatch_version_update">Version %s %s</string>
<string name="home_su_path">su %s</string>
<string name="home_su_path_ex">su %s %s</string>
<string name="kpatch_shadow_path">kpatch %s %s</string>
<string name="home_apatch_version">APatch %s</string>
<string name="kpatch_version">Version: %d.%d.%d</string>
<string name="apatch_version">Version:\n%s</string>
<string name="apatch_version_update">Version:\n%s -&gt; %s</string>
<string name="home_su_path">su: %s</string>
<string name="home_su_path_ex">su: %s -&gt; %s</string>
<string name="kpatch_shadow_path">kpatch: %s -&gt; %s</string>
<string name="home_apatch_version">APatch: %s</string>
<string name="home_auth_key_title">Enter SuperKey</string>
<string name="home_auth_key_desc">Start after certification</string>

Expand Down
4 changes: 2 additions & 2 deletions docs/en/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ APatch is a root solution similar to Magisk or KernelSU, but APatch offers even

- KernelSU require source. Only boot.img for APatch is enough.

## APatch vs Magisk, KerenlSU
## APatch vs Magisk, KernelSU

- Optionally don't modify SELinux. Root in android app context, no libsu and IPC needed
- **Kernel Patch Module** provided
Expand Down Expand Up @@ -47,4 +47,4 @@ SuperCall can only be successfully invoked when the SuperKey is correct; if the
This is very convenient.
- In addition, APatch directly utilizes magiskpolicy to provide additional SELinux support.
However, only this will be detected as Magisk. Anyone interested can try to bypass it, the issue is already quite clear.


50 changes: 50 additions & 0 deletions docs/it/faq_it.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Domande frequenti

## Cos'è APatch

APatch è una soluzione per il root simile a Magisk o KernelSU, ma offre funzionalità aggiuntive.

## APatch vs Magisk

- Magisk modifica l'init, mentre APatch patcha il kernel Linux.

## APatch vs KernelSU

- KernelSU richiede il codice sorgente del kernel, mentre per APatch è sufficiente solo il file boot.img.

## APatch vs Magisk, KerenlSU

- Opzionalmente, non modifica SELinux.
- Consente di ottenere i permessi di root nel contesto dell'app Android, senza la necessità di libsu e IPC.
- Possibilità di utilizzare **Kernel Patch Module**

## Cos'è un Kernel Patch Module

È del codice eseguito nello spazio del Kernel, simile ai Loadable Kernel Modules (LKM).

Inoltre, KPM fornisce la possibilità di effettuare inline-hook e syscall-table-hook nello spazio del kernel.

[Come scrivere un KPM](https://github.com/bmax121/KernelPatch/blob/main/doc/module.md)

## Relazione tra APatch e KernelPatch

APatch dipende da KernelPatch, eredita tutte le sue capacità ed è stato ampliato.

Puoi installare solo KernelPatch, ma ciò non consentirà l'uso dei moduli Magisk.
Per gestire i permessi di root, è necessario installare AndroidPatch e successivamente disinstallarlo.

[Scopri di più su KernelPatch](https://github.com/bmax121/KernelPatch)

## Cos'è la SuperKey

KernelPatch aggancia le chiamate di sistema per fornire tutte le capacità allo spazio utente, e questa chiamata di sistema è chiamata **SuperCall**.
Invocare SuperCall richiede il passaggio di una credenziale, nota come **SuperKey**.
SuperCall può essere invocato con successo solo quando la SuperKey è corretta; se la SuperKey è errata, chi effettua la chiamata rimane inalterato.

## Riguardo a SELinux

- KernelPatch non modifica il contesto SELinux e bypassa SELinux tramite hook,
consentendo di ottenere i privilegi di root in un thread Android all'interno del contesto dell'app senza la necessità di utilizzare libsu per avviare un nuovo processo e quindi eseguire IPC.
Questo è molto conveniente.
- Inoltre, APatch utilizza direttamente magiskpolicy per fornire ulteriore supporto SELinux.
Tuttavia, solo questo sarà rilevato come Magisk. Chiunque sia interessato può cercare di bypassarlo; il problema è già abbastanza chiaro.

0 comments on commit 81580f7

Please sign in to comment.