I am making a "force installer" that copies the selected APK to /data/app or /system/app, depending on the user's choice, and fix the permissions and ownership.
However, this leaves one thing - it should be renamed like this: {PACKAGE_NAME}-{1|2}.apk
So I have been searching on how I can extract...