XML entity shows up as "&" instead of "&" after repacking apk

Aperta
#50 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
android, java, xml

Direzione di ricerca

Start by reproducing the report with the supplied app-debug.apk and the listed APKEditor decode and build commands; compare the result with the provided strings.xml source. Trace how the test_string resource is handled during XML decompilation and repacking. Done means the repacked APK displays "Alma" & Körte rather than "Alma" & Körte.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Describe the bug
It appears that APKEditor cannot correctly handle XML entities in resource strings.
String in source code: <string name="test_string">\"Alma\" &amp; Körte</string>.
Expected behaviour: The string should show up as "Alma" & Körte after repacking the apk.
Actual behaviour: The string shows up as "Alma" &amp; Körte after repacking the apk.

To Reproduce
Steps to reproduce the behavior:

  1. Used version '1.2.5'
  2. Operating system 'Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 GNU/Linux'
  3. Commands java -jar APKEditor-1.2.5.jar d -dex -i app-debug.apk and java -jar APKEditor-1.2.5.jar b -i app-debug_decompile_xml -o packed.apk

Log/Stacktrace

Used apk file
app-debug.apk.zip

Additional context
image

Source code for apk (android studio, new project, empty activity)

strings.xml

<resources>
    <string name="app_name">APKEditorTest</string>
    <string name="test_string">\"Alma\" &amp; Körte</string>
</resources>

MainActivity.kt

package com.example.apkeditortest

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.apkeditortest.ui.theme.APKEditorTestTheme

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            APKEditorTestTheme {
                // A surface container using the 'background' color from the theme
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colorScheme.background
                ) {
                    Greeting(getString(R.string.test_string))
                }
            }
        }
    }
}

@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
    Text(
        text = "Hello $name!",
        modifier = modifier
    )
}

@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
    APKEditorTestTheme {
        Greeting("Android")
    }
}
Lingua principale
Java
Stelle
2.3k
Fork
417
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di REAndroid/APKEditor

Tutte le issue di REAndroid/APKEditor

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.