Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android平台5+App/uni-app运行环境开源项目

重要:请使用HBuilderX2.3.7-20191024生成本地打包App资源,否则uni-app项目可能提示“运行环境版本和编译器版本不一致”,详情参考https://ask.dcloud.net.cn/article/35627

说明

此次更新梳理了工程结构,现在开发者可以直接修改引擎中的代码,自主编译出新的引擎。

如果开发者要修改本工程源码,请注意“引擎”和“插件”的分界线。 “引擎”是对5+/uni-app规范的实现,修改引擎源码可以优化对规范的实现,但不是提供规范外的功能。规范外的功能,应该做成“插件”。如需公开,则放到插件市场。 比如扫码,5+/uni-app的规范已经存在,但开发者对扫码效率不满意,提供自己更好的实现,则可以改动本源码,重新Build引擎。 而如果是想新增一个ar功能,则应该做成插件,而不是加入到本工程中。即,开发者不能自主新增5+/uni-app的js API规范。

任何一个项目的源码,吃透整体都不是一件容易的事情。一般开发者有改动需求,也多集中在一些能力或SDK的实现上。 比如扫码、视频、地图、直播、摄像头、相册、蓝牙等,以及某些界面的文字。 只关注某些能力模块,吃透和修改会更加容易。

受精力所限,某些模块,比如DCloud定制过的weex源码,还未规整好,暂时以库的方式提供,未来会提供完整源码。不过这不影响开发者修改其他源码和编译工程。

模块与源码对应关系

功能模块源码目录5+APP项目uni-app项目
Audio(音频)feature/audioplus.audiohttps://uniapp.dcloud.io/api/media/record-managerhttps://uniapp.dcloud.io/api/media/audio-context
Audio(MP3格式音频支持库)feature/audio-mp3accplus.audio
Barcode(二维码)feature/barcodeplus.barcodehttps://uniapp.dcloud.io/api/system/barcode
Bluetooth(低功耗蓝牙)feature/bluetoothplus.bluetoothhttps://uniapp.dcloud.io/api/system/bluetooth
Camera(摄像头)feature/cameraplus.camera
Contacts(通讯录)feature/contactsplus.contacts
Device(设备信息)feature/deviceplus.devicehttps://uniapp.dcloud.io/api/system/info
Downloader(文件下载)feature/downloaderplus.downloaderhttps://uniapp.dcloud.io/api/request/network-file?id=downloadfile
Fingerprint(指纹识别)feature/fingerprintplus.fingerprinthttps://uniapp.dcloud.io/api/other/authentication
Geolocation(基础定位库)feature/geolacationplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(高德定位)feature/geolacation-amapplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(百度定位)feature/geolacation-baiduplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(系统定位)feature/geolacation-systemplus.geolocationhttps://uniapp.dcloud.io/api/location/location
iBeaconfeature/ibeaconplus.ibeaconhttps://uniapp.dcloud.io/api/system/ibeacon
IO(文件系统)feature/fileplus.iohttps://uniapp.dcloud.io/api/file/file
LivePusher(直播推流)feature/media-livepusherplus.video.LivePusherhttps://uniapp.dcloud.io/api/media/live-player-context
Maps(高德地图)feature/map-amapplus.maphttps://uniapp.dcloud.io/api/location/map
Maps(百度地图)feature/map-baiduplus.maphttps://uniapp.dcloud.io/api/location/map
Messaging(短彩邮件消息)feature/messagingplus.messaging
Navigator(运行环境信息)feature/navigatoruiplus.navigatorhttps://uniapp.dcloud.io/api/system/info
Oauth(登录基础库)feature/oauthplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(小米登录)feature/oauth-miuiplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(QQ登录)feature/oauth-qqplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(新浪微博登录)feature/oauth-sinaplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(微信登录)feature/oauth-weixinplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Payment(支付基础库)feature/paymentplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(支付宝支付)feature/payment-alipayplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(微信支付)feature/payment-weixinplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Push(推送基础库)feature/apsplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送)feature/aps-igexinplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送-GooglePlay专版)feature/aps-igexin-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送)feature/aps-unipushplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送-GooglePlay专版)feature/aps-unipush-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(小米推送)feature/aps-xiaomiplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Share(分享基础库)feature/shareplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(QQ分享)feature/share-qqplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(新浪微博分享)feature/share-sinaplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(微信分享)feature/share-weixinplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Speech(语音识别基础库)feature/speechplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(百度语音识别)feature/speech_baiduplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(讯飞语音识别)feature/speech_iflyplus.speech
SQLite(数据库)feature/sqliteplus.sqlite
Statistic(友盟统计)feature/statistics-umengplus.statistic
Uploader(文件上传)feature/uploaderplus.uploaderhttps://uniapp.dcloud.io/api/request/network-file?id=uploadfile
VideoPlayer(视频播放)feature/mediaplus.video.VideoPlayerhttps://uniapp.dcloud.io/api/media/video
XHR(网络请求)feature/xhrplus.nethttps://uniapp.dcloud.io/api/request/request?id=request
nvue原生组件: map(高德地图)feature/weex_amap不支持https://uniapp.dcloud.io/component/map
nvue原生组件: barcode(二维码)feature/weex_barcode不支持https://uniapp.dcloud.io/component/barcode
nvue原生组件: live-pusher(直播推流)feature/weex_livepusher不支持https://uniapp.dcloud.io/component/live-pusher
nvue原生组件: video视频feature/weex_videoplayer不支持https://uniapp.dcloud.io/component/video
nvue原生组件: canvasfeature/weex_gcanvas不支持https://github.com/dcloudio/NvueCanvasDemo

源码配置

  • 文件夹中存在build.gradle文件的模块

将源码clone到本地,复制对应文件夹到所在项目的根目录,在setting.gradle中加入module配置,rebuild即可。以高德地图为例,将本工程clone到本地,复制map-amap到项目的根目录,打开setting.gradle,在最底部添加include "map-amap",重新运行即可,如需添加到主工程中,打开主工程的build.gradle文件,在dependencies节点中添加implementation project(path: ':map-amap')即可。

  • 文件夹中不存在build.gradle文件的模块

如果模块中不存在build.gradle文件,可以将文件夹中的目录直接拷贝到主项目中。例如xhr模块,可以将src下的文件夹拷贝到主项目的src下,如果存在其他文件夹(如libs),直接将文件夹下的内容拷贝到同名文件夹下即可。

参考HBuilder-SourceTool-as项目

项目配置及打包

clone HBuilder-SourceTool-as项目到本地,直接运行即可。如果运行uni-app时出现问题,可参考:https://ask.dcloud.net.cn/article/35139。

安卓打包配置参考:https://www.cnblogs.com/lsdb/p/9337342.html。

许可协议

本工程大部分源码开源,使用者可以自主修改已公开的源码,编译新版本。 但注意:

  1. 您不能破解、反向工程、反编译本项目下未开源的各种库文件。
  2. 未经DCloud书面许可,您不得利用本项目的全部或部分源码、文件来制作与DCloud根据本项目提供的服务相竞争的产品,例如提供自主品牌的开发者服务。
  3. DCloud所拥有的知识产权,包括但不限于商标、专利、著作权,并不发生转移或共享。
  4. 您基于本项目,自主开发的代码及输出物,其知识产权归属您所有。除非您通过提交pull request的方式将自己的代码开源。
  5. 如果您没有违反本许可协议,那么你使用本项目将无需为DCloud支付任何费用。

About

HTML5 Plus for Android

Resources

Stars

258 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android平台5+App/uni-app运行环境开源项目

