Patch AndroidManifest.xml properly

Parse and rebuild the string pool of the AXML format for patching
string in AndroidManifest.xml
This commit is contained in:
topjohnwu
2020-08-31 03:39:20 -07:00
parent 38a34a7eeb
commit fbaf2bded6
6 changed files with 167 additions and 48 deletions
@@ -11,6 +11,7 @@ import com.topjohnwu.magisk.core.Config
import com.topjohnwu.magisk.core.Const
import com.topjohnwu.magisk.core.Info
import com.topjohnwu.magisk.core.UpdateCheckService
import com.topjohnwu.magisk.core.tasks.PatchAPK
import com.topjohnwu.magisk.core.utils.BiometricHelper
import com.topjohnwu.magisk.core.utils.MediaStoreUtils
import com.topjohnwu.magisk.core.utils.availableLocales
@@ -88,9 +89,12 @@ object Hide : BaseSettingsItem.Input() {
var result = "Manager"
set(value) = set(value, field, { field = it }, BR.result, BR.error)
val maxLength
get() = PatchAPK.MAX_LABEL_LENGTH
@get:Bindable
val isError
get() = result.length > 14 || result.isBlank()
get() = result.length > maxLength || result.isBlank()
override fun getView(context: Context) = DialogSettingsAppNameBinding
.inflate(LayoutInflater.from(context)).also { it.data = this }.root
@@ -19,7 +19,7 @@ import com.topjohnwu.magisk.core.download.Action
import com.topjohnwu.magisk.core.download.DownloadService
import com.topjohnwu.magisk.core.download.Subject
import com.topjohnwu.magisk.core.isRunningAsStub
import com.topjohnwu.magisk.core.utils.PatchAPK
import com.topjohnwu.magisk.core.tasks.PatchAPK
import com.topjohnwu.magisk.data.database.RepoDao
import com.topjohnwu.magisk.events.AddHomeIconEvent
import com.topjohnwu.magisk.events.RecreateEvent