Skip to content

[iOS] Add ability to access developer options menu in official builds #22760

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

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

kylehickinson
Copy link
Collaborator

Resolves brave/brave-browser#36961

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

@kylehickinson kylehickinson self-assigned this Mar 25, 2024
@kylehickinson kylehickinson requested review from a team as code owners March 25, 2024 19:42
@kylehickinson kylehickinson force-pushed the ios-dev-options-code branch 3 times, most recently from e2920d4 to 79c0f77 Compare March 26, 2024 14:28
Copy link
Contributor

[puLL-Merge] - brave/brave-core@22760

Description

This PR adds support for a developer options menu in the Settings page that is hidden by default in official builds. The developer options can be unlocked by entering a secret code. The PR also cleans up and consolidates some logic around differentiating official builds vs. local builds.

Changes

Changes

  • ios/brave-ios/App/iOS/Delegates/AppDelegate.swift:
    • Set the AppConstants.buildChannel and AppConstants.isOfficialBuild flags based on the current build configuration
  • Various files:
    • Replace checks for AppConstants.buildChannel.isPublic with AppConstants.isOfficialBuild
    • Remove some debug settings that were only available in non-public builds
  • ios/brave-ios/Sources/Brave/Frontend/Settings/SettingsViewController.swift:
    • Add logic to show the developer options section if enabled or in local builds
    • Allow enabling developer options in official builds by tapping the About header 5 times and entering the secret code
  • ios/brave-ios/Sources/Preferences/GlobalPreferences.swift:
    • Add a new preference Preferences.Debug.developerOptionsEnabled to track if developer options are enabled
  • ios/browser/api/developer_options_code/:
    • Add a new module to provide the secret code for enabling developer options
    • Use a buildflag to set the code which must be provided for official builds

Security Hotspots

  1. High: The secret code for enabling developer options is compiled into the binary. If this code leaks, anyone could enable developer options in release builds. The code should be kept secret and only known to a few developers.
  2. Medium: With developer options enabled, some debug settings and actions are available that could potentially be misused. The available options should be carefully reviewed to ensure they do not allow escalated privileges or compromise security.
  3. Low: Local builds allow developer options by default without needing the secret code. Care should be taken not to accidentally distribute a local build publicly.

@Uni-verse
Copy link
Contributor

Verified on iPhone 12 running iOS 17.3.1 using version 1.66.53 (Nightly Channel)

  • Ensured all debug menus are accessible and logs are being populated after enabling developer mode.
  • Ensured enabling vmodule in BraveCore Switches will show brave-core logs in console.app when connected to desktop.
Example Example Example Example Example
IMG_5916 IMG_5917 IMG_5918 IMG_5919 IMG_5920

Screenshot 2024-04-02 at 1 06 26 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add access to developer menus & logs in release & beta channels
4 participants