重要:请使用HBuilderX2.3.7-20191024生成本地打包App资源,否则uni-app项目可能提示“运行环境版本和编译器版本不一致”,详情参考https://ask.dcloud.net.cn/article/35627

说明

此次更新梳理了工程结构,现在开发者可以直接修改引擎中的代码,自主编译出新的引擎。

如果开发者要修改本工程源码,请注意“引擎”和“插件”的分界线。 “引擎”是对5+/uni-app规范的实现,修改引擎源码可以优化对规范的实现,但不是提供规范外的功能。规范外的功能,应该做成“插件”。如需公开,则放到插件市场。 比如扫码,5+/uni-app的规范已经存在,但开发者对扫码效率不满意,提供自己更好的实现,则可以改动本源码,重新Build引擎。 而如果是想新增一个ar功能,则应该做成插件,而不是加入到本工程中。即,开发者不能自主新增5+/uni-app的js API规范。

任何一个项目的源码,吃透整体都不是一件容易的事情。一般开发者有改动需求,也多集中在一些能力或SDK的实现上。 比如扫码、视频、地图、直播、摄像头、相册、蓝牙等,以及某些界面的文字。 只关注某些能力模块,吃透和修改会更加容易。

受精力所限,某些模块,比如DCloud定制过的weex源码,还未规整好,暂时以库的方式提供,未来会提供完整源码。不过这不影响开发者修改其他源码和编译工程。

模块与源码对应关系

功能模块源码目录5+APP项目uni-app项目
Audio(音频)feature/audioplus.audiohttps://uniapp.dcloud.io/api/media/record-managerhttps://uniapp.dcloud.io/api/media/audio-context
Audio(MP3格式音频支持库)feature/audio-mp3accplus.audio
Barcode(二维码)feature/barcodeplus.barcodehttps://uniapp.dcloud.io/api/system/barcode
Bluetooth(低功耗蓝牙)feature/bluetoothplus.bluetoothhttps://uniapp.dcloud.io/api/system/bluetooth
Camera(摄像头)feature/cameraplus.camera
Contacts(通讯录)feature/contactsplus.contacts
Device(设备信息)feature/deviceplus.devicehttps://uniapp.dcloud.io/api/system/info
Downloader(文件下载)feature/downloaderplus.downloaderhttps://uniapp.dcloud.io/api/request/network-file?id=downloadfile
Fingerprint(指纹识别)feature/fingerprintplus.fingerprinthttps://uniapp.dcloud.io/api/other/authentication
Geolocation(基础定位库)feature/geolacationplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(高德定位)feature/geolacation-amapplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(百度定位)feature/geolacation-baiduplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(系统定位)feature/geolacation-systemplus.geolocationhttps://uniapp.dcloud.io/api/location/location
iBeaconfeature/ibeaconplus.ibeaconhttps://uniapp.dcloud.io/api/system/ibeacon
IO(文件系统)feature/fileplus.iohttps://uniapp.dcloud.io/api/file/file
LivePusher(直播推流)feature/media-livepusherplus.video.LivePusherhttps://uniapp.dcloud.io/api/media/live-player-context
Maps(高德地图)feature/map-amapplus.maphttps://uniapp.dcloud.io/api/location/map
Maps(百度地图)feature/map-baiduplus.maphttps://uniapp.dcloud.io/api/location/map
Messaging(短彩邮件消息)feature/messagingplus.messaging
Navigator(运行环境信息)feature/navigatoruiplus.navigatorhttps://uniapp.dcloud.io/api/system/info
Oauth(登录基础库)feature/oauthplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(小米登录)feature/oauth-miuiplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(QQ登录)feature/oauth-qqplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(新浪微博登录)feature/oauth-sinaplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(微信登录)feature/oauth-weixinplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Payment(支付基础库)feature/paymentplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(支付宝支付)feature/payment-alipayplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(微信支付)feature/payment-weixinplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Push(推送基础库)feature/apsplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送)feature/aps-igexinplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送-GooglePlay专版)feature/aps-igexin-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送)feature/aps-unipushplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送-GooglePlay专版)feature/aps-unipush-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(小米推送)feature/aps-xiaomiplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Share(分享基础库)feature/shareplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(QQ分享)feature/share-qqplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(新浪微博分享)feature/share-sinaplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(微信分享)feature/share-weixinplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Speech(语音识别基础库)feature/speechplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(百度语音识别)feature/speech_baiduplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(讯飞语音识别)feature/speech_iflyplus.speech
SQLite(数据库)feature/sqliteplus.sqlite
Statistic(友盟统计)feature/statistics-umengplus.statistic
Uploader(文件上传)feature/uploaderplus.uploaderhttps://uniapp.dcloud.io/api/request/network-file?id=uploadfile
VideoPlayer(视频播放)feature/mediaplus.video.VideoPlayerhttps://uniapp.dcloud.io/api/media/video
XHR(网络请求)feature/xhrplus.nethttps://uniapp.dcloud.io/api/request/request?id=request
nvue原生组件: map(高德地图)feature/weex_amap不支持https://uniapp.dcloud.io/component/map
nvue原生组件: barcode(二维码)feature/weex_barcode不支持https://uniapp.dcloud.io/component/barcode
nvue原生组件: live-pusher(直播推流)feature/weex_livepusher不支持https://uniapp.dcloud.io/component/live-pusher
nvue原生组件: video视频feature/weex_videoplayer不支持https://uniapp.dcloud.io/component/video
nvue原生组件: canvasfeature/weex_gcanvas不支持https://github.com/dcloudio/NvueCanvasDemo

源码配置

  • 文件夹中存在build.gradle文件的模块

将源码clone到本地,复制对应文件夹到所在项目的根目录,在setting.gradle中加入module配置,rebuild即可。以高德地图为例,将本工程clone到本地,复制map-amap到项目的根目录,打开setting.gradle,在最底部添加include "map-amap",重新运行即可,如需添加到主工程中,打开主工程的build.gradle文件,在dependencies节点中添加implementation project(path: ':map-amap')即可。

  • 文件夹中不存在build.gradle文件的模块

如果模块中不存在build.gradle文件,可以将文件夹中的目录直接拷贝到主项目中。例如xhr模块,可以将src下的文件夹拷贝到主项目的src下,如果存在其他文件夹(如libs),直接将文件夹下的内容拷贝到同名文件夹下即可。

参考HBuilder-SourceTool-as项目

项目配置及打包

clone HBuilder-SourceTool-as项目到本地,直接运行即可。如果运行uni-app时出现问题,可参考:https://ask.dcloud.net.cn/article/35139。

安卓打包配置参考:https://www.cnblogs.com/lsdb/p/9337342.html。

许可协议

本工程大部分源码开源,使用者可以自主修改已公开的源码,编译新版本。 但注意:

  1. 您不能破解、反向工程、反编译本项目下未开源的各种库文件。
  2. 未经DCloud书面许可,您不得利用本项目的全部或部分源码、文件来制作与DCloud根据本项目提供的服务相竞争的产品,例如提供自主品牌的开发者服务。
  3. DCloud所拥有的知识产权,包括但不限于商标、专利、著作权,并不发生转移或共享。
  4. 您基于本项目,自主开发的代码及输出物,其知识产权归属您所有。除非您通过提交pull request的方式将自己的代码开源。
  5. 如果您没有违反本许可协议,那么你使用本项目将无需为DCloud支付任何费用。

About

HTML5 Plus for Android

Resources

Stars

258 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android平台5+App/uni-app运行环境开源项目

重要:请使用HBuilderX2.3.7-20191024生成本地打包App资源,否则uni-app项目可能提示“运行环境版本和编译器版本不一致”,详情参考https://ask.dcloud.net.cn/article/35627

说明

此次更新梳理了工程结构,现在开发者可以直接修改引擎中的代码,自主编译出新的引擎。

如果开发者要修改本工程源码,请注意“引擎”和“插件”的分界线。 “引擎”是对5+/uni-app规范的实现,修改引擎源码可以优化对规范的实现,但不是提供规范外的功能。规范外的功能,应该做成“插件”。如需公开,则放到插件市场。 比如扫码,5+/uni-app的规范已经存在,但开发者对扫码效率不满意,提供自己更好的实现,则可以改动本源码,重新Build引擎。 而如果是想新增一个ar功能,则应该做成插件,而不是加入到本工程中。即,开发者不能自主新增5+/uni-app的js API规范。

任何一个项目的源码,吃透整体都不是一件容易的事情。一般开发者有改动需求,也多集中在一些能力或SDK的实现上。 比如扫码、视频、地图、直播、摄像头、相册、蓝牙等,以及某些界面的文字。 只关注某些能力模块,吃透和修改会更加容易。

受精力所限,某些模块,比如DCloud定制过的weex源码,还未规整好,暂时以库的方式提供,未来会提供完整源码。不过这不影响开发者修改其他源码和编译工程。

模块与源码对应关系

功能模块源码目录5+APP项目uni-app项目
Audio(音频)feature/audioplus.audiohttps://uniapp.dcloud.io/api/media/record-managerhttps://uniapp.dcloud.io/api/media/audio-context
Audio(MP3格式音频支持库)feature/audio-mp3accplus.audio
Barcode(二维码)feature/barcodeplus.barcodehttps://uniapp.dcloud.io/api/system/barcode
Bluetooth(低功耗蓝牙)feature/bluetoothplus.bluetoothhttps://uniapp.dcloud.io/api/system/bluetooth
Camera(摄像头)feature/cameraplus.camera
Contacts(通讯录)feature/contactsplus.contacts
Device(设备信息)feature/deviceplus.devicehttps://uniapp.dcloud.io/api/system/info
Downloader(文件下载)feature/downloaderplus.downloaderhttps://uniapp.dcloud.io/api/request/network-file?id=downloadfile
Fingerprint(指纹识别)feature/fingerprintplus.fingerprinthttps://uniapp.dcloud.io/api/other/authentication
Geolocation(基础定位库)feature/geolacationplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(高德定位)feature/geolacation-amapplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(百度定位)feature/geolacation-baiduplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(系统定位)feature/geolacation-systemplus.geolocationhttps://uniapp.dcloud.io/api/location/location
iBeaconfeature/ibeaconplus.ibeaconhttps://uniapp.dcloud.io/api/system/ibeacon
IO(文件系统)feature/fileplus.iohttps://uniapp.dcloud.io/api/file/file
LivePusher(直播推流)feature/media-livepusherplus.video.LivePusherhttps://uniapp.dcloud.io/api/media/live-player-context
Maps(高德地图)feature/map-amapplus.maphttps://uniapp.dcloud.io/api/location/map
Maps(百度地图)feature/map-baiduplus.maphttps://uniapp.dcloud.io/api/location/map
Messaging(短彩邮件消息)feature/messagingplus.messaging
Navigator(运行环境信息)feature/navigatoruiplus.navigatorhttps://uniapp.dcloud.io/api/system/info
Oauth(登录基础库)feature/oauthplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(小米登录)feature/oauth-miuiplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(QQ登录)feature/oauth-qqplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(新浪微博登录)feature/oauth-sinaplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(微信登录)feature/oauth-weixinplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Payment(支付基础库)feature/paymentplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(支付宝支付)feature/payment-alipayplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(微信支付)feature/payment-weixinplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Push(推送基础库)feature/apsplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送)feature/aps-igexinplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送-GooglePlay专版)feature/aps-igexin-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送)feature/aps-unipushplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送-GooglePlay专版)feature/aps-unipush-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(小米推送)feature/aps-xiaomiplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Share(分享基础库)feature/shareplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(QQ分享)feature/share-qqplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(新浪微博分享)feature/share-sinaplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(微信分享)feature/share-weixinplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Speech(语音识别基础库)feature/speechplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(百度语音识别)feature/speech_baiduplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(讯飞语音识别)feature/speech_iflyplus.speech
SQLite(数据库)feature/sqliteplus.sqlite
Statistic(友盟统计)feature/statistics-umengplus.statistic
Uploader(文件上传)feature/uploaderplus.uploaderhttps://uniapp.dcloud.io/api/request/network-file?id=uploadfile
VideoPlayer(视频播放)feature/mediaplus.video.VideoPlayerhttps://uniapp.dcloud.io/api/media/video
XHR(网络请求)feature/xhrplus.nethttps://uniapp.dcloud.io/api/request/request?id=request
nvue原生组件: map(高德地图)feature/weex_amap不支持https://uniapp.dcloud.io/component/map
nvue原生组件: barcode(二维码)feature/weex_barcode不支持https://uniapp.dcloud.io/component/barcode
nvue原生组件: live-pusher(直播推流)feature/weex_livepusher不支持https://uniapp.dcloud.io/component/live-pusher
nvue原生组件: video视频feature/weex_videoplayer不支持https://uniapp.dcloud.io/component/video
nvue原生组件: canvasfeature/weex_gcanvas不支持https://github.com/dcloudio/NvueCanvasDemo

源码配置

  • 文件夹中存在build.gradle文件的模块

将源码clone到本地,复制对应文件夹到所在项目的根目录,在setting.gradle中加入module配置,rebuild即可。以高德地图为例,将本工程clone到本地,复制map-amap到项目的根目录,打开setting.gradle,在最底部添加include "map-amap",重新运行即可,如需添加到主工程中,打开主工程的build.gradle文件,在dependencies节点中添加implementation project(path: ':map-amap')即可。

  • 文件夹中不存在build.gradle文件的模块

如果模块中不存在build.gradle文件,可以将文件夹中的目录直接拷贝到主项目中。例如xhr模块,可以将src下的文件夹拷贝到主项目的src下,如果存在其他文件夹(如libs),直接将文件夹下的内容拷贝到同名文件夹下即可。

参考HBuilder-SourceTool-as项目

项目配置及打包

clone HBuilder-SourceTool-as项目到本地,直接运行即可。如果运行uni-app时出现问题,可参考:https://ask.dcloud.net.cn/article/35139。

安卓打包配置参考:https://www.cnblogs.com/lsdb/p/9337342.html。

许可协议

本工程大部分源码开源,使用者可以自主修改已公开的源码,编译新版本。 但注意:

  1. 您不能破解、反向工程、反编译本项目下未开源的各种库文件。
  2. 未经DCloud书面许可,您不得利用本项目的全部或部分源码、文件来制作与DCloud根据本项目提供的服务相竞争的产品,例如提供自主品牌的开发者服务。
  3. DCloud所拥有的知识产权,包括但不限于商标、专利、著作权,并不发生转移或共享。
  4. 您基于本项目,自主开发的代码及输出物,其知识产权归属您所有。除非您通过提交pull request的方式将自己的代码开源。
  5. 如果您没有违反本许可协议,那么你使用本项目将无需为DCloud支付任何费用。

About

HTML5 Plus for Android

Resources

Stars

258 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android平台5+App/uni-app运行环境开源项目

重要:请使用HBuilderX2.3.7-20191024生成本地打包App资源,否则uni-app项目可能提示“运行环境版本和编译器版本不一致”,详情参考https://ask.dcloud.net.cn/article/35627

说明

此次更新梳理了工程结构,现在开发者可以直接修改引擎中的代码,自主编译出新的引擎。

如果开发者要修改本工程源码,请注意“引擎”和“插件”的分界线。 “引擎”是对5+/uni-app规范的实现,修改引擎源码可以优化对规范的实现,但不是提供规范外的功能。规范外的功能,应该做成“插件”。如需公开,则放到插件市场。 比如扫码,5+/uni-app的规范已经存在,但开发者对扫码效率不满意,提供自己更好的实现,则可以改动本源码,重新Build引擎。 而如果是想新增一个ar功能,则应该做成插件,而不是加入到本工程中。即,开发者不能自主新增5+/uni-app的js API规范。

任何一个项目的源码,吃透整体都不是一件容易的事情。一般开发者有改动需求,也多集中在一些能力或SDK的实现上。 比如扫码、视频、地图、直播、摄像头、相册、蓝牙等,以及某些界面的文字。 只关注某些能力模块,吃透和修改会更加容易。

受精力所限,某些模块,比如DCloud定制过的weex源码,还未规整好,暂时以库的方式提供,未来会提供完整源码。不过这不影响开发者修改其他源码和编译工程。

模块与源码对应关系

功能模块源码目录5+APP项目uni-app项目
Audio(音频)feature/audioplus.audiohttps://uniapp.dcloud.io/api/media/record-managerhttps://uniapp.dcloud.io/api/media/audio-context
Audio(MP3格式音频支持库)feature/audio-mp3accplus.audio
Barcode(二维码)feature/barcodeplus.barcodehttps://uniapp.dcloud.io/api/system/barcode
Bluetooth(低功耗蓝牙)feature/bluetoothplus.bluetoothhttps://uniapp.dcloud.io/api/system/bluetooth
Camera(摄像头)feature/cameraplus.camera
Contacts(通讯录)feature/contactsplus.contacts
Device(设备信息)feature/deviceplus.devicehttps://uniapp.dcloud.io/api/system/info
Downloader(文件下载)feature/downloaderplus.downloaderhttps://uniapp.dcloud.io/api/request/network-file?id=downloadfile
Fingerprint(指纹识别)feature/fingerprintplus.fingerprinthttps://uniapp.dcloud.io/api/other/authentication
Geolocation(基础定位库)feature/geolacationplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(高德定位)feature/geolacation-amapplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(百度定位)feature/geolacation-baiduplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(系统定位)feature/geolacation-systemplus.geolocationhttps://uniapp.dcloud.io/api/location/location
iBeaconfeature/ibeaconplus.ibeaconhttps://uniapp.dcloud.io/api/system/ibeacon
IO(文件系统)feature/fileplus.iohttps://uniapp.dcloud.io/api/file/file
LivePusher(直播推流)feature/media-livepusherplus.video.LivePusherhttps://uniapp.dcloud.io/api/media/live-player-context
Maps(高德地图)feature/map-amapplus.maphttps://uniapp.dcloud.io/api/location/map
Maps(百度地图)feature/map-baiduplus.maphttps://uniapp.dcloud.io/api/location/map
Messaging(短彩邮件消息)feature/messagingplus.messaging
Navigator(运行环境信息)feature/navigatoruiplus.navigatorhttps://uniapp.dcloud.io/api/system/info
Oauth(登录基础库)feature/oauthplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(小米登录)feature/oauth-miuiplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(QQ登录)feature/oauth-qqplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(新浪微博登录)feature/oauth-sinaplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(微信登录)feature/oauth-weixinplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Payment(支付基础库)feature/paymentplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(支付宝支付)feature/payment-alipayplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(微信支付)feature/payment-weixinplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Push(推送基础库)feature/apsplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送)feature/aps-igexinplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送-GooglePlay专版)feature/aps-igexin-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送)feature/aps-unipushplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送-GooglePlay专版)feature/aps-unipush-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(小米推送)feature/aps-xiaomiplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Share(分享基础库)feature/shareplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(QQ分享)feature/share-qqplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(新浪微博分享)feature/share-sinaplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(微信分享)feature/share-weixinplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Speech(语音识别基础库)feature/speechplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(百度语音识别)feature/speech_baiduplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(讯飞语音识别)feature/speech_iflyplus.speech
SQLite(数据库)feature/sqliteplus.sqlite
Statistic(友盟统计)feature/statistics-umengplus.statistic
Uploader(文件上传)feature/uploaderplus.uploaderhttps://uniapp.dcloud.io/api/request/network-file?id=uploadfile
VideoPlayer(视频播放)feature/mediaplus.video.VideoPlayerhttps://uniapp.dcloud.io/api/media/video
XHR(网络请求)feature/xhrplus.nethttps://uniapp.dcloud.io/api/request/request?id=request
nvue原生组件: map(高德地图)feature/weex_amap不支持https://uniapp.dcloud.io/component/map
nvue原生组件: barcode(二维码)feature/weex_barcode不支持https://uniapp.dcloud.io/component/barcode
nvue原生组件: live-pusher(直播推流)feature/weex_livepusher不支持https://uniapp.dcloud.io/component/live-pusher
nvue原生组件: video视频feature/weex_videoplayer不支持https://uniapp.dcloud.io/component/video
nvue原生组件: canvasfeature/weex_gcanvas不支持https://github.com/dcloudio/NvueCanvasDemo

源码配置

  • 文件夹中存在build.gradle文件的模块

将源码clone到本地,复制对应文件夹到所在项目的根目录,在setting.gradle中加入module配置,rebuild即可。以高德地图为例,将本工程clone到本地,复制map-amap到项目的根目录,打开setting.gradle,在最底部添加include "map-amap",重新运行即可,如需添加到主工程中,打开主工程的build.gradle文件,在dependencies节点中添加implementation project(path: ':map-amap')即可。

  • 文件夹中不存在build.gradle文件的模块

如果模块中不存在build.gradle文件,可以将文件夹中的目录直接拷贝到主项目中。例如xhr模块,可以将src下的文件夹拷贝到主项目的src下,如果存在其他文件夹(如libs),直接将文件夹下的内容拷贝到同名文件夹下即可。

参考HBuilder-SourceTool-as项目

项目配置及打包

clone HBuilder-SourceTool-as项目到本地,直接运行即可。如果运行uni-app时出现问题,可参考:https://ask.dcloud.net.cn/article/35139。

安卓打包配置参考:https://www.cnblogs.com/lsdb/p/9337342.html。

许可协议

本工程大部分源码开源,使用者可以自主修改已公开的源码,编译新版本。 但注意:

  1. 您不能破解、反向工程、反编译本项目下未开源的各种库文件。
  2. 未经DCloud书面许可,您不得利用本项目的全部或部分源码、文件来制作与DCloud根据本项目提供的服务相竞争的产品,例如提供自主品牌的开发者服务。
  3. DCloud所拥有的知识产权,包括但不限于商标、专利、著作权,并不发生转移或共享。
  4. 您基于本项目,自主开发的代码及输出物,其知识产权归属您所有。除非您通过提交pull request的方式将自己的代码开源。
  5. 如果您没有违反本许可协议,那么你使用本项目将无需为DCloud支付任何费用。

About

HTML5 Plus for Android

Resources

Stars

258 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android平台5+App/uni-app运行环境开源项目

重要:请使用HBuilderX2.3.7-20191024生成本地打包App资源,否则uni-app项目可能提示“运行环境版本和编译器版本不一致”,详情参考https://ask.dcloud.net.cn/article/35627

