Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Compare AXML attribute name by resource ID #105

Closed
wants to merge 1 commit into from

Conversation

nonnonstop
Copy link
Contributor

This is porting of WindySha/Xpatch#114.

Issues

  • Due to Fix duplicated attribute problem WindySha/ManifestEditor#6, an AndroidManifest with two appComponentFactory attributes may be created and LSPAppComponentFactoryStub may not be used, causing crash with ClassNotFoundException.
    image
  • For the same reason, the original appComponentFactory name is not saved in assets/lspatch/config.json.
    image

I saw that some obfuscated apk files cause this bug, so I would very much like to fix it. 😫

Steps to reproduce

  1. Download this apk file.
    This apk file has an appfactory class com.example.testapp.MyAppComponentFactory.

  2. Run LSPatch.

    java -jar jar-v0.3.1-327-release.jar -f -v tmp/app-release4.apk
    

    Despite the appfactory class being set, the detailed log shows original appComponentFactory class: null.

  3. View the patched apk with an apk file viewer such as JADX.
    You can see that the aforementioned issues are occurring.

  4. Run the patched apk on the device.
    Then you will get the following error log.
    error.txt

How to fix

Thank you!

@yujincheng08
Copy link
Member

Maybe we should integrate it as a submodule instead.

yujincheng08 added a commit that referenced this pull request Sep 4, 2022
yujincheng08 added a commit that referenced this pull request Sep 4, 2022
@nonnonstop nonnonstop deleted the fix-axml-resid branch September 4, 2022 09:00
@yujincheng08
Copy link
Member

yujincheng08 commented Sep 4, 2022

image

違うみたい

@nonnonstop
Copy link
Contributor Author

assets/new_keystore and assets/public.xml may be missing in the jar.

before

$ unzip -l jar-v0.3.1-327-release.jar | grep assets
        0  2020-01-30 19:10   assets/
     2185  2020-01-28 23:42   assets/new_keystore
   194716  2018-06-14 15:20   assets/public.xml
     2195  2022-08-26 01:22   assets/keystore
        0  2022-08-26 01:48   assets/dex/
     2752  2022-09-04 04:54   assets/dex/loader.dex
   989252  2022-09-04 04:54   assets/dex/lsp.dex
        0  2022-08-26 01:48   assets/so/
        0  2022-08-26 01:48   assets/so/x86/
   213188  2022-09-04 04:54   assets/so/x86/liblspatch.so
        0  2022-08-26 01:48   assets/so/armeabi-v7a/
   131112  2022-09-04 04:54   assets/so/armeabi-v7a/liblspatch.so
        0  2022-08-26 01:48   assets/so/x86_64/
   209448  2022-09-04 04:54   assets/so/x86_64/liblspatch.so
        0  2022-08-26 01:48   assets/so/arm64-v8a/
   173184  2022-09-04 04:54   assets/so/arm64-v8a/liblspatch.so

after

$ unzip -l jar-v0.3.1-328-release.jar | grep assets
        0  2022-09-04 09:27   assets/
     2195  2022-08-26 01:22   assets/keystore
        0  2022-08-26 01:48   assets/dex/
     2752  2022-09-04 09:27   assets/dex/loader.dex
   989252  2022-09-04 09:27   assets/dex/lsp.dex
        0  2022-08-26 01:48   assets/so/
        0  2022-08-26 01:48   assets/so/x86/
   213188  2022-09-04 09:27   assets/so/x86/liblspatch.so
        0  2022-08-26 01:48   assets/so/armeabi-v7a/
   131112  2022-09-04 09:27   assets/so/armeabi-v7a/liblspatch.so
        0  2022-08-26 01:48   assets/so/x86_64/
   209448  2022-09-04 09:27   assets/so/x86_64/liblspatch.so
        0  2022-08-26 01:48   assets/so/arm64-v8a/
   173184  2022-09-04 09:27   assets/so/arm64-v8a/liblspatch.so

@nonnonstop
Copy link
Contributor Author

ok, I fixed it. I will create PR soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants