Convert Figma logo to code with AI

kiwibrowser logosrc

Source-code used in Kiwi Browser for Android

2,726
359
2,726
5

Top Related Projects

5,786

Bromite is a Chromium fork with ad blocking and privacy enhancements; take back your browser!

Google Chromium, sans integration with Google

Brave browser for Android, iOS, Linux, macOS, Windows.

6,484

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android

Quick Overview

Kiwi Browser is an open-source Chromium-based web browser for Android devices. It focuses on providing a fast, lightweight browsing experience with built-in ad blocking and crypto mining protection. The kiwibrowser/src repository contains the source code for the browser.

Pros

  • Built-in ad blocking and crypto mining protection
  • Lightweight and fast performance on Android devices
  • Open-source, allowing for community contributions and transparency
  • Based on Chromium, ensuring compatibility with most websites

Cons

  • Limited to Android platform, not available for iOS or desktop
  • Smaller user base compared to mainstream browsers like Chrome or Firefox
  • May require more frequent manual updates compared to Play Store distributed apps
  • Some advanced features of larger browsers may not be available

Getting Started

As this is not a code library but a full browser project, there isn't a quick start guide for using it as a dependency. However, if you're interested in contributing to the project or building it yourself, you can follow these general steps:

  1. Clone the repository:

    git clone https://github.com/kiwibrowser/src.git
    
  2. Follow the build instructions in the repository's documentation (usually found in README.md or CONTRIBUTING.md files).

  3. Set up the necessary development environment, which typically includes Android SDK and NDK.

  4. Build the project using the provided build scripts or commands.

  5. Test the built APK on an Android device or emulator.

For specific instructions, always refer to the official documentation in the repository, as build processes may change over time.

Competitor Comparisons

5,786

Bromite is a Chromium fork with ad blocking and privacy enhancements; take back your browser!

Pros of Bromite

  • More active development with frequent updates and commits
  • Stronger focus on privacy features and ad-blocking capabilities
  • Larger community and user base, leading to more feedback and contributions

Cons of Bromite

  • Less customization options compared to Kiwi Browser
  • Lacks support for Chrome extensions, which Kiwi Browser offers
  • May have compatibility issues with some websites due to aggressive privacy measures

Code Comparison

Bromite (privacy-focused modifications):

void ApplyBromitePatches() {
  DisableGoogleSync();
  EnhanceAdBlocking();
  RemoveTracking();
}

Kiwi Browser (extension support):

void EnableChromeExtensions() {
  LoadExtensionAPI();
  InitializeExtensionSystem();
  HandleExtensionRequests();
}

Both projects are Chromium-based browsers with a focus on privacy and security. Bromite tends to be more privacy-centric, while Kiwi Browser offers more customization options, including Chrome extension support. The code snippets illustrate their different priorities, with Bromite focusing on privacy enhancements and Kiwi Browser emphasizing extension capabilities.

Google Chromium, sans integration with Google

Pros of ungoogled-chromium

  • Focuses on privacy by removing Google-specific integrations and features
  • Provides a more "vanilla" Chromium experience without additional bloat
  • Actively maintained with frequent updates and community contributions

Cons of ungoogled-chromium

  • Lacks some convenience features present in Kiwi Browser
  • May require more technical knowledge to set up and use effectively
  • Doesn't include built-in ad-blocking or other enhancements

Code Comparison

ungoogled-chromium:

void RemoveGoogleHostsFromNetBlocklist() {
  net::HostBlockList* block_list = GetNetBlockList();
  block_list->RemoveHost("google.com");
  block_list->RemoveHost("googleapis.com");
}

Kiwi Browser:

public void enableAdBlock(boolean enable) {
    mAdBlockEnabled = enable;
    updateAdBlockPreferences();
    if (mTabManager != null) {
        mTabManager.updateAdBlockStatus(enable);
    }
}

The code snippets demonstrate the different focus areas of the projects. ungoogled-chromium removes Google-related hosts, while Kiwi Browser implements ad-blocking functionality.

Brave browser for Android, iOS, Linux, macOS, Windows.

Pros of Brave Browser

  • More active development with frequent updates and contributions
  • Larger community and user base, leading to better support and resources
  • Comprehensive privacy and security features built-in

Cons of Brave Browser

  • More complex codebase, potentially harder for new contributors to navigate
  • Heavier resource usage due to additional features and integrations

Code Comparison

Brave Browser (JavaScript):

const tabId = message.tabId;
const tab = await chrome.tabs.get(tabId);
const isPrivate = tab.incognito;

Kiwi Browser (C++):

bool IsIncognito() const override {
  return web_contents_->GetBrowserContext()->IsOffTheRecord();
}

Summary

Brave Browser offers a more feature-rich and actively maintained project with strong privacy focus, while Kiwi Browser provides a simpler, lightweight alternative. Brave's codebase is more extensive, reflecting its broader feature set, while Kiwi's code is more streamlined. Both projects aim to enhance user privacy and security in web browsing, but Brave has a larger ecosystem and community support.

6,484

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android

Pros of Fenix

  • More active development with frequent updates and contributions
  • Stronger focus on privacy and security features
  • Better documentation and community support

Cons of Fenix

  • Larger codebase, potentially more complex to navigate
  • Stricter adherence to Mozilla's design principles, which may limit customization

Code Comparison

Fenix (Kotlin):

class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        return super.onCreateView(inflater, container, savedInstanceState)
    }
}

Kiwi Browser (C++):

class BrowserView : public views::WidgetDelegate {
 public:
  BrowserView(std::unique_ptr<Browser> browser, Profile* profile);
  ~BrowserView() override;

  Browser* browser() { return browser_.get(); }
};

The code snippets show different approaches to implementing browser functionality. Fenix uses Kotlin and follows Android development patterns, while Kiwi Browser uses C++ and is based on Chromium's architecture. Fenix's code is more modern and Android-specific, whereas Kiwi Browser's code is closer to desktop Chrome's implementation.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Kiwi Browser

automatic build of apk

Overview

Kiwi Browser is a fully open-source web browser for Android.

Kiwi is based on Chromium. Easily switch to Kiwi without having to painstakingly learn a new interface or break your existing browsing habits.

Among other functionalities, Kiwi Browser supports:

  • Night Mode (another implementation than Chromium)
  • Support for Chrome Extensions
  • Bottom address bar It also includes performance improvements (partial rasterization of tiles, etc)

The browser is licensed under the same license as Chromium, which means that you are allowed to create derivatives of the browser.

Make sure to properly attribute the code to this repository (don't just replace with your name)

Table of contents

Timeline

  • 15 April 2018 - First Kiwi Browser release.

  • 15 April 2019 - Kiwi Browser gets support for Chrome Extensions.

  • 17 April 2020 - Kiwi Browser goes fully open-source.

This code is up-to-date and is matching the build on the Play Store.

The new builds are done from the open-source edition directly to the Play Store.

There are thousands of hours of work in this repository and thousands of files changed.

Contributing

Contributions are welcome and encouraged.

If you want your code to be integrated into Kiwi, open a merge request, I (and/or a member of the community) can review the code with you and push it to the Play Store.

Modifying

If you create your own browser or a mod, make sure to change the browser name and icon in chrome/android/java/res_chromium/values/channel_constants.xml and translation strings (search and replace Kiwi in all *.xtb, all *.grd and all *.grdp files). When replacing the app icon, make sure to add the new icon files in their respective chrome/android/java/res/mipmap folders(mdpi, hdpi etc) and also update the AndroidManifest.xml.

Building

The reference build machine is using Ubuntu 19.04 (also tested using Ubuntu 18.04 and Ubuntu 19.10).

The minimum system requirements are 2 vCPUs, 7.5 GB Memory.

You can use a virtual machine, an AWS VM, or a Google Cloud VM.

Getting the source-code and environment

To build Kiwi Browser you can directly clone the repository, as we have packed all dependencies already:

In ~ (your home directory) run:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

and edit the file ~/.bashrc to add at the very end

export PATH=$HOME/depot_tools:$PATH

Validate the changes by running:

source ~/.bashrc

This will give you access to one utility called gclient (as in "Google client")

Create a directory called ~/chromium/, and in ~/chromium/ run:

git clone https://github.com/kiwibrowser/dependencies.git .cipd
cp ~/chromium/.cipd/.gclient ~/chromium/
cp ~/chromium/.cipd/.gclient_entries ~/chromium/
git clone https://github.com/kiwibrowser/src.git

At this stage, in ~/chromium/ you will have the .cipd folder, and a folder with the Kiwi Browser source-code called src.

Setting up dependencies

To be able to build Kiwi Browser, you need python and OpenJDK (OpenJDK to create Java bindings for Android):

sudo apt-get update
sudo apt-get install python openjdk-8-jdk-headless libncurses5

We want to be sure to use Java 1.8 in order to not get compilation errors (lint and errorprone):

sudo update-java-alternatives --set java-1.8.0-openjdk-amd64

then run the following commands in ~/chromium/src:

bash install-build-deps.sh --no-chromeos-fonts
build/linux/sysroot_scripts/install-sysroot.py --arch=i386
build/linux/sysroot_scripts/install-sysroot.py --arch=amd64

These commands will install all necessary system packages using apt-get and gather a minimal build filesystem.

Preparing a signing key

APKs (application packages) on Android need to be signed by developers in order to be distributed.

To generate a key:

keytool -genkey -v -keystore ~/chromium/keystore.jks -alias production -keyalg RSA -keysize 2048 -validity 10000 -storepass HERE_YOUR_ANDROID_KEYSTORE_PASSWORD -keypass HERE_YOUR_ANDROID_KEYSTORE_PASSWORD

Configuring the build type and platform

Run:

mkdir -p ~/chromium/src/out/android_arm

Create a file called args.gn in ~/chromium/src/out/android_arm/ with this content:

target_os = "android"
target_cpu = "arm" # <---- can be arm, arm64, x86 or x64
is_debug = false
is_java_debug = false

android_channel = "stable"
is_official_build = true
is_component_build = false
is_chrome_branded = false
is_clang = true
symbol_level = 1
use_unofficial_version_number = false
android_default_version_code = "158"
android_keystore_name = "production"
android_keystore_password = "HERE_YOUR_ANDROID_KEYSTORE_PASSWORD"
android_keystore_path = "../../../keystore.jks"
android_default_version_name = "Quadea"
fieldtrial_testing_like_official_build = true
icu_use_data_file = false
enable_iterator_debugging = false

google_api_key = "KIWIBROWSER"
google_default_client_id = "42.apps.kiwibrowser.com"
google_default_client_secret = "KIWIBROWSER_NOT_SO_SECRET"
use_official_google_api_keys = true

ffmpeg_branding = "Chrome"
proprietary_codecs = true
enable_hevc_demuxing = true
enable_nacl = false
enable_wifi_display = false
enable_widevine = false
enable_google_now = true
enable_ac3_eac3_audio_demuxing = true
enable_iterator_debugging = false
enable_mse_mpeg2ts_stream_parser = true
enable_remoting = false
rtc_use_h264 = false
rtc_use_lto = false
use_openh264 = false

v8_use_external_startup_data = true
update_android_aar_prebuilts = true

use_thin_lto = true

enable_extensions = true
enable_plugins = true

You can replace Android keystore password and Android keystore keypath with the data for your Android keystore (or you can generate a new key).

Preparing the first build

To prepare initial setup run from ~/chromium/src:

gclient runhooks

then generate the build files in ~/chromium/src:

gn gen out/android_arm

Alternatively you can use: gn args out/android_arm

Compiling Kiwi Browser

To compile, use the command:

ninja -C out/android_arm chrome_public_apk

you'll have the output APK in ~/chromium/src/out/android_arm/apks/ChromePublic.apk

then you can run the APK on your phone.

Investigating crashes

You need to have the symbols for the version that crashed, the symbols can be generated using:

components/crash/content/tools/generate_breakpad_symbols.py --build-dir=out/lnx64 --symbols-dir=/tmp/my_symbols/ --binary=out/android_arm/lib.unstripped/libchrome.so --clear --verbose

If you have the crash information from logcat:

out/lnx64/microdump_stackwalk -s /tmp/dump.dmp /tmp/my_symbols/

If you have the crash information in a tombstone:

./third_party/android_ndk/ndk-stack -sym out/android_x86/lib.unstripped -dump tombstone

Remote debugging

You can use Google Chrome to debug using the devtools console.

In case the devtools console doesn't work (error 404), the solution is to use chrome://inspect (Inspect fallback) or change SHA1 in build/util/LASTCHANGE

LASTCHANGE=8920e690dd011895672947112477d10d5c8afb09-refs/branch-heads/3497@{#948}

and confirm the change using:

rm out/android_arm/gen/components/version_info/version_info_values.h out/android_x86/gen/components/version_info/version_info_values.h out/android_arm/gen/build/util/webkit_version.h out/android_x86/gen/build/util/webkit_version.h out/android_arm/gen/chrome/common/chrome_version.h out/android_x86/gen/chrome/common/chrome_version.h

Optimizing binary size

If you want to optimize of the final APK, you can look at the size of each individual component using command:

./tools/binary_size/supersize archive chrome.size --apk-file out/android_arm/apks/ChromePublic.apk -v
./tools/binary_size/supersize html_report chrome.size --report-dir size-report -v

Precompiled binaries

Business model

The browser is getting paid by search engines for every search done using Kiwi Browser.

Depending on the search engine choice, requests may go via Kiwibrowser / Kiwisearchservices servers. This is for invoicing our search partners and provide alternative search results (e.g. bangs aka "shortcuts").

In some countries, the browser displays sponsored tiles or news on the homepage.

User data (browsing, navigation, passwords, accounts) is not collected because we have no interest to know what you do in the browser. Our main goal is to convince you to use a search engine partner, and this search engine makes money / new partnerships and shares revenue with us.

Roadmap

  • During year 2020, the goal of the project is to make maintenance fixes and security updates.

If there is an issue or bug that you want to be included to Kiwi, please open an issue ticket pointing to the related Chromium bug or commit. Be precise, there are dozen of thousands of changes in Chromium.

  • During 2021, Kiwi Browser will switch to a new branch called Kiwi Browser Next with a quite automated Chromium rebasing system.

Additional help

You can ask for extra help in our Discord server:

Have fun with Kiwi!

Arnaud.