说明

此次更新梳理了工程结构,现在开发者可以直接修改引擎中的代码,自主编译出新的引擎。

如果开发者要修改本工程源码,请注意“引擎”和“插件”的分界线。 “引擎”是对5+/uni-app规范的实现,修改引擎源码可以优化对规范的实现,但不是提供规范外的功能。规范外的功能,应该做成“插件”。如需公开,则放到插件市场。 比如扫码,5+/uni-app的规范已经存在,但开发者对扫码效率不满意,提供自己更好的实现,则可以改动本源码,重新Build引擎。 而如果是想新增一个ar功能,则应该做成插件,而不是加入到本工程中。即,开发者不能自主新增5+/uni-app的js API规范。

任何一个项目的源码,吃透整体都不是一件容易的事情。一般开发者有改动需求,也多集中在一些能力或SDK的实现上。 比如扫码、视频、地图、直播、摄像头、相册、蓝牙等,以及某些界面的文字。 只关注某些能力模块,吃透和修改会更加容易。

受精力所限,某些模块,比如DCloud定制过的weex源码,还未规整好,暂时以库的方式提供,未来会提供完整源码。不过这不影响开发者修改其他源码和编译工程。

模块与源码对应关系

功能模块源码目录5+APP项目uni-app项目
Audio(音频)feature/audioplus.audiohttps://uniapp.dcloud.io/api/media/record-managerhttps://uniapp.dcloud.io/api/media/audio-context
Audio(MP3格式音频支持库)feature/audio-mp3accplus.audio
Barcode(二维码)feature/barcodeplus.barcodehttps://uniapp.dcloud.io/api/system/barcode
Bluetooth(低功耗蓝牙)feature/bluetoothplus.bluetoothhttps://uniapp.dcloud.io/api/system/bluetooth
Camera(摄像头)feature/cameraplus.camera
Contacts(通讯录)feature/contactsplus.contacts
Device(设备信息)feature/deviceplus.devicehttps://uniapp.dcloud.io/api/system/info
Downloader(文件下载)feature/downloaderplus.downloaderhttps://uniapp.dcloud.io/api/request/network-file?id=downloadfile
Fingerprint(指纹识别)feature/fingerprintplus.fingerprinthttps://uniapp.dcloud.io/api/other/authentication
Geolocation(基础定位库)feature/geolacationplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(高德定位)feature/geolacation-amapplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(百度定位)feature/geolacation-baiduplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(系统定位)feature/geolacation-systemplus.geolocationhttps://uniapp.dcloud.io/api/location/location
iBeaconfeature/ibeaconplus.ibeaconhttps://uniapp.dcloud.io/api/system/ibeacon
IO(文件系统)feature/fileplus.iohttps://uniapp.dcloud.io/api/file/file
LivePusher(直播推流)feature/media-livepusherplus.video.LivePusherhttps://uniapp.dcloud.io/api/media/live-player-context
Maps(高德地图)feature/map-amapplus.maphttps://uniapp.dcloud.io/api/location/map
Maps(百度地图)feature/map-baiduplus.maphttps://uniapp.dcloud.io/api/location/map
Messaging(短彩邮件消息)feature/messagingplus.messaging
Navigator(运行环境信息)feature/navigatoruiplus.navigatorhttps://uniapp.dcloud.io/api/system/info
Oauth(登录基础库)feature/oauthplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(小米登录)feature/oauth-miuiplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(QQ登录)feature/oauth-qqplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(新浪微博登录)feature/oauth-sinaplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(微信登录)feature/oauth-weixinplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Payment(支付基础库)feature/paymentplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(支付宝支付)feature/payment-alipayplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(微信支付)feature/payment-weixinplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Push(推送基础库)feature/apsplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送)feature/aps-igexinplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送-GooglePlay专版)feature/aps-igexin-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送)feature/aps-unipushplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送-GooglePlay专版)feature/aps-unipush-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(小米推送)feature/aps-xiaomiplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Share(分享基础库)feature/shareplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(QQ分享)feature/share-qqplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(新浪微博分享)feature/share-sinaplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(微信分享)feature/share-weixinplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Speech(语音识别基础库)feature/speechplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(百度语音识别)feature/speech_baiduplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(讯飞语音识别)feature/speech_iflyplus.speech
SQLite(数据库)feature/sqliteplus.sqlite
Statistic(友盟统计)feature/statistics-umengplus.statistic
Uploader(文件上传)feature/uploaderplus.uploaderhttps://uniapp.dcloud.io/api/request/network-file?id=uploadfile
VideoPlayer(视频播放)feature/mediaplus.video.VideoPlayerhttps://uniapp.dcloud.io/api/media/video
XHR(网络请求)feature/xhrplus.nethttps://uniapp.dcloud.io/api/request/request?id=request
nvue原生组件: map(高德地图)feature/weex_amap不支持https://uniapp.dcloud.io/component/map
nvue原生组件: barcode(二维码)feature/weex_barcode不支持https://uniapp.dcloud.io/component/barcode
nvue原生组件: live-pusher(直播推流)feature/weex_livepusher不支持https://uniapp.dcloud.io/component/live-pusher
nvue原生组件: video视频feature/weex_videoplayer不支持https://uniapp.dcloud.io/component/video
nvue原生组件: canvasfeature/weex_gcanvas不支持https://github.com/dcloudio/NvueCanvasDemo

源码配置

  • 文件夹中存在build.gradle文件的模块

将源码clone到本地,复制对应文件夹到所在项目的根目录,在setting.gradle中加入module配置,rebuild即可。以高德地图为例,将本工程clone到本地,复制map-amap到项目的根目录,打开setting.gradle,在最底部添加include "map-amap",重新运行即可,如需添加到主工程中,打开主工程的build.gradle文件,在dependencies节点中添加implementation project(path: ':map-amap')即可。

  • 文件夹中不存在build.gradle文件的模块

如果模块中不存在build.gradle文件,可以将文件夹中的目录直接拷贝到主项目中。例如xhr模块,可以将src下的文件夹拷贝到主项目的src下,如果存在其他文件夹(如libs),直接将文件夹下的内容拷贝到同名文件夹下即可。

参考HBuilder-SourceTool-as项目

项目配置及打包

clone HBuilder-SourceTool-as项目到本地,直接运行即可。如果运行uni-app时出现问题,可参考:https://ask.dcloud.net.cn/article/35139。

安卓打包配置参考:https://www.cnblogs.com/lsdb/p/9337342.html。

许可协议

本工程大部分源码开源,使用者可以自主修改已公开的源码,编译新版本。 但注意:

  1. 您不能破解、反向工程、反编译本项目下未开源的各种库文件。
  2. 未经DCloud书面许可,您不得利用本项目的全部或部分源码、文件来制作与DCloud根据本项目提供的服务相竞争的产品,例如提供自主品牌的开发者服务。
  3. DCloud所拥有的知识产权,包括但不限于商标、专利、著作权,并不发生转移或共享。
  4. 您基于本项目,自主开发的代码及输出物,其知识产权归属您所有。除非您通过提交pull request的方式将自己的代码开源。
  5. 如果您没有违反本许可协议,那么你使用本项目将无需为DCloud支付任何费用。

About

HTML5 Plus for Android

Resources

Stars

258 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android平台5+App/uni-app运行环境开源项目

重要:请使用HBuilderX2.3.7-20191024生成本地打包App资源,否则uni-app项目可能提示“运行环境版本和编译器版本不一致”,详情参考https://ask.dcloud.net.cn/article/35627

说明

