Skip to content

[Bug] Can't reinstall app that redeclares permissions of other app signed with the same signature #156

Description

@tomaszk8266

What happened/什么情况

Sounds crazy but it seems that redeclaring other app's permissions is possible when both apps have the same signature. I'm trying to mod GMS (Google Mobile Services) and install patched package with different signature with CorePatch. I'm getting this error:

adb: failed to install gms_decompile_xml_out-aligned-debugSigned.apk: Failure [INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.google.android.gms attempting to redeclare permission com.google.android.providers.gsf.permission.WRITE_GSERVICES already owned by com.google.android.gsf]

It seems that GSF (Google Services Framework) and GMS share some declared permissions, which as already mentioned is allowed because both have the same signature. This seems not to be hooked properly by CorePatch.

Android source reference:
https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/services/core/java/com/android/server/pm/InstallPackageHelper.java;l=1943

LSPosed version/LSPosed 版本

Vector V2.0 (3046) nightly from commit 9350c7c

Android version/Android 版本

17

Version of Core Patch/核心破解版本

1.0 (latest CorePatch N)

Logs/日志

lsposed_logs.zip

Module settings screenshot/模块设置截图

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions