Android 8.0+ compatibility - reading WifiConfigStore.xml #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds Android 8.0+ compatibility, and fixes #1 .
Tested on Android 9 with the LineageOS AddonSU.
It reads both the
wpa_supplicant.conf
and theWifiConfigStore.xml
files, if they exist, and merges the result. In the case of duplicate SSIDs theWifiConfigStore.xml
will win - which makes sense, as in the case that both files are present we're probably running on an upgraded device, and then the latter is authoritative because it's the one in use.Anyway, if one doesn't like seeing results from the one or the other, one can just set an invalid path in the settings.
I've also reworked and simplified the
su
wrapper. Assu
can take as a direct argument the command you want to run, spawn a root shell to which to "type" this command over stdin — the way it was done before, inExecuteAsRootBase.java
— is unnecessary. And as now there is no longer a shell involved, the new code is robust with respect to, say, characters in file paths which would previously need to be shell-escaped because the shell would split/interpret the argument otherwise. Actually, as any such escaping wasn't done before inExecuteAsRootBase.java
, the "WPA Supplicant File Path" setting up until now actually used to offer a way to run arbitrary shell commands as root 🦖 — of minor concern, since the user was probably only a confirmation dialog away from popping a root shell on their phone anyway 😄