Skip to content

Adding the ability to add a key com.google.android.geo.API_KEY to the manifest #87

Open
Grey83 wants to merge 10 commits into
JingMatrix:masterfrom
Grey83:master
Open

Adding the ability to add a key com.google.android.geo.API_KEY to the manifest #87
Grey83 wants to merge 10 commits into
JingMatrix:masterfrom
Grey83:master

Conversation

@Grey83
Copy link
Copy Markdown

@Grey83 Grey83 commented May 25, 2026

Added the ability to add a meta-data field to the AndroidManifest.xml file with the com.google.android.geo.API_KEY parameter and its value, which will need to be specified in the file share/java/src/main/java/org/lsposed/lspatch/share/Constants.java before compiling LSPatch.

To do this, it will be enough to activate the corresponding item in the menu.
This will allow patched applications to work with Google Maps.
Screenshot_2026-05-24-21-24-37-965_org lsposed lspatch

Grey83 added 10 commits May 26, 2026 00:04
Adding the ability to add a key com.google.android.geo.API_KEY to the manifest
Adding the ability to add a key com.google.android.geo.API_KEY to the manifest
Adding the ability to add a key com.google.android.geo.API_KEY to the manifest
Adding the ability to add a key com.google.android.geo.API_KEY to the manifest
Adding the ability to add a key com.google.android.geo.API_KEY to the manifest
Adding the ability to add a key com.google.android.geo.API_KEY to the manifest
Adding the ability to add a key com.google.android.geo.API_KEY to the manifest
Adding the ability to add a key com.google.android.geo.API_KEY to the manifest
Adding information about a new feature.
@Grey83
Copy link
Copy Markdown
Author

Grey83 commented May 25, 2026

Also to lspatch.jar added the new parameters "-g" and "--geoapi".

@HSSkyBoy
Copy link
Copy Markdown

The feature is indeed useful, but the cost is a bit high, isn't it?
This PR can solve the actual problem, but it's not a good general design. Moreover, this method has obvious API key leakage and abuse risks, and it's prone to conflict with existing list files. If it must be adopted, a more reasonable approach is not "specifically support Google Maps API key," but rather to create a more generic "custom list unit data injection."

@Grey83
Copy link
Copy Markdown
Author

Grey83 commented May 28, 2026

I know at least 2 keys that are quite widely used on the Internet for modifications. I assembled a copy of the patcher for myself with just one of these keys.
One could even make a selection from a list, as in the case of choosing to bypass signature verification.

In general, it would be a good option to make it possible for the user of the program to enter the key himself and so that it is then remembered by the program. But I'm not good enough in Java to implement this right now.
Moreover, I did not have such a goal.

It would also be nice to replace the value in meta-data, but ManifestEditor does not do this,
judging by what I saw in the code. You need to add methods for this. Yes, and LSPatch.java simply appends lines to the end of the manifest. And if you try to delete the manifest line with the key using property.addDeleteMetaData("com.google.android.geo.API_KEY");, then this breaks the apk.

@Grey83
Copy link
Copy Markdown
Author

Grey83 commented May 28, 2026

By the way, yesterday I tried using NPatch 1.0.5 and it breaks the apk regardless of the settings, whereas after using LSPath the patched apk works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants