Copyright statement: welcome in making: https://github.com/JackyAndroid and note the source, pay attention to my welcome 🙂 reprinted
Follow me on GitHub or CSDN
Making: github.com/JackyAndroi…
CSDN: blog.csdn.net/rain_butter…
AndroidChromium source code address
Introduction to the
- Google Browser Android version of the source project
- This project is a world-class Android architecture
- I am qualified to be an engineer of a domestic first-line company by clarifying the business logic of this project
- This project will follow up and upgrade the Google Browser kernel version in the long term. Welcome star
rendering
To prepare
Refer to official and other tutorials to compile through Chromium source, and can generate Chrome.apk
purpose
Debug the Chromium Android UI layer using the AndroidStudio development environment.
To construct
- Using Android Studio as the development environment, extract the source code of Chrome module from Chromium for Android and join Android Project.
- The native code was built in the Chromium environment and joined the Android project as so
- The base modules (base, Content, NET, etc.) are jar packages in the Chromium environment build and added to the Android Project
- Add content, Chrome, UI and other modules to Android Library Project
Why can’t resource files be added directly to the Android Project?
Because of namespace problems, for example, org.chromium.content is the namespace of the resources in the Content module and org.chromium.chrome is the namespace of the resources in the Chrome module. So you need to create different Android Library projects with different package names.
This project and source directory corresponding relationship
App/libs – chromium/SRC/out/Release/lib. Java
App/SRC/main/aidl – chromium/SRC/chrome/android/Java/SRC/android/support/customtabs / *. Aidl
App/SRC/main/assets – chromium/SRC/out/Release/assets/chrome_public_apk
App/SRC/main/Java – chromium/SRC/chrome/android/Java/SRC
App/SRC/main/jniLibs – chromium/SRC/out/Release/chrome_public_apk/libs
App/SRC /main/res (App Module initialization resource)
Libraries/androidmedia_res – chromium/SRC/third_party/android_media/Java/res
Libraries/chrome_res – chromium/SRC/chrome/android/Java/res & chromium/SRC/chrome/android/Java/res_chromium
Libraries/content_res – chromium/SRC/content/public/android/Java/res
Libraries/datausagechart_res – chromium/SRC/third_party/android_data_chart/Java/res
Libraries/ui_res – – – – chromium/SRC/UI/android/Java/res
Suggestions & Precautions
- Pak and DAT files must be added to assets and cannot be compressed
- Aidl files are added to main/aidl, and Android Studio handles them automatically
- Currently, the Chromium version built is 48.0.2554.0, and the kernel is the official version
- Because some Java files are compiled from C files, they only exist in the Chromium/SRC /out directory. If the upgrade version is missing according to the preceding mapping, search in the out/ directory and add corresponding files according to the namespace. There are also temporary XML resource files that need to be copied from the out/ directory to the appropriate resource module.
- If you’re running AndroidStudio 2.0 or higher and have instant run enabled, It is recommended that you close the Application and debug it. (Instant Run will modify the Application that was started first, causing chrome Provider Context reference errors and crash.)
Thank you
This project was inspired by 365browser
License
Copyright 2016 Jacky Wang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copy the code