User build Pixel XL: cannot install apps with F-Droid #648

Closed
Rudd-O opened this Issue Jun 26, 2017 · 15 comments

Comments

Projects
None yet
2 participants
@Rudd-O

Rudd-O commented Jun 26, 2017

Errors out with "The privileged permissions have not been granted to the extension."

Ghost commander install attempted. Other apps fail in the same way.

I followed the build and install instructions to the letter.

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Jun 26, 2017

Contributor

You'll need to modify packages/apps/F-Droid/privileged-extension/app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java to include your keys. I haven't had time to write documentation on how to do that or to make it automated.

Contributor

thestinger commented Jun 26, 2017

You'll need to modify packages/apps/F-Droid/privileged-extension/app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java to include your keys. I haven't had time to write documentation on how to do that or to make it automated.

@Rudd-O

This comment has been minimized.

Show comment Hide comment
@Rudd-O

Rudd-O Jun 26, 2017

That at least should be added to the instructions, because the instructions by default do not mention it, and the result OS does not work as advertised. Ideally, this is done already and there's no need for instructions, just a footnote in the building docs.

Rudd-O commented Jun 26, 2017

That at least should be added to the instructions, because the instructions by default do not mention it, and the result OS does not work as advertised. Ideally, this is done already and there's no need for instructions, just a footnote in the building docs.

@Rudd-O

This comment has been minimized.

Show comment Hide comment
@Rudd-O

Rudd-O Jul 30, 2017

# Rekey Android F-Droid privileged extension with build keys.
releasefp=$(
keytool -list -printcert -file keys/releasekey.x509.pem | grep SHA256: | awk ' { print $2 } ' | sed 's/://g'
)
platformfp=$(
keytool -list -printcert -file keys/platform.x509.pem | grep SHA256: | awk ' { print $2 } ' | sed 's/://g'
)

pushd packages/apps/F-Droid/privileged-extension
git checkout app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
sed -i 's|// certificate SHA-256 of https//f-droid.org/FDroid.apk|// certificate SHA-256 of https//f-droid.org/FDroid.apk\n            new Pair<>("org.fdroid.fdroid", "'$releasefp'"), // this build keys|g' app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
sed -i 's|// certificate SHA-256 of https//f-droid.org/FDroid.apk|// certificate SHA-256 of https//f-droid.org/FDroid.apk\n            new Pair<>("org.fdroid.fdroid", "'$platformfp'"), // this build keys|g' app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
popd
# End rekey process.

Enjoy!

Rudd-O commented Jul 30, 2017

# Rekey Android F-Droid privileged extension with build keys.
releasefp=$(
keytool -list -printcert -file keys/releasekey.x509.pem | grep SHA256: | awk ' { print $2 } ' | sed 's/://g'
)
platformfp=$(
keytool -list -printcert -file keys/platform.x509.pem | grep SHA256: | awk ' { print $2 } ' | sed 's/://g'
)

pushd packages/apps/F-Droid/privileged-extension
git checkout app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
sed -i 's|// certificate SHA-256 of https//f-droid.org/FDroid.apk|// certificate SHA-256 of https//f-droid.org/FDroid.apk\n            new Pair<>("org.fdroid.fdroid", "'$releasefp'"), // this build keys|g' app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
sed -i 's|// certificate SHA-256 of https//f-droid.org/FDroid.apk|// certificate SHA-256 of https//f-droid.org/FDroid.apk\n            new Pair<>("org.fdroid.fdroid", "'$platformfp'"), // this build keys|g' app/src/main/java/org/fdroid/fdroid/privileged/ClientWhitelist.java
popd
# End rekey process.

Enjoy!

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Jul 30, 2017

Contributor

Ideally it'd whitelist the OS releasekey automatically. I just don't have time to work on F-Droid too.

Contributor

thestinger commented Jul 30, 2017

Ideally it'd whitelist the OS releasekey automatically. I just don't have time to work on F-Droid too.

@Rudd-O

This comment has been minimized.

Show comment Hide comment
@Rudd-O

Rudd-O Jul 30, 2017

What's the OS release key and how do I do that?

