├── app.js
├── .gitattributes
├── sitemap.json
├── pages
└── index
│ ├── index.json
│ ├── index.wxml
│ ├── index.wxss
│ └── index.js
├── app.wxss
├── app.json
├── utils
├── util.js
└── base64.js
├── project.config.json
├── README.md
└── LICENSE
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | onLaunch: function () {
4 |
5 | },
6 | globalData: {
7 | userInfo: null
8 | }
9 | })
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=JavaScript
2 | *.wxss linguist-language=JavaScript
3 | *.wxml linguist-language=JavaScript
4 | *.php linguist-language=PHP
5 |
--------------------------------------------------------------------------------
/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "二维码/条形码解码器",
3 | "backgroundTextStyle": "light",
4 | "navigationBarBackgroundColor": "#46cdaf",
5 | "navigationBarTextStyle": "white"
6 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | .container {
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | align-items: center;
7 | justify-content: space-between;
8 | padding: 200rpx 0;
9 | box-sizing: border-box;
10 | }
11 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages":[
3 | "pages/index/index"
4 | ],
5 | "window":{
6 | "backgroundTextStyle":"light",
7 | "navigationBarBackgroundColor": "#fff",
8 | "navigationBarTitleText": "二维码解码器",
9 | "navigationBarTextStyle":"black"
10 | },
11 | "style": "v2",
12 | "sitemapLocation": "sitemap.json"
13 | }
14 |
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 二维码/条形码解码结果:
5 | {{location}}
6 |
7 | 选择二维码/条形码图片
8 |
9 | 【提示】随着二维码(条形码)的流行,二维码(条形码)的安全问题受到越来越多的重视。本工具可以快捷地解码二维码(条形码)图片中隐藏的内容,用于安全检测,判断二维码(条形码)内容是否含有假冒、违法或者病毒等有害信息。
10 |
11 |
12 |
13 | ©caozha.com 草札
14 |
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件",
3 | "packOptions": {
4 | "ignore": []
5 | },
6 | "setting": {
7 | "urlCheck": true,
8 | "es6": true,
9 | "postcss": true,
10 | "preloadBackgroundData": false,
11 | "minified": true,
12 | "newFeature": true,
13 | "autoAudits": false,
14 | "coverView": true,
15 | "showShadowRootInWxmlPanel": true,
16 | "scopeDataCheck": false
17 | },
18 | "compileType": "miniprogram",
19 | "libVersion": "2.11.0",
20 | "appid": "wx932e1c5c85a8dc43",
21 | "projectname": "%E4%BA%8C%E7%BB%B4%E7%A0%81%E8%A7%A3%E7%A0%81%E5%99%A8",
22 | "debugOptions": {
23 | "hidedInDevtools": []
24 | },
25 | "isGameTourist": false,
26 | "simulatorType": "wechat",
27 | "simulatorPluginLibVersion": {},
28 | "condition": {
29 | "search": {
30 | "current": -1,
31 | "list": []
32 | },
33 | "conversation": {
34 | "current": -1,
35 | "list": []
36 | },
37 | "game": {
38 | "currentL": -1,
39 | "list": []
40 | },
41 | "miniprogram": {
42 | "current": -1,
43 | "list": []
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 二维码(条形码)解码器
2 |
3 | 二维码(条形码)解码器,一款微信小程序。可以实时识别二维码和条形码的内容,方便您鉴别二维码内容是否真实,是否安全。
4 |
5 | ### 更新说明:
6 |
7 | 此源码为1.0.0版本。
8 |
9 | 无需任何后端,利用微信小程序原生API即可完成全部功能。
10 |
11 | 支持本程序,请到Gitee和GitHub给我们点Star!
12 |
13 | Gitee:https://gitee.com/dengzhenhua/qrcode-decoder
14 |
15 | GitHub:https://github.com/dengcao/qrcode-decoder
16 |
17 | ### 安装方法
18 |
19 | 使用微信开发者工具设置一下您的appid等信息,然后上传到微信小程序即可。
20 |
21 | ### 关于
22 |
23 | 开发:[邓草博客 blog.5300.cn](http://blog.5300.cn)
24 |
25 | 赞助:[品络互联 www.pinluo.com](http://www.pinluo.com) [AI工具箱 5300.cn](http://5300.cn) [汉语言文学网 hyywx.com](http://hyywx.com) [雄马 xiongma.cn](http://xiongma.cn) [优惠券 tm.gs](http://tm.gs)
26 |
27 | ### 扫码体验
28 | 
29 |
30 | **扫码打开“工具大全”,点击:“二维码解码”,即可体验此小程序。**
31 |
32 | ### 界面预览
33 |
34 |  
35 |
36 |
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/index.wxss */
2 | .ipimg{
3 | width: 128rpx;
4 | height: 128rpx;
5 | border-radius: 50%;
6 | margin: 20rpx auto;
7 | }
8 | .root {
9 | width: 100%;
10 | display: flex;
11 | flex-direction: column;
12 | justify-content: center;
13 | align-items: center;
14 | }
15 |
16 | .ip-input {
17 | border: 1px solid gainsboro;
18 | margin-left: 50rpx;
19 | margin-right: 50rpx;
20 | height: 60rpx;
21 | font-size: 35rpx;
22 | width: 80%;
23 | }
24 |
25 | .query-button {
26 | margin-top: 30rpx;
27 | }
28 |
29 | .ip-value {
30 | margin-top: 50rpx;
31 | text-algin:center;
32 | }
33 | .ip-value2{
34 | width: 140px; height: 140px; background-color: #efefef;border:1px dashed #3d8d07;margin:0 auto;
35 | }
36 | .ip-value3{
37 | width: 140px; height: 140px;
38 | font-size: 12px;color:rgb(16, 172, 94);
39 | text-align: center;
40 | display: table-cell;
41 | vertical-align:middle;
42 | }
43 |
44 | .location {
45 | margin-top: 30rpx;
46 | }
47 | .location_r{
48 | flex-flow: row wrap;
49 | background-color:#FFF;
50 | padding:15px;
51 | border:1px dashed #F33;
52 | word-break:break-all;
53 | word-wrap:break-word;
54 | margin-top: 18rpx;
55 | }
56 | .location2 {
57 | margin-top: 30rpx;
58 | font-size: 16px;
59 | color: #888;
60 | flex-flow: row wrap;
61 | }
62 | .jieguo{font-size: 35rpx;text-align: left;width: 90%;}
63 | .banquan{
64 | clear: both;
65 | padding: 100rpx 0 80rpx 0;
66 | text-align:center;
67 | font-size: 14px;
68 | color:#999;
69 | font-family:Arial, Helvetica, sans-serif;
70 | }
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
3 | ☆ ☆
4 | ☆ 系 统:二维码(条形码)解码器 ☆
5 | ☆ 日 期:2019-07-13 ☆
6 | ☆ 开 发:草札(www.caozha.com) ☆
7 | ☆ 鸣 谢:穷店(www.qiongdian.com) 品络(www.pinluo.com) ☆
8 | ☆ 声 明: 使用本程序源码必须保留此版权声明等相关信息! ☆
9 | ☆ Copyright ©2020 www.caozha.com All Rights Reserved. ☆
10 | ☆ ☆
11 | ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
12 | */
13 | // pages/index/index.js
14 | const base64 = require("../../utils/base64.js");
15 | var app = getApp();
16 | Page({
17 | data:{
18 | banquan: app.globalData.banquan,
19 | ip: '',
20 | show_r: '',
21 | show_img: 'yes',
22 | imageBase64Str: '',
23 | location: '',
24 | height: '100%'
25 | },
26 |
27 | banquan: function () {
28 |
29 | },
30 |
31 | queryIp: function (res) {
32 | let that = this;
33 | // 允许从相机和相册扫码
34 | wx.scanCode({
35 | success(res) {
36 | console.log(res);
37 | var location_text = "";
38 |
39 | if (res.result == "*" || res.result == ""){
40 | location_text = "【解码后内容】:" + base64.decode(res.rawData);
41 | }else{
42 | location_text = "【解码后内容】:" + res.result;
43 | }
44 |
45 | location_text = location_text + "\r\n\n【解码类型】:" + res.scanType;
46 |
47 | if (res.scanType == "QR_CODE" || res.scanType == "DATA_MATRIX" || res.scanType == "PDF_417"){
48 | location_text = location_text+"(二维码)";
49 | } else if (res.scanType == "WX_CODE"){
50 | location_text = location_text + "(小程序码)";
51 | }else{
52 | location_text = location_text + "(一维码)";
53 | }
54 | location_text = location_text + "\r\n\n【字符集】:" + res.charSet;
55 | if (res.path != "undefined" && res.path != "" && res.path != null ){
56 | location_text = location_text + "\r\n\n【Path】:" + res.path;
57 | }
58 |
59 | that.setData({
60 | show_r: 'yes',
61 | show_img: '',
62 | location: location_text
63 | })
64 | },
65 | fail(res) {
66 | console.log(res);
67 | /*that.setData({
68 | show_r: 'yes',
69 | show_img: '',
70 | location: "识别错误:\r\n" + res.errMsg
71 | })*/
72 | },
73 | complete(res) {
74 |
75 | }
76 | })
77 | },
78 |
79 | // 一键复制事件
80 | copyBtn: function (e) {
81 | var that = this;
82 | wx.setClipboardData({
83 | //准备复制的数据
84 | data: that.data.location,
85 | success: function (res) {
86 | wx.showToast({
87 | title: '复制成功',
88 | });
89 | }
90 | });
91 | },
92 |
93 | onLoad:function(options){
94 | // 页面初始化 options为页面跳转所带来的参数
95 | },
96 | onReady:function(){
97 | // 页面渲染完成
98 |
99 | },
100 | /**
101 | * 生命周期函数--监听页面显示
102 | */
103 | onShow: function () {
104 | app.pages = getCurrentPages();
105 | },
106 | onHide:function(){
107 | // 页面隐藏
108 | },
109 | onUnload:function(){
110 | // 页面关闭
111 | },
112 | // 设置页面分享
113 | onShareAppMessage: function () {
114 | return {
115 | title: '二维码(条形码)解码器',
116 | path: '/pages/index/index'
117 | }
118 | }
119 | })
--------------------------------------------------------------------------------
/utils/base64.js:
--------------------------------------------------------------------------------
1 | var Base64 = {
2 | // private property
3 | _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
4 | // public method for encoding
5 | encode: function(input) {
6 | var output = "";
7 | var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
8 | var i = 0;
9 | input = Base64._utf8_encode(input);
10 |
11 | while (i < input.length) {
12 |
13 | chr1 = input.charCodeAt(i++);
14 | chr2 = input.charCodeAt(i++);
15 | chr3 = input.charCodeAt(i++);
16 |
17 | enc1 = chr1 >> 2;
18 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
19 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
20 | enc4 = chr3 & 63;
21 |
22 | if (isNaN(chr2)) {
23 | enc3 = enc4 = 64;
24 | } else if (isNaN(chr3)) {
25 | enc4 = 64;
26 | }
27 |
28 | output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
29 |
30 | }
31 |
32 | return output;
33 | },
34 |
35 | // public method for decoding
36 | decode: function(input) {
37 | var output = "";
38 | var chr1, chr2, chr3;
39 | var enc1, enc2, enc3, enc4;
40 | var i = 0;
41 |
42 | input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
43 |
44 | while (i < input.length) {
45 |
46 | enc1 = this._keyStr.indexOf(input.charAt(i++));
47 | enc2 = this._keyStr.indexOf(input.charAt(i++));
48 | enc3 = this._keyStr.indexOf(input.charAt(i++));
49 | enc4 = this._keyStr.indexOf(input.charAt(i++));
50 |
51 | chr1 = (enc1 << 2) | (enc2 >> 4);
52 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
53 | chr3 = ((enc3 & 3) << 6) | enc4;
54 |
55 | output = output + String.fromCharCode(chr1);
56 |
57 | if (enc3 != 64) {
58 | output = output + String.fromCharCode(chr2);
59 | }
60 | if (enc4 != 64) {
61 | output = output + String.fromCharCode(chr3);
62 | }
63 |
64 | }
65 |
66 | output = Base64._utf8_decode(output);
67 |
68 | return output;
69 | },
70 |
71 | // private method for UTF-8 encoding
72 | _utf8_encode: function(string) {
73 | string = string.replace(/\r\n/g, "\n");
74 | var utftext = "";
75 |
76 | for (var n = 0; n < string.length; n++) {
77 |
78 | var c = string.charCodeAt(n);
79 |
80 | if (c < 128) {
81 | utftext += String.fromCharCode(c);
82 | } else if ((c > 127) && (c < 2048)) {
83 | utftext += String.fromCharCode((c >> 6) | 192);
84 | utftext += String.fromCharCode((c & 63) | 128);
85 | } else {
86 | utftext += String.fromCharCode((c >> 12) | 224);
87 | utftext += String.fromCharCode(((c >> 6) & 63) | 128);
88 | utftext += String.fromCharCode((c & 63) | 128);
89 | }
90 |
91 | }
92 |
93 | return utftext;
94 | },
95 |
96 | // private method for UTF-8 decoding
97 | _utf8_decode: function(utftext) {
98 | var string = "";
99 | var i = 0;
100 | var c = 0;
101 | var c1 = 0;
102 | var c2 = 0;
103 |
104 | while (i < utftext.length) {
105 |
106 | c = utftext.charCodeAt(i);
107 |
108 | if (c < 128) {
109 | string += String.fromCharCode(c);
110 | i++;
111 | } else if ((c > 191) && (c < 224)) {
112 | c2 = utftext.charCodeAt(i + 1);
113 | string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
114 | i += 2;
115 | } else {
116 | c2 = utftext.charCodeAt(i + 1);
117 | c3 = utftext.charCodeAt(i + 2);
118 | string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
119 | i += 3;
120 | }
121 |
122 | }
123 |
124 | return string;
125 | }
126 | }
127 |
128 | module.exports = Base64
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------