-
Notifications
You must be signed in to change notification settings - Fork 252
Systemless Support #11
base: master
Are you sure you want to change the base?
Conversation
Since SuperSU is now a mandatory requirement, using shell-script-like updater binary should be feasible now, since SuperSU is using this format. All busybox binaries are removed, the new scripts can now be used across all platforms. The script uses a SuperSU 2.67 feature to bind mount systemless images. No more boot image modifications are required now, which simplified the process a lot. This script can also handle both system-based install and systemless install. It will roll back to system mode if: 1. System installed root detected 2. Data available and /data/su.img is not found
Updated scripts to support new scripts introduced in the last commit. Also added new "bundle" mode to create an all-in-one zip file for release. More info please look for ./build.pl --help
Inspired by @romracer, thanks :)
Thanks for your efforts, I really appreciate that you went ahead and discovered the possiblities, when I didn't have the time yet to finalized what I'm already working on. Unfortunately, I'm afraid that this doesn't go into the direction that I'm willing to take, so I don't think I can use most of your commits. In detail:
I had a lot of compatibility problems before switching to my custom BusyBox executable. There are not that many recoveries and I guess all of them use BusyBox anyway, but I expect the ZIP to work on a running system as well. Having a known, reliable shell with all required commands is a big help and I'm not going to give that up.
It was the main reason why I didn't sign ZIPs originally, yes. Could you provide more information about the corrupted headers please? I think it would be even better to port SignAPK to Perl, I might give that a try...
I see no reason for this and it's not possible without the first change anyway.
I'll have a look at this, but I think it should be fine to merge.
Any advantages of integrating it into build.pl? Regarding the systemless support: I currently don't plan to make that flashable in recovery, as Chainfire advised that there's no officially supported way (by him) to mount su.img. I'm still planning to integrate the installation routines into the flash-script.sh, but things like configuration and /data availibility are probably not needed due to this. The detection part would probably be implemented in Java. Nevertheless, I'll certainly go through all your changes and see if I find some inspiration. |
Actually, I think it is a better idea to install systemless Xposed through installer app. The app can have proper busybox, accessible /data, su.img already mounted, su version detection much easier etc. But I'm no expert in Android app developing so I cannot do it myself.
I asked Chainfire how he has achieved signed zip unzipping in all recoveries, he said he used his own tools and didn't give more details. Since the problematic recoveries report header errors in the error messages, I started to investigate with hex comparisons. According to official zip documentations, each file requires a local file header.
After viewing signed zips, the general purpose bit flag has been set to different values.
In some where on the internet I found out that if the zipping process is using stdin and stdout, it will not know the file information when constructing the header, so fields crc-32, compressed I was wondering whether the signing process is something to do with the zip format, or simply just adding the files META-INF/CERT.RSA, META-INF/CERT.SF, META-INF/MANIFEST.MF. After doing some experiments with apks and trying to install them, I found out that it's the latter. Generating the three files are what the signing process actually does. So I simply rezip the zip files in perl, so all headers and the missing fields are back. |
Oh, another good reason for using shell script as flashable zip is that it can be called in rom zips. I know you are not supporting rom devs to include them into roms though :) |
Actually I used Chainfire's script to mount them. The only issue is when data is unavailable (I think this is what CF is concerned about). |
No problem, I'm already working on it. I just don't have much time, so it takes longer than I had hoped.
That, and I think it also adds ZIP comments (which might not be necessary, not sure). Thanks a lot for the information you provided, I'll see if I can change them. As mentioned, prefer even more to avoid SignAPK altogether and just create those three files in Perl. Should be possible.
Isn't this the case for my ZIPs as well? Generally, you should be able to execute any flashable scripts by unzipping its update-binary and calling it with proper options as arguments. |
Actually, the comments might be relevant, maybe even more relevant than the three files: |
What I've done for experiment is I unzipped an APK file and rezip it. |
Are you talking about APKs or flashable ZIP files? |
I have done the research and now I'm sure that repacking the ZIP cannot produce a valid, signed, flashable ZIP file. The three files you mentioned are used for JAR/APK signing, but they're not relevant for flashable ZIP files. Actually, Google has been working on updating SignAPK in the past weeks and they have even removed the JAR/APK signing part for the That means only the ZIP file comment with the stored signature is relevant. It's invisible in usual ZIP file viewers because it contains a NULL character after the "signed by SignApk" string. The important point is that this signature includes the whole file, except obviously the file comment and its length. So even if you copy the file comment to the new file, any bit that is modified in the rest of the file will invalidate the signature. From my point of view, the |
Here apparently osm0sis is explaining how Chainfire sign works: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
B
Hello @rovo89
Here I pull request to support systemless Xposed. I have added many detection and features.
Noticeable updates are: