Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask for consent before checking for updates #10790

Merged
merged 4 commits into from
Mar 29, 2024
Merged

Ask for consent before checking for updates #10790

merged 4 commits into from
Mar 29, 2024

Conversation

TobiGr
Copy link
Member

@TobiGr TobiGr commented Jan 26, 2024

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

Ask for consent before enabling auto update check.

NewPipe is contacting its servers without asking for the users' consent. This is categorized as "tracking" by F-Droid (see #10785).

This PR disables checking for updates by default and adds a dialog asking for the user's consent to automatically check for updates if the app version is eligible for them. After upgrading to a version containing this commit the user is asked directly on the first app start. On fresh installs however, showing it on the first app start contributes to a bad onboarding an welcoming experience. Therefore, the dialog is shown at the second app start.

To Do

  • Implement settings migration triggering the consent check on update
  • Refactor the App.isFirstRun to be set inside App and read only (**should the variable be static?**)
  • Provide testing APK which does not rely on release signature check to ask for consent
  • Do testing

Before/After Screenshots/Screen Record

grafik

Fixes the following issue(s)

APK testing

Install this release APK for testing, singed by my dev key:
NewPipe-check-consent.zip

Due diligence

@TobiGr TobiGr added the privacy & data protection Issues regarding either NewPipe, Team NewPipe services or external services NewPipe uses label Jan 26, 2024
@github-actions github-actions bot added the size/medium PRs with less than 250 changed lines label Jan 26, 2024
Copy link

sonarcloud bot commented Jan 26, 2024

@TobiGr TobiGr marked this pull request as ready for review March 21, 2024 09:32
@TobiGr TobiGr changed the title Update check consent Aks for consent before checking for updates Mar 21, 2024
Copy link
Member

@AudricV AudricV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user closes the app when it gets the dialog and reopens it, does the dialog appear again? From what I understood of the code changes in this PR, it doesn't seem to be the case.

Code looks good to me, even if the placement of the alert dialog code in the update settings fragment seems a bit weird to me.

@AudricV AudricV changed the title Aks for consent before checking for updates Ask for consent before checking for updates Mar 21, 2024
@TobiGr
Copy link
Member Author

TobiGr commented Mar 22, 2024

Code looks good to me, even if the placement of the alert dialog code in the update settings fragment seems a bit weird to me.

I put it there because the dialog is working with the setting to keep that stuff in one place. For that reason, I did not put it into the MainFragment. If you want me to move it there, I'll do it.

Copy link
Member

@AudricV AudricV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put it there because the dialog is working with the setting to keep that stuff in one place. For that reason, I did not put it into the MainFragment. If you want me to move it there, I'll do it.

That's fine, anyway, when this will be "compostified" in the future, it will be probably placed in the right place :)

Do you think that the first run code migration should be reverted? I don't think that's necessary, but do what you think is the best :)

The rest of the changes looks good to me except this comment (a small optimization). Thank you for your efforts!

app/src/main/java/org/schabi/newpipe/MainActivity.java Outdated Show resolved Hide resolved
@TobiGr
Copy link
Member Author

TobiGr commented Mar 23, 2024

Do you think that the first run code migration should be reverted? I don't think that's necessary, but do what you think is the best :)

The migration is not necessary anymore because wasUserAskedForConsen() is checked on app start

@AudricV
Copy link
Member

AudricV commented Mar 23, 2024

The migration is not necessary anymore because wasUserAskedForConsen() is checked on app start

I meant the refactoring of the first run code, sorry for the confusion.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good :-)

app/src/main/java/org/schabi/newpipe/MainActivity.java Outdated Show resolved Hide resolved
@TobiGr
Copy link
Member Author

TobiGr commented Mar 27, 2024

I meant the refactoring of the first run code, sorry for the confusion.

Will do that tomorrow

@TobiGr
Copy link
Member Author

TobiGr commented Mar 28, 2024

@AudricV I just looked at the code again. Now that we have the isFirstRun() check in the MainAcitivity again, the refactor is needed. I'd therefore keep it as it is and would squash the commits if you are ok with that.

NewPipe is contacting its servers without asking for the users' consent. This is categorized as "tracking" by F-Droid (see #10785).

This commit disables checking for udpates by default and adds a dialog asking for the user's consent to automatically check for updates if the app version is eligible for them. After upgrading to a version containing this commit the user is asked directly on the first app start. On fresh installs however, showing it on the first app start contributes to a bad onboarding an welcoming experience. Therefore, the dialog is shown at the second app start.

Co-authored-by: Stypox <[email protected]>
@Stypox
Copy link
Member

Stypox commented Mar 29, 2024

Here an APK for you to test: NewPipe updatechecker.zip
This is the expected behavior:

  • The first time the app is opened, no update check is run, and no consent is asked (this is to avoid a bad onboarding and welcoming experience)
  • The second time, no update check is run, but the user is asked for consent
  • If the user accepted to check for updates, from the third time onwards, the app will check for updates, otherwise it will never do so

The APK is signed with @Stypox keys. The fingerprint for which to check for updates has been set to f3c6b6ddf4f4c9e2fa5c5e65799dc388d17eae626acfa6e29f571b3520883b75, i.e. the fingerprint of my key. The version code of the APK is that of 0.26.0 (995) instead of 0.26.1 (996) so that version checks show a notification. The package name is org.schabi.newpipe.updatechecker.

Copy link

sonarcloud bot commented Mar 29, 2024

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I pushed two more commits to improve the checks a bit more (previously the default value when geting update_app_key was true, which would have resulted in update checks running without consent)

@Stypox Stypox merged commit f0beb66 into dev Mar 29, 2024
6 checks passed
@TobiGr TobiGr deleted the update-check-consent branch March 29, 2024 11:25
@Stypox Stypox mentioned this pull request Apr 1, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
privacy & data protection Issues regarding either NewPipe, Team NewPipe services or external services NewPipe uses size/medium PRs with less than 250 changed lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants