Pergunta

I need to add one value to a hard coded string array in my android app. Unforunately I have lost my hole code, so I decomplied the apk to smali. Can someone show me how I can add an entry between "1D" and "2A" (I added a comment to the code)?

here the Array part of the smali code:

const/4 v1, 0x0

const-string v2, "1A"

aput-object v2, v0, v1

const/4 v1, 0x1

const-string v2, "1B"

aput-object v2, v0, v1

const/4 v1, 0x2

const-string v2, "1C"

aput-object v2, v0, v1

const/4 v1, 0x3

const-string v2, "1D"  //add entry "1E" after this

aput-object v2, v0, v1

const/4 v1, 0x4

const-string v2, "2A"

aput-object v2, v0, v1

const/4 v1, 0x5

const-string v2, "2B"

aput-object v2, v0, v1

const/4 v1, 0x6

const-string v2, "2C"

aput-object v2, v0, v1

const/4 v1, 0x7

const-string v2, "2D"

aput-object v2, v0, v1

const/16 v1, 0x8

const-string v2, "3A"

aput-object v2, v0, v1

const/16 v1, 0x9

const-string v2, "3B"

aput-object v2, v0, v1

const/16 v1, 0xa

const-string v2, "3C"

aput-object v2, v0, v1

const/16 v1, 0xb

const-string v2, "3D"

aput-object v2, v0, v1

const/16 v1, 0xc

const-string v2, "4A"

aput-object v2, v0, v1

const/16 v1, 0xd

const-string v2, "4B"

aput-object v2, v0, v1

const/16 v1, 0xe

const-string v2, "4C"

aput-object v2, v0, v1

const/16 v1, 0xf

const-string v2, "4D"

aput-object v2, v0, v1

const/16 v1, 0x10

const-string v2, "5A"

aput-object v2, v0, v1

const/16 v1, 0x11

const-string v2, "5B"

aput-object v2, v0, v1

const/16 v1, 0x12

const-string v2, "5C"

aput-object v2, v0, v1

const/16 v1, 0x13

const-string v2, "5D"

aput-object v2, v0, v1

const/16 v1, 0x14

const-string v2, "6A"

aput-object v2, v0, v1

const/16 v1, 0x15

const-string v2, "6B"

aput-object v2, v0, v1

const/16 v1, 0x16

const-string v2, "6C"

aput-object v2, v0, v1

const/16 v1, 0x17

const-string v2, "6D"

aput-object v2, v0, v1

const/16 v1, 0x18

const-string v2, "7A"

aput-object v2, v0, v1

const/16 v1, 0x19

const-string v2, "7B"

aput-object v2, v0, v1

const/16 v1, 0x1a

const-string v2, "7C"

aput-object v2, v0, v1

const/16 v1, 0x1b

const-string v2, "7D"

aput-object v2, v0, v1

const/16 v1, 0x1c

const-string v2, "8A"

aput-object v2, v0, v1

const/16 v1, 0x1d

const-string v2, "8B"

aput-object v2, v0, v1

const/16 v1, 0x1e

const-string v2, "8C"

aput-object v2, v0, v1

const/16 v1, 0x1f

const-string v2, "8D"

aput-object v2, v0, v1

Thanks for you help!

Foi útil?

Solução

Sorry for my English

I think you must change line:

new-array v0, [new_size = your_size + 1], [Ljava/lang/String;.

Then you must put lines after comment:

const/4 v1, 0x4

const-string v2, "1E"

aput-object v2, v0, v1

Then increment all value in below lines:

const/4 v1, [value].

For example:

const/4 v1, 0x6 -> const/4 v1, 0x7

const/4 v1, 0x7 -> const/4 v1, 0x8
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top