Rudd-O commented Jul 30, 2017

What's the OS release key and how do I do that?

@Rudd-O

This comment has been minimized.

Show comment Hide comment
@Rudd-O

Rudd-O Jul 30, 2017

I mean, is what I did above sufficient to get F-Droid to install apps?

Rudd-O commented Jul 30, 2017

I mean, is what I did above sufficient to get F-Droid to install apps?

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Jul 30, 2017

Contributor

I just mean ideally it would automatically use that releasekey.x509.pem key from within the OS rather than having the whitelist that needs to be changed.

Contributor

thestinger commented Jul 30, 2017

I just mean ideally it would automatically use that releasekey.x509.pem key from within the OS rather than having the whitelist that needs to be changed.

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Jul 30, 2017

Contributor

@Rudd-O Yes just saying it should really use the OS releasekey automatically rather than a hard-wired list.

Contributor

thestinger commented Jul 30, 2017

@Rudd-O Yes just saying it should really use the OS releasekey automatically rather than a hard-wired list.

@Rudd-O

This comment has been minimized.

Show comment Hide comment
@Rudd-O

Rudd-O Jul 30, 2017

That's what the script is meant to do (and does). You should copy and paste that code into the build instructions.

Rudd-O commented Jul 30, 2017

That's what the script is meant to do (and does). You should copy and paste that code into the build instructions.

@Rudd-O

This comment has been minimized.

Show comment Hide comment
@Rudd-O

Rudd-O Jul 30, 2017

(Sorry I didn't come up with this sooner. I'm taking some time while I recover from surgery to spin up my build server and get this shit done, so I can finally begin using my Pixel. I did not have time before.)

Rudd-O commented Jul 30, 2017

(Sorry I didn't come up with this sooner. I'm taking some time while I recover from surgery to spin up my build server and get this shit done, so I can finally begin using my Pixel. I did not have time before.)

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Jul 30, 2017

Contributor

Modifying source repositories isn't really appropriate for the build instructions which is why I haven't included this in the instructions. It should be fixed in the code so it uses that key at runtime. Signing is really supposed to be something that can be done entirely after building, i.e. you shouldn't need the keys before building which is currently the case due to both this issue and the new way dm-verity signing works.

Contributor

thestinger commented Jul 30, 2017

Modifying source repositories isn't really appropriate for the build instructions which is why I haven't included this in the instructions. It should be fixed in the code so it uses that key at runtime. Signing is really supposed to be something that can be done entirely after building, i.e. you shouldn't need the keys before building which is currently the case due to both this issue and the new way dm-verity signing works.

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Jul 30, 2017

Contributor

So ideally, that whitelist wouldn't be modified either by us or users, but instead the privileged extension should automatically trust the OS release key, fetched at runtime.

Contributor

thestinger commented Jul 30, 2017

So ideally, that whitelist wouldn't be modified either by us or users, but instead the privileged extension should automatically trust the OS release key, fetched at runtime.

@Rudd-O

This comment has been minimized.

Show comment Hide comment
@Rudd-O

Rudd-O Jul 30, 2017

I, uh, completely agree with that! Yes. If I knew Java / Android, I'd whip that up right now. Unfortunately, that's not the case. Maybe this bug can be repurposed to track the progress of that, and therefore I can get an update to nil my build script snippet that does this, when the code is in place.

Rudd-O commented Jul 30, 2017

I, uh, completely agree with that! Yes. If I knew Java / Android, I'd whip that up right now. Unfortunately, that's not the case. Maybe this bug can be repurposed to track the progress of that, and therefore I can get an update to nil my build script snippet that does this, when the code is in place.

@Rudd-O

This comment has been minimized.

Show comment Hide comment
@Rudd-O

Rudd-O Jul 31, 2017

I want to report that my script above worked as intended and I can now use F-Droid inside the Pixel XL just fine.

Glorious. Thank you.

Rudd-O commented Jul 31, 2017

I want to report that my script above worked as intended and I can now use F-Droid inside the Pixel XL just fine.

Glorious. Thank you.

@Rudd-O

This comment has been minimized.

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