此次更新梳理了工程结构,现在开发者可以直接修改引擎中的代码,自主编译出新的引擎。

如果开发者要修改本工程源码,请注意“引擎”和“插件”的分界线。 “引擎”是对5+/uni-app规范的实现,修改引擎源码可以优化对规范的实现,但不是提供规范外的功能。规范外的功能,应该做成“插件”。如需公开,则放到插件市场。 比如扫码,5+/uni-app的规范已经存在,但开发者对扫码效率不满意,提供自己更好的实现,则可以改动本源码,重新Build引擎。 而如果是想新增一个ar功能,则应该做成插件,而不是加入到本工程中。即,开发者不能自主新增5+/uni-app的js API规范。

任何一个项目的源码,吃透整体都不是一件容易的事情。一般开发者有改动需求,也多集中在一些能力或SDK的实现上。 比如扫码、视频、地图、直播、摄像头、相册、蓝牙等,以及某些界面的文字。 只关注某些能力模块,吃透和修改会更加容易。

受精力所限,某些模块,比如DCloud定制过的weex源码,还未规整好,暂时以库的方式提供,未来会提供完整源码。不过这不影响开发者修改其他源码和编译工程。

模块与源码对应关系

功能模块源码目录5+APP项目uni-app项目
Audio(音频)feature/audioplus.audiohttps://uniapp.dcloud.io/api/media/record-managerhttps://uniapp.dcloud.io/api/media/audio-context
Audio(MP3格式音频支持库)feature/audio-mp3accplus.audio
Barcode(二维码)feature/barcodeplus.barcodehttps://uniapp.dcloud.io/api/system/barcode
Bluetooth(低功耗蓝牙)feature/bluetoothplus.bluetoothhttps://uniapp.dcloud.io/api/system/bluetooth
Camera(摄像头)feature/cameraplus.camera
Contacts(通讯录)feature/contactsplus.contacts
Device(设备信息)feature/deviceplus.devicehttps://uniapp.dcloud.io/api/system/info
Downloader(文件下载)feature/downloaderplus.downloaderhttps://uniapp.dcloud.io/api/request/network-file?id=downloadfile
Fingerprint(指纹识别)feature/fingerprintplus.fingerprinthttps://uniapp.dcloud.io/api/other/authentication
Geolocation(基础定位库)feature/geolacationplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(高德定位)feature/geolacation-amapplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(百度定位)feature/geolacation-baiduplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(系统定位)feature/geolacation-systemplus.geolocationhttps://uniapp.dcloud.io/api/location/location
iBeaconfeature/ibeaconplus.ibeaconhttps://uniapp.dcloud.io/api/system/ibeacon
IO(文件系统)feature/fileplus.iohttps://uniapp.dcloud.io/api/file/file
LivePusher(直播推流)feature/media-livepusherplus.video.LivePusherhttps://uniapp.dcloud.io/api/media/live-player-context
Maps(高德地图)feature/map-amapplus.maphttps://uniapp.dcloud.io/api/location/map
Maps(百度地图)feature/map-baiduplus.maphttps://uniapp.dcloud.io/api/location/map
Messaging(短彩邮件消息)feature/messagingplus.messaging
Navigator(运行环境信息)feature/navigatoruiplus.navigatorhttps://uniapp.dcloud.io/api/system/info
Oauth(登录基础库)feature/oauthplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(小米登录)feature/oauth-miuiplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(QQ登录)feature/oauth-qqplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(新浪微博登录)feature/oauth-sinaplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(微信登录)feature/oauth-weixinplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Payment(支付基础库)feature/paymentplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(支付宝支付)feature/payment-alipayplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(微信支付)feature/payment-weixinplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Push(推送基础库)feature/apsplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送)feature/aps-igexinplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送-GooglePlay专版)feature/aps-igexin-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送)feature/aps-unipushplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送-GooglePlay专版)feature/aps-unipush-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(小米推送)feature/aps-xiaomiplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Share(分享基础库)feature/shareplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(QQ分享)feature/share-qqplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(新浪微博分享)feature/share-sinaplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(微信分享)feature/share-weixinplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Speech(语音识别基础库)feature/speechplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(百度语音识别)feature/speech_baiduplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(讯飞语音识别)feature/speech_iflyplus.speech
SQLite(数据库)feature/sqliteplus.sqlite
Statistic(友盟统计)feature/statistics-umengplus.statistic
Uploader(文件上传)feature/uploaderplus.uploaderhttps://uniapp.dcloud.io/api/request/network-file?id=uploadfile
VideoPlayer(视频播放)feature/mediaplus.video.VideoPlayerhttps://uniapp.dcloud.io/api/media/video
XHR(网络请求)feature/xhrplus.nethttps://uniapp.dcloud.io/api/request/request?id=request
nvue原生组件: map(高德地图)feature/weex_amap不支持https://uniapp.dcloud.io/component/map
nvue原生组件: barcode(二维码)feature/weex_barcode不支持https://uniapp.dcloud.io/component/barcode
nvue原生组件: live-pusher(直播推流)feature/weex_livepusher不支持https://uniapp.dcloud.io/component/live-pusher
nvue原生组件: video视频feature/weex_videoplayer不支持https://uniapp.dcloud.io/component/video
nvue原生组件: canvasfeature/weex_gcanvas不支持https://github.com/dcloudio/NvueCanvasDemo

源码配置

  • 文件夹中存在build.gradle文件的模块

将源码clone到本地,复制对应文件夹到所在项目的根目录,在setting.gradle中加入module配置,rebuild即可。以高德地图为例,将本工程clone到本地,复制map-amap到项目的根目录,打开setting.gradle,在最底部添加include "map-amap",重新运行即可,如需添加到主工程中,打开主工程的build.gradle文件,在dependencies节点中添加implementation project(path: ':map-amap')即可。

  • 文件夹中不存在build.gradle文件的模块

如果模块中不存在build.gradle文件,可以将文件夹中的目录直接拷贝到主项目中。例如xhr模块,可以将src下的文件夹拷贝到主项目的src下,如果存在其他文件夹(如libs),直接将文件夹下的内容拷贝到同名文件夹下即可。

参考HBuilder-SourceTool-as项目

项目配置及打包

clone HBuilder-SourceTool-as项目到本地,直接运行即可。如果运行uni-app时出现问题,可参考:https://ask.dcloud.net.cn/article/35139。

安卓打包配置参考:https://www.cnblogs.com/lsdb/p/9337342.html。

许可协议

本工程大部分源码开源,使用者可以自主修改已公开的源码,编译新版本。 但注意:

  1. 您不能破解、反向工程、反编译本项目下未开源的各种库文件。
  2. 未经DCloud书面许可,您不得利用本项目的全部或部分源码、文件来制作与DCloud根据本项目提供的服务相竞争的产品,例如提供自主品牌的开发者服务。
  3. DCloud所拥有的知识产权,包括但不限于商标、专利、著作权,并不发生转移或共享。
  4. 您基于本项目,自主开发的代码及输出物,其知识产权归属您所有。除非您通过提交pull request的方式将自己的代码开源。
  5. 如果您没有违反本许可协议,那么你使用本项目将无需为DCloud支付任何费用。

About

HTML5 Plus for Android

Resources

Stars

258 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android平台5+App/uni-app运行环境开源项目

重要:请使用HBuilderX2.3.7-20191024生成本地打包App资源,否则uni-app项目可能提示“运行环境版本和编译器版本不一致”,详情参考https://ask.dcloud.net.cn/article/35627

说明

此次更新梳理了工程结构,现在开发者可以直接修改引擎中的代码,自主编译出新的引擎。

如果开发者要修改本工程源码,请注意“引擎”和“插件”的分界线。 “引擎”是对5+/uni-app规范的实现,修改引擎源码可以优化对规范的实现,但不是提供规范外的功能。规范外的功能,应该做成“插件”。如需公开,则放到插件市场。 比如扫码,5+/uni-app的规范已经存在,但开发者对扫码效率不满意,提供自己更好的实现,则可以改动本源码,重新Build引擎。 而如果是想新增一个ar功能,则应该做成插件,而不是加入到本工程中。即,开发者不能自主新增5+/uni-app的js API规范。

任何一个项目的源码,吃透整体都不是一件容易的事情。一般开发者有改动需求,也多集中在一些能力或SDK的实现上。 比如扫码、视频、地图、直播、摄像头、相册、蓝牙等,以及某些界面的文字。 只关注某些能力模块,吃透和修改会更加容易。

受精力所限,某些模块,比如DCloud定制过的weex源码,还未规整好,暂时以库的方式提供,未来会提供完整源码。不过这不影响开发者修改其他源码和编译工程。

模块与源码对应关系

功能模块源码目录5+APP项目uni-app项目
Audio(音频)feature/audioplus.audiohttps://uniapp.dcloud.io/api/media/record-managerhttps://uniapp.dcloud.io/api/media/audio-context
Audio(MP3格式音频支持库)feature/audio-mp3accplus.audio
Barcode(二维码)feature/barcodeplus.barcodehttps://uniapp.dcloud.io/api/system/barcode
Bluetooth(低功耗蓝牙)feature/bluetoothplus.bluetoothhttps://uniapp.dcloud.io/api/system/bluetooth
Camera(摄像头)feature/cameraplus.camera
Contacts(通讯录)feature/contactsplus.contacts
Device(设备信息)feature/deviceplus.devicehttps://uniapp.dcloud.io/api/system/info
Downloader(文件下载)feature/downloaderplus.downloaderhttps://uniapp.dcloud.io/api/request/network-file?id=downloadfile
Fingerprint(指纹识别)feature/fingerprintplus.fingerprinthttps://uniapp.dcloud.io/api/other/authentication
Geolocation(基础定位库)feature/geolacationplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(高德定位)feature/geolacation-amapplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(百度定位)feature/geolacation-baiduplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(系统定位)feature/geolacation-systemplus.geolocationhttps://uniapp.dcloud.io/api/location/location
iBeaconfeature/ibeaconplus.ibeaconhttps://uniapp.dcloud.io/api/system/ibeacon
IO(文件系统)feature/fileplus.iohttps://uniapp.dcloud.io/api/file/file
LivePusher(直播推流)feature/media-livepusherplus.video.LivePusherhttps://uniapp.dcloud.io/api/media/live-player-context
Maps(高德地图)feature/map-amapplus.maphttps://uniapp.dcloud.io/api/location/map
Maps(百度地图)feature/map-baiduplus.maphttps://uniapp.dcloud.io/api/location/map
Messaging(短彩邮件消息)feature/messagingplus.messaging
Navigator(运行环境信息)feature/navigatoruiplus.navigatorhttps://uniapp.dcloud.io/api/system/info
Oauth(登录基础库)feature/oauthplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(小米登录)feature/oauth-miuiplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(QQ登录)feature/oauth-qqplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(新浪微博登录)feature/oauth-sinaplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(微信登录)feature/oauth-weixinplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Payment(支付基础库)feature/paymentplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(支付宝支付)feature/payment-alipayplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(微信支付)feature/payment-weixinplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Push(推送基础库)feature/apsplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送)feature/aps-igexinplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送-GooglePlay专版)feature/aps-igexin-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送)feature/aps-unipushplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送-GooglePlay专版)feature/aps-unipush-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(小米推送)feature/aps-xiaomiplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Share(分享基础库)feature/shareplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(QQ分享)feature/share-qqplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(新浪微博分享)feature/share-sinaplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(微信分享)feature/share-weixinplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Speech(语音识别基础库)feature/speechplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(百度语音识别)feature/speech_baiduplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(讯飞语音识别)feature/speech_iflyplus.speech
SQLite(数据库)feature/sqliteplus.sqlite
Statistic(友盟统计)feature/statistics-umengplus.statistic
Uploader(文件上传)feature/uploaderplus.uploaderhttps://uniapp.dcloud.io/api/request/network-file?id=uploadfile
VideoPlayer(视频播放)feature/mediaplus.video.VideoPlayerhttps://uniapp.dcloud.io/api/media/video
XHR(网络请求)feature/xhrplus.nethttps://uniapp.dcloud.io/api/request/request?id=request
nvue原生组件: map(高德地图)feature/weex_amap不支持https://uniapp.dcloud.io/component/map
nvue原生组件: barcode(二维码)feature/weex_barcode不支持https://uniapp.dcloud.io/component/barcode
nvue原生组件: live-pusher(直播推流)feature/weex_livepusher不支持https://uniapp.dcloud.io/component/live-pusher
nvue原生组件: video视频feature/weex_videoplayer不支持https://uniapp.dcloud.io/component/video
nvue原生组件: canvasfeature/weex_gcanvas不支持https://github.com/dcloudio/NvueCanvasDemo

源码配置

  • 文件夹中存在build.gradle文件的模块

将源码clone到本地,复制对应文件夹到所在项目的根目录,在setting.gradle中加入module配置,rebuild即可。以高德地图为例,将本工程clone到本地,复制map-amap到项目的根目录,打开setting.gradle,在最底部添加include "map-amap",重新运行即可,如需添加到主工程中,打开主工程的build.gradle文件,在dependencies节点中添加implementation project(path: ':map-amap')即可。

  • 文件夹中不存在build.gradle文件的模块

如果模块中不存在build.gradle文件,可以将文件夹中的目录直接拷贝到主项目中。例如xhr模块,可以将src下的文件夹拷贝到主项目的src下,如果存在其他文件夹(如libs),直接将文件夹下的内容拷贝到同名文件夹下即可。

参考HBuilder-SourceTool-as项目

项目配置及打包

clone HBuilder-SourceTool-as项目到本地,直接运行即可。如果运行uni-app时出现问题,可参考:https://ask.dcloud.net.cn/article/35139。

安卓打包配置参考:https://www.cnblogs.com/lsdb/p/9337342.html。

许可协议

本工程大部分源码开源,使用者可以自主修改已公开的源码,编译新版本。 但注意:

  1. 您不能破解、反向工程、反编译本项目下未开源的各种库文件。
  2. 未经DCloud书面许可,您不得利用本项目的全部或部分源码、文件来制作与DCloud根据本项目提供的服务相竞争的产品,例如提供自主品牌的开发者服务。
  3. DCloud所拥有的知识产权,包括但不限于商标、专利、著作权,并不发生转移或共享。
  4. 您基于本项目,自主开发的代码及输出物,其知识产权归属您所有。除非您通过提交pull request的方式将自己的代码开源。
  5. 如果您没有违反本许可协议,那么你使用本项目将无需为DCloud支付任何费用。

About

HTML5 Plus for Android

Resources

Stars

258 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android平台5+App/uni-app运行环境开源项目

重要:请使用HBuilderX2.3.7-20191024生成本地打包App资源,否则uni-app项目可能提示“运行环境版本和编译器版本不一致”,详情参考https://ask.dcloud.net.cn/article/35627

说明

此次更新梳理了工程结构,现在开发者可以直接修改引擎中的代码,自主编译出新的引擎。

如果开发者要修改本工程源码,请注意“引擎”和“插件”的分界线。 “引擎”是对5+/uni-app规范的实现,修改引擎源码可以优化对规范的实现,但不是提供规范外的功能。规范外的功能,应该做成“插件”。如需公开,则放到插件市场。 比如扫码,5+/uni-app的规范已经存在,但开发者对扫码效率不满意,提供自己更好的实现,则可以改动本源码,重新Build引擎。 而如果是想新增一个ar功能,则应该做成插件,而不是加入到本工程中。即,开发者不能自主新增5+/uni-app的js API规范。

任何一个项目的源码,吃透整体都不是一件容易的事情。一般开发者有改动需求,也多集中在一些能力或SDK的实现上。 比如扫码、视频、地图、直播、摄像头、相册、蓝牙等,以及某些界面的文字。 只关注某些能力模块,吃透和修改会更加容易。

受精力所限,某些模块,比如DCloud定制过的weex源码,还未规整好,暂时以库的方式提供,未来会提供完整源码。不过这不影响开发者修改其他源码和编译工程。

模块与源码对应关系

功能模块源码目录5+APP项目uni-app项目
Audio(音频)feature/audioplus.audiohttps://uniapp.dcloud.io/api/media/record-managerhttps://uniapp.dcloud.io/api/media/audio-context
Audio(MP3格式音频支持库)feature/audio-mp3accplus.audio
Barcode(二维码)feature/barcodeplus.barcodehttps://uniapp.dcloud.io/api/system/barcode
Bluetooth(低功耗蓝牙)feature/bluetoothplus.bluetoothhttps://uniapp.dcloud.io/api/system/bluetooth
Camera(摄像头)feature/cameraplus.camera
Contacts(通讯录)feature/contactsplus.contacts
Device(设备信息)feature/deviceplus.devicehttps://uniapp.dcloud.io/api/system/info
Downloader(文件下载)feature/downloaderplus.downloaderhttps://uniapp.dcloud.io/api/request/network-file?id=downloadfile
Fingerprint(指纹识别)feature/fingerprintplus.fingerprinthttps://uniapp.dcloud.io/api/other/authentication
Geolocation(基础定位库)feature/geolacationplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(高德定位)feature/geolacation-amapplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(百度定位)feature/geolacation-baiduplus.geolocationhttps://uniapp.dcloud.io/api/location/location
Geolocation(系统定位)feature/geolacation-systemplus.geolocationhttps://uniapp.dcloud.io/api/location/location
iBeaconfeature/ibeaconplus.ibeaconhttps://uniapp.dcloud.io/api/system/ibeacon
IO(文件系统)feature/fileplus.iohttps://uniapp.dcloud.io/api/file/file
LivePusher(直播推流)feature/media-livepusherplus.video.LivePusherhttps://uniapp.dcloud.io/api/media/live-player-context
Maps(高德地图)feature/map-amapplus.maphttps://uniapp.dcloud.io/api/location/map
Maps(百度地图)feature/map-baiduplus.maphttps://uniapp.dcloud.io/api/location/map
Messaging(短彩邮件消息)feature/messagingplus.messaging
Navigator(运行环境信息)feature/navigatoruiplus.navigatorhttps://uniapp.dcloud.io/api/system/info
Oauth(登录基础库)feature/oauthplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(小米登录)feature/oauth-miuiplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(QQ登录)feature/oauth-qqplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(新浪微博登录)feature/oauth-sinaplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Oauth(微信登录)feature/oauth-weixinplus.oauthhttps://uniapp.dcloud.io/api/plugins/login
Payment(支付基础库)feature/paymentplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(支付宝支付)feature/payment-alipayplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Payment(微信支付)feature/payment-weixinplus.paymenthttps://uniapp.dcloud.io/api/plugins/payment
Push(推送基础库)feature/apsplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送)feature/aps-igexinplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(个推推送-GooglePlay专版)feature/aps-igexin-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送)feature/aps-unipushplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(UniPush推送-GooglePlay专版)feature/aps-unipush-gpplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Push(小米推送)feature/aps-xiaomiplus.pushhttps://uniapp.dcloud.io/api/plugins/push
Share(分享基础库)feature/shareplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(QQ分享)feature/share-qqplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(新浪微博分享)feature/share-sinaplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Share(微信分享)feature/share-weixinplus.sharehttps://uniapp.dcloud.io/api/plugins/share
Speech(语音识别基础库)feature/speechplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(百度语音识别)feature/speech_baiduplus.speechhttps://uniapp.dcloud.io/api/plugins/voice
Speech(讯飞语音识别)feature/speech_iflyplus.speech
SQLite(数据库)feature/sqliteplus.sqlite
Statistic(友盟统计)feature/statistics-umengplus.statistic
Uploader(文件上传)feature/uploaderplus.uploaderhttps://uniapp.dcloud.io/api/request/network-file?id=uploadfile
VideoPlayer(视频播放)feature/mediaplus.video.VideoPlayerhttps://uniapp.dcloud.io/api/media/video
XHR(网络请求)feature/xhrplus.nethttps://uniapp.dcloud.io/api/request/request?id=request
nvue原生组件: map(高德地图)feature/weex_amap不支持https://uniapp.dcloud.io/component/map
nvue原生组件: barcode(二维码)feature/weex_barcode不支持https://uniapp.dcloud.io/component/barcode
nvue原生组件: live-pusher(直播推流)feature/weex_livepusher不支持https://uniapp.dcloud.io/component/live-pusher
nvue原生组件: video视频feature/weex_videoplayer不支持https://uniapp.dcloud.io/component/video
nvue原生组件: canvasfeature/weex_gcanvas不支持https://github.com/dcloudio/NvueCanvasDemo

源码配置

  • 文件夹中存在build.gradle文件的模块

将源码clone到本地,复制对应文件夹到所在项目的根目录,在setting.gradle中加入module配置,rebuild即可。以高德地图为例,将本工程clone到本地,复制map-amap到项目的根目录,打开setting.gradle,在最底部添加include "map-amap",重新运行即可,如需添加到主工程中,打开主工程的build.gradle文件,在dependencies节点中添加implementation project(path: ':map-amap')即可。

  • 文件夹中不存在build.gradle文件的模块

如果模块中不存在build.gradle文件,可以将文件夹中的目录直接拷贝到主项目中。例如xhr模块,可以将src下的文件夹拷贝到主项目的src下,如果存在其他文件夹(如libs),直接将文件夹下的内容拷贝到同名文件夹下即可。

参考HBuilder-SourceTool-as项目

项目配置及打包

clone HBuilder-SourceTool-as项目到本地,直接运行即可。如果运行uni-app时出现问题,可参考:https://ask.dcloud.net.cn/article/35139。

安卓打包配置参考:https://www.cnblogs.com/lsdb/p/9337342.html。

许可协议

本工程大部分源码开源,使用者可以自主修改已公开的源码,编译新版本。 但注意:

  1. 您不能破解、反向工程、反编译本项目下未开源的各种库文件。
  2. 未经DCloud书面许可,您不得利用本项目的全部或部分源码、文件来制作与DCloud根据本项目提供的服务相竞争的产品,例如提供自主品牌的开发者服务。
  3. DCloud所拥有的知识产权,包括但不限于商标、专利、著作权,并不发生转移或共享。
  4. 您基于本项目,自主开发的代码及输出物,其知识产权归属您所有。除非您通过提交pull request的方式将自己的代码开源。
  5. 如果您没有违反本许可协议,那么你使用本项目将无需为DCloud支付任何费用。

About

HTML5 Plus for Android

Resources

Stars

258 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages