Skip to content

AVD / Apk crashes if dlc url is not 89 characters long #5

Open
@peanutbother

Description

@peanutbother

As I tried to test different servers I encountered the issue where the app randomly crashes when fetching dlcs.
As pointed out on the discord, if the url is padded to a length of 89 characters, the app works like it should.
This seems to indicate an issue with either the native libraries not correctly getting patched of a check in some other function crashing.
This is not consitent on all hardware platforms as some users did not complain about this on their phones or emulators.

Here's the log output for backlog:

rm -rf tappedout; rm -f tsto-patched.apk; ./patch-apk.sh tsto.apk "http://10.0.2.2" "http://10.0.2.2/gameassets///////////////////////////////////////////////////////////////"
I: Using Apktool 2.10.0 on tsto.apk with 8 thread(s).
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Loading resource table...
I: Decoding file-resources...
I: Loading resource table from file: /Users/yuna/Library/apktool/framework/1.apk
I: Decoding values */* XMLs...
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
URL buffer size: 0x5a, URL string size: 0x59
Attempt:  lib/armeabi-v7a/libscorpio-neon.so tappedout/lib/armeabi-v7a/libscorpio-neon.so
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
- offset -   8 9  A B  C D  E F 1011 1213 1415 1617  89ABCDEF01234567
0x002f0c08  6874 7470 3a2f 2f6f 6374 3230 3138 2d34  http://oct2018-4
0x002f0c18  2d33 352d 302d 7561 6d35 6834 3461 2e74  -35-0-uam5h44a.t
0x002f0c28  7374 6f64 6c63 2e65 616d 6f62 696c 652e  stodlc.eamobile.
0x002f0c38  636f 6d2f 6e65 7473 746f 7261 6765 2f67  com/netstorage/g
0x002f0c48  616d 6561 7373 6574 2f64 6972 6563 742f  ameasset/direct/
0x002f0c58  7369 6d70 736f 6e73 2f00                 simpsons/.

            0x011bdaac      5a00a0e3       mov r0, 0x5a                ; 'Z'

            0x011bdadc      5a0085e2       add r0, r5, 0x5a

            0x011bdaf8      5920a0e3       mov r2, 0x59                ; 'Y'

            0x011bdb08      590085e2       add r0, r5, 0x59

- offset -   8 9  A B  C D  E F 1011 1213 1415 1617  89ABCDEF01234567
0x002f0c08  6874 7470 3a2f 2f31 302e 302e 322e 322f  http://10.0.2.2/
0x002f0c18  6761 6d65 6173 7365 7473 2f2f 2f2f 2f2f  gameassets//////
0x002f0c28  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x002f0c38  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x002f0c48  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x002f0c58  2f2f 2f2f 2f2f 2f2f 2f00                 /////////.

            0x011bdaac      5a00a0e3       mov r0, 0x5a                ; 'Z'

            0x011bdadc      5a0085e2       add r0, r5, 0x5a

            0x011bdaf8      5920a0e3       mov r2, 0x59                ; 'Y'

            0x011bdb08      590085e2       add r0, r5, 0x59

Attempt:  lib/armeabi-v7a/libscorpio.so tappedout/lib/armeabi-v7a/libscorpio.so
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
WARN: Unsupported relocation type for imports 2
- offset -   8 9  A B  C D  E F 1011 1213 1415 1617  89ABCDEF01234567
0x00300c08  726f 2d43 2d50 6172 616d 5365 7400 6964  ro-C-ParamSet.id
0x00300c18  2d47 6f73 7432 3831 3437 2d38 392d 4372  -Gost28147-89-Cr
0x00300c28  7970 746f 5072 6f2d 442d 5061 7261 6d53  yptoPro-D-ParamS
0x00300c38  6574 0061 6573 2d31 3932 2d63 636d 0061  et.aes-192-ccm.a
0x00300c48  6573 2d31 3932 2d63 7472 0041 4553 2d32  es-192-ctr.AES-2
0x00300c58  3536 2d43 4243 2d48 4d41                 56-CBC-HMA

            0x011c1398      0070a0e1       mov r7, r0

            0x011c13c8      0080a0e1       mov r8, r0

            0x011c13e4      0400a0e1       mov r0, r4

            0x011c13f4      0600a0e1       mov r0, r6

- offset -   8 9  A B  C D  E F 1011 1213 1415 1617  89ABCDEF01234567
0x00300c08  6874 7470 3a2f 2f31 302e 302e 322e 322f  http://10.0.2.2/
0x00300c18  6761 6d65 6173 7365 7473 2f2f 2f2f 2f2f  gameassets//////
0x00300c28  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00300c38  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00300c48  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00300c58  2f2f 2f2f 2f2f 2f2f 2f41                 /////////A

            0x011c1398      5a00a0e3       mov r0, 0x5a                ; 'Z'

            0x011c13c8      5a0085e2       add r0, r5, 0x5a

            0x011c13e4      5920a0e3       mov r2, 0x59                ; 'Y'

            0x011c13f4      590085e2       add r0, r5, 0x59

Attempt:  lib/arm64-v8a/libscorpio-neon.so tappedout/lib/arm64-v8a/libscorpio-neon.so
- offset -  2728 292A 2B2C 2D2E 2F30 3132 3334 3536  789ABCDEF0123456
0x00373227  6874 7470 3a2f 2f6f 6374 3230 3138 2d34  http://oct2018-4
0x00373237  2d33 352d 302d 7561 6d35 6834 3461 2e74  -35-0-uam5h44a.t
0x00373247  7374 6f64 6c63 2e65 616d 6f62 696c 652e  stodlc.eamobile.
0x00373257  636f 6d2f 6e65 7473 746f 7261 6765 2f67  com/netstorage/g
0x00373267  616d 6561 7373 6574 2f64 6972 6563 742f  ameasset/direct/
0x00373277  7369 6d70 736f 6e73 2f00                 simpsons/.

            0x012cc6fc      400b8052       mov w0, 0x5a                ; 'Z'

            0x012cc72c      09680191       add x9, x0, 0x5a

            0x012cc76c      09640191       add x9, x0, 0x59

- offset -  2728 292A 2B2C 2D2E 2F30 3132 3334 3536  789ABCDEF0123456
0x00373227  6874 7470 3a2f 2f31 302e 302e 322e 322f  http://10.0.2.2/
0x00373237  6761 6d65 6173 7365 7473 2f2f 2f2f 2f2f  gameassets//////
0x00373247  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00373257  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00373267  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00373277  2f2f 2f2f 2f2f 2f2f 2f00                 /////////.

            0x012cc6fc      400b8052       mov w0, 0x5a                ; 'Z'

            0x012cc72c      09680191       add x9, x0, 0x5a

            0x012cc76c      00640191       add x0, x0, 0x59

Attempt:  lib/arm64-v8a/libscorpio.so tappedout/lib/arm64-v8a/libscorpio.so
- offset -  3031 3233 3435 3637 3839 3A3B 3C3D 3E3F  0123456789ABCDEF
0x00373230  6874 7470 3a2f 2f6f 6374 3230 3138 2d34  http://oct2018-4
0x00373240  2d33 352d 302d 7561 6d35 6834 3461 2e74  -35-0-uam5h44a.t
0x00373250  7374 6f64 6c63 2e65 616d 6f62 696c 652e  stodlc.eamobile.
0x00373260  636f 6d2f 6e65 7473 746f 7261 6765 2f67  com/netstorage/g
0x00373270  616d 6561 7373 6574 2f64 6972 6563 742f  ameasset/direct/
0x00373280  7369 6d70 736f 6e73 2f00                 simpsons/.

            0x012cd644      400b8052       mov w0, 0x5a                ; 'Z'

            0x012cd674      09680191       add x9, x0, 0x5a

            0x012cd6b4      09640191       add x9, x0, 0x59

- offset -  3031 3233 3435 3637 3839 3A3B 3C3D 3E3F  0123456789ABCDEF
0x00373230  6874 7470 3a2f 2f31 302e 302e 322e 322f  http://10.0.2.2/
0x00373240  6761 6d65 6173 7365 7473 2f2f 2f2f 2f2f  gameassets//////
0x00373250  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00373260  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00373270  2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f 2f2f  ////////////////
0x00373280  2f2f 2f2f 2f2f 2f2f 2f00                 /////////.

            0x012cd644      400b8052       mov w0, 0x5a                ; 'Z'

            0x012cd674      09680191       add x9, x0, 0x5a

            0x012cd6b4      09640191       add x9, x0, 0x59

Executing `apktool b tappedout -o tsto-patched.apk_prealign`
Executing `zipalign -p -f -v 4 tsto-patched.apk_prealign tsto-patched.apk`
Executing `apksigner sign --ks-key-alias defkeystorealias --ks /Users/yuna/.reltools/buildapp-keystore.jks tsto-patched.apk`
buildapp completed successfully!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions