Hôm nay mình sẽ chia sẻ cho các bạn một bài hướng dẫn về cách tạo giấy phép template Blogger.
Giấy phép blog đề cập đến sự cho phép hợp pháp được cấp cho các cá nhân hoặc tổ chức để sử dụng, phân phối và kiếm tiền từ nội dung được xuất bản trên blog của họ. Nó đóng vai trò là biện pháp bảo vệ cho các blogger, đảm bảo rằng quyền sở hữu trí tuệ của họ được tôn trọng và họ có quyền kiểm soát cách sử dụng nội dung của mình.

Công tụ tạo giấy phép
License Code Generator
Bản quyền kịch bản
Đầu vào giấy phép người dùng html, bạn có thể đặt nó bên trong thẻ <body>
<div class='license' style='display:none'> <!-- enter your license here --> </div>
Bạn có thể tạo giấy phép dựa trên URL BLOG hoặc TÊN BLOG hoặc ID BLOG, chúng tôi sử dụng thẻ meta để lấy dữ liệu từ người dùng như URL blog, tên blog hoặc ID blog.
Thẻ Meta
<head>
(chỉ chọn 1)<!-- blog url meta tags -->
<meta expr:content='data:blog.homepageUrl.canonical' property='blogUrl'/>
<!-- blog name meta tag, if this code is already in the template skip this step -->
<meta expr:content='data:blog.title.escaped' property='og:site_name'/>
<!-- blog name meta tag id-->
<meta expr:content='data:blog.blogId' property='blogId'/>
var uniqueCode = "tes123"; // Unique license key (must be encoded using the base64 tool provided)
var wrongLicense = "<style>a{color:#f89000}.wrongPop{z-index:9999999999999999999999999999!important;display:block!important;opacity:1!important;visibility:visible!important;width:calc(100% - 100px);max-width:500px;position:fixed;background:#fefefe;border-radius:10px;border:1px solid #eee;color:#262d3d;text-align:center;padding:35px;top:150px;left:0;right:0;margin:0 auto;box-shadow:0 10px 20px rgba(0,0,0,0.2);}</style><div class='wrongPop'><svg style='fill:#e00000;width:50px;height:50px' viewBox='0 0 24 24'><path d='M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z'/></svg><h3>Access Blocked</h3><p>your domain ( <span id='blogName'></span> ) not listed.</p><a href='https://www.giahuy.net/p/contact.html'>Contact Admin</a></div>"; // HTML popup for invalid license (must also be base64 encoded using the provided tool)
var bs64={_keyStr:"FGHIJKLTUVABCDEMNOPQRSWXYZhijklmarstuvwxyzbcdefgnopq0123456789+/=",encode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;input=bs64._utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2))enc3=enc4=64;else if(isNaN(chr3))enc4=64;output+=this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4)}return output},decode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length){enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output+=String.fromCharCode(chr1);if(enc3!=64)output+=String.fromCharCode(chr2);if(enc4!=64)output+=String.fromCharCode(chr3)}return bs64._utf8_decode(output)},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128)utftext+=String.fromCharCode(c);else if(c<2048){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128)}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128)}}return utftext},_utf8_decode:function(utftext){var string="",i=0,c=0,c2=0,c3=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++}else if(c>191&&c<224){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3}}return string}};
var license = document.querySelector("meta[property='blogUrl']").getAttribute("content"); // blog URL
/* Alternative options (commented out): */
/* var license = document.querySelector("meta[property='og:site_name']").getAttribute("content"); // name blog */
/* var license = document.querySelector("meta[property='blogId']").getAttribute("content"); // blog id */
var userLicense = document.querySelector('.license');
var decodedUniqueCode = bs64.decode(uniqueCode);
var combined = license + decodedUniqueCode;
var expectedLicense = bs64.encode(combined);
function wrongDetected() {
var body = document.getElementsByTagName('BODY')[0];
body.innerHTML += bs64.decode(wrongLicense);
body.setAttribute('oncontextmenu', 'return false');
document.getElementById('license').innerHTML = window.location.hostname;
}
if (document.querySelectorAll('.license').length === 0) { // License element is missing
wrongDetected();
} else if (userLicense.innerHTML.length <= uniqueCode.length) { // License value is too short or equal to raw code
wrongDetected();
} else if (userLicense.innerHTML !== expectedLicense) { // License is incorrect
wrongDetected();
} else { // License is valid, run your main code here
console.log('Correct license');
}
Giải thích ngắn gọn
// before
var uniqueCode = "tes123";
//after
var uniqueCode = "kLSqCQUq";
Tương tự như đoạn mã bên dưới, sau khi bạn chỉnh sửa xong, nó phải được mã hóa như trong phương pháp trước.
// before
var wrongLicense = "<style>a{color:#f89000}.wrongPop{z-index:9999999999999999999999999999!important;display:block!important;opacity:1!important;visibility:visible!important;width:calc(100% - 100px);max-width:500px;position:fixed;background:#fefefe;border-radius:10px;border:1px solid #eee;color:#262d3d;text-align:center;padding:35px;top:150px;left:0;right:0;margin:0 auto;box-shadow:0 10px 20px rgba(0,0,0,0.2);}</style><div class='wrongPop'><svg style='fill:#e00000;width:50px;height:50px' viewBox='0 0 24 24'><path d='M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z'/></svg><h3>Access Blocked</h3><p>your domain ( <span id='blogName'></span> ) not listed.</p><a href='https://www.giahuy.net/p/contact.html'>Contact Admin</a></div>"; // HTML popup for invalid license (must also be base64 encoded using the provided tool)
//after
var wrongLicense = "MTD0lWovMwK7Y29di3U6U2Y4EQFnCT0fk3VgiwkNi3G7ls1ziwOvlIy5EQu5EQu5EQu5EQu5EQu5EQu5EQu5EQu5EQu5UWvejL9pkLKfkIeuhXDniLK5EwVdi2DcUWvejL9pkLKfkIegjLKthXO5EtJrhW1ni3V0YW50E3Zzj2vshWozkTu6kwvqhWVdZPKziXGgjxOrixN7k2vukLa6Y2KdYpaoCIFvUH0aCQFnjTazE21rlH13hWO0hIy1CIGnlIeni3DzkLvgitzwhXrvZIesYWDcZ3VgkW5uEsDwZWZvZwR7Yw9pZLSpBXVrZLv1jqyoCTG4E2VgjwOvjtyojTaaj29dhWNaU2SvZQeti2ogjtytCtYpZIDuE3OvlTNeYWozZ246Y2SfkLSpE3GrZLOziwj6CqSnlIe0i3F6CQRnjTa7iLSwkIynE3VzZ2r0EtF7iWKpZ2vfEtFaYXS0iqesi3aej2rrZL93EtFaCQGnlHFpCTG4UTVxYwJyCHnnBIFdCH4pAQe9MH9qkTvdZQ48ZLv2ULDdYXDqMPk3jw9fZ1GgjHj"; // HTML popup for invalid license (must also be base64 encoded using the provided tool)
Khóa base64 tùy chọn này là một bí mật, bạn có thể ngẫu nhiên hóa nó để kết quả đầu ra khác nhau và đừng quên thay đổi một phần trong công cụ tạo, nếu bạn hiểu một chút về javascript, bạn có thể cắt mã này thành 2-4 phần rồi kết hợp lại bằng (join), để sau này nếu bạn mã hóa khóa của mình, nó sẽ không dễ bị đọc.
FGHIJKLTUVABCDEMNOPQRSWXYZhijklmarstuvwxyzbcdefgnopq0123456789+/=
//example of cutting into 4 parts and joining them back with (join)
var keyO = ['FGHIJKLTUVABCDE','NOPQRSWXYZhijklmarstuv'];
var keyT = ['wxyzbcdefgnop','0123456789+/='];
var jkeyO = keyO.join("M");
var jkeyT = keyT.join("q");
var Base64={_keyStr:jkeyO + jkeyT
Theo mặc định, giấy phép sẽ thiết lập URL BLOG, bạn cũng có thể chọn tên blog hoặc ID blog bằng cách xóa thẻ bình luận /* ... */
bên dưới để kích hoạt nó, (chỉ kích hoạt 1)
var license = document.querySelector("meta[property='blogUrl']").getAttribute("content"); // blog URL
/* Alternative options (commented out): */
/* var license = document.querySelector("meta[property='og:site_name']").getAttribute("content"); // name blog */
/* var license = document.querySelector("meta[property='blogId']").getAttribute("content"); // blog id */
Cuối cùng, hãy kết hợp/gói javascript của bạn vào đây để khi người dùng xóa thẻ meta, tập lệnh sẽ không bao giờ được thực thi.
}else{
// wrap your js in here
console.log('correct license')
}
Sau khi kết hợp nó với JS, đừng quên mã hóa tất cả các tập lệnh ở trên để người khác không dễ dàng biết được giấy phép. Bạn có thể gói nó lại thành 2x để không dễ giải mã.
Các công cụ mã hóa JavaScript được đề xuất, trong phần (Mã hóa mảng chuỗi), hãy kích hoạt Base64 và RC4 để kết quả mã hóa không dễ giải mã.
Trên đây là hướng dẫn cách tạo giấy phép template Blogger.
Nếu có bất cứ thắc mắc nào hãy comment ngay phía dưới cho mình biết nhé.
Chúc các bạn thành công và có một ngày làm việc thật hiệu quả!
Copyright © www.giahuy.net
1 nhận xét
Link blog: https://www.trick.pro.vn/
Mô tả:Trick Pro Software | Công ty Cổ phần Phần mềm Trick Pro - Giải pháp chuyển đổi số toàn diện!
Mình đã đặt phần liên kết của bạn ở phần trang chủ, chỗ Đối tác phần menu bạn kiểm tra nhé.