[Android Apps and Games] Aqq123:
Look. You found the original reason why it stopped working, and a way to fix it. This is the most important part. The rest are just technicalities.

You solved the problem using a tool you're familiar with. That's great. I'm not trying to diminish it.

I shared a way to do the same I believe to be simpler, so it's on me to say what makes it so. Which I can only do by comparing it to your original approach. Namely, no external dependencies, and ~5 lines are faster to look at than 50+ to make sure it's not trying to eat your dog.

In the end it turns out there's a simpler way yet, which involves making an edit to /data/system/packages.xml without the need for uninstalling. Now anyone else facing this issue can choose from the 4 solutions so far: (1) simple reinstall with Package Manager using the -i flag; (2) staged reinstall with Package Manager using the -i flag (for apps w/multiple APKs); (3) your Python script automating (2); (4) an edit to packages.xml bypassing the need to reinstall.

In the end we all benefit from sharing and discussing multiple approaches.

I'm not familiar with Huawei specificially but you might still be able to do it from recovery, as long as you have access to the decrypted /data/ partition.

I'm not really sure what you're getting at. First of all there's no bash anywhere. The shell on Android isn't even bash, and here I'm just using sed (Stream Editor) which has been a part of UN*X since the 1970s and is available on any Android device as part of toybox/toolbox. It's not because "I love bash" (i.e. shell scripting) but because this makes it possible to avoid any external dependencies. Love it or hate it, it's already there. I guess you can say it's out of love for the KISS principle.

Then, the g (global flag) for s/// is there because depending on the Android API version, sometimes there'll also be installInitiator="..." apart from installer="..." so we might want to make more than one replacement (specifically, two). This covers each case.

Or are you criticizing the use of a regular expression to modify an XML file? It's not even a proper regex though, just a simple string match. It could of course fail if the entry were split into multiple lines. But the point is not to make it bulletproof against any XML one can throw at it. The file packages.xml is automatically-generated and predictable enough, it doesn't have newlines where they could become an issue.

If it's something else, then it's really lost on me what you mean. What kind of issues are not possible (or easy) to avoid? I take it you're not opposed to regular expressions in principle, since that's what you used in your script yourself: fix_ing.py:44

installation_id = re.findall(r"\[(\d+)\]", out)[0]

Thank you for the invitation. I think your script is complete though at this point, and you should take full credit for it.

As far as I can tell, the only thing where it could be improved is to make it work on other apps beside pl.ing.mojeing: either by taking the package name from the command line, or checking against a list of known packages that attempt to verify their installation source, and changing it to com.android.vending if it was something else for each of them.

That'd be way past the original scope of the project as I understand it though. And a feature enhancement to Aurora might make it all redundant.

Considering the whole thing is your discovery in the first place, would you like to create an issue on the tracker to bring it to the developers' attention?

Sad to hear but predictable. Of course the bank website can still be accessed from any "rooted" PC I guess, and their app is likely a glorified WebView wrapper... only with "root" detection.