18103113

Suddenly, they find that they can't take a picture without a camera.

使用Termux搭建假wifi熱點

注:本文旨在學習研究wifi熱點相關知識,請勿用於任何違反道德之事。

需要一台Root過的Android(系統版本不低於5.0)手機,安裝好Termux和python。實現Captive Portal需要兩部分,請求重定向和授權頁面。重定向的實現有多種,這裡既然是假熱點,所以使用最簡單的iptables重定向dns。授權頁面則直接採用jczic/MicroWebSrv實現的網頁服務器。把MicroWebSrv解壓到~/scripts/MicroWeb,然後新建如下文件

#~/scripts/MicroWeb/forward.sh
remove127(){
  /system/bin/iptables -t nat -D PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.43.1:8000&&/system/bin/iptables -t nat -D PREROUTING -p tcp --dport 443 -j DNAT --to-destination 192.168.43.1:8000
}
add127(){
  /system/bin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.43.1:8000&&/system/bin/iptables -t nat -I PREROUTING -p tcp --dport 443 -j DNAT --to-destination 192.168.43.1:8000
}
if [[ $1 = "1" ]]; then
  echo "start"       
  add127
elif [[ $1 = "0" ]]; then
  echo "stop"
  remove127
fi
#~/scripts/MicroWeb/web.py
from microWebSrv import MicroWebSrv
mws = MicroWebSrv(port=8000,bindIP='0.0.0.0',webPath="/data/data/com.termux/files/home/scripts/MicroWeb/www")
mws.SetNotFoundPageUrl("http://192.168.43.1:8000/hotspot-detect.html")
mws.Start(False)
#~/scripts/MicroWeb/www/hotspot-detect.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
  
  <title>Captive Portal</title>
  <script>
  /*!
 * clipboard.js v2.0.0
 * https://zenorocha.github.io/clipboard.js
 * 
 * Licensed MIT © Zeno Rocha
 */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(t){return t&&t.__esModule?t:{default:t}}(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),a=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return i(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var o,r,i;!function(a,c){r=[t,n(0),n(2),n(1)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e,n,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=r(e),s=r(n),f=r(o),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),p=function(t){function e(t,n){i(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return c(e,t),h(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodeType!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}t.exports=n}])});
  </script>
    <style>
        .wrapper {
            text-align: center;
        }

        .button {
            position: absolute;
            top: 50%;
            margin-top:2em;
        }
    </style>
</head>
<body>
    <div class="wrapper">
        <button class="btn" id="clickButton" data-clipboard-text="just kidding :)">
            Connect to the Internet
        </button>
    </div>

    <script>
        var clipboard = new ClipboardJS('.btn');    
        clipboard.on('success', function(e) {
            console.info('Action:', e.action);
            console.info('Text:', e.text);
            console.info('Trigger:', e.trigger);

            e.clearSelection();
        });

        clipboard.on('error', function(e) {
            console.error('Action:', e.action);
            console.error('Trigger:', e.trigger);
        });  
    </script>
</body>
</html>

上面文件唯一需要修改的地方是你手機的wifi網關,可以在打開手機熱點後通過ip addr命令查看,我的是wlan0網卡,網關是192.168.43.1。

#iptable需要root權限
su
./forward.sh 1
#然后新开一个session運行web server
python web.py
#這時其他手機連上此熱點,即會彈出自定義頁面hotspot-detect.html。

AFWall+ 安卓可用的iptables

安卓手機如果root了,便可以通過AFWall+Github項目地址)來使用iptables管控網絡。

在安卓上使用DNSCrypt

由於TCP旁路阻斷技術的應用,DNSCrypt已經不能為日常使用網絡帶來太多方便,所以僅僅是記錄一下使用方法而已。先安裝好AFWall+並根據自己的喜好定製軟件的聯網規則,然後啟用iptables。我們使用Termux來至執行iptabls命令。根據自己的手機系統下載dnscrypt-proxy,比如我的就是dnscrypt-proxy-android_arm64-2.0.17.zip。如果不知道自己的手機系統,可以運行uname -a,如果出現aarch64就跟我一樣下載android_arm64版本就行。下載後解壓到/data/data/com.termux/files/home/opt/dns目錄里。複製一份文件夾里的配置文件即cp example-dnscrypt-proxy.toml dnscrypt-proxy.toml就可以了。下面的文件我是放在家目錄下的,文件名是dns.sh,記得加上執行權限。

remove127(){
  /system/bin/iptables -t nat -D OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:53&&/system/bin/iptables -t nat -D OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:53
}
add127(){
  /system/bin/iptables -t nat -I OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:53&&/system/bin/iptables -t nat -I OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:53
}
startDns(){
  /data/data/com.termux/files/home/opt/dns/dnscrypt-proxy -config /data/data/com.termux/files/home/opt/dns/dnscrypt-proxy.toml > /dev/null 2>1 &
  echo "starting dns"
  sleep 15
}
stopDns(){
  pkill dnscrypt-proxy
  echo "killed dns"
}
test(){
  var1=$(su -c "/system/bin/iptables -C OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:53")
}
status(){
  vt1="$(ps -ef | grep dnscrypt-proxy | wc -l)"
  if [[ $vt1 = "2" ]]; then
    dnsproxyStatus="1"
  else
    dnsproxyStatus="0"
  fi
  vt2="$(/system/bin/iptables -t nat -L | grep 127.0.0.1:53 | wc -l)"
  if [[ $vt2 = "2" ]]; then
    iptablesStatus="1"
  else
    iptablesStatus="0"
  fi
}
if [[ $1 = "1" ]]; then
  echo "start"      
  remove127              
  sleep 5                
  startDns       
  add127
elif [[ $1 = "2" ]]; then
  echo "restart"        
  remove127
  stopDns         
  sleep 3           
  startDns               
  add127 
elif [[ $1 = "0" ]]; then
  echo "stop"
  remove127
  stopDns
elif [[ $1 = "s" ]]; then
  status
  echo "dns: $dnsproxyStatus | iptables: $iptablesStatus"
else
  status
  if [[ $dnsproxyStatus = "1" ]]; then
    echo "$(date) dns ok" >> /data/data/com.termux/files/home/log.log
  else
    remove127
    stopDns
    remove127
    sleep 5
    startDns
    add127
    echo "$(date) dns started" >> /data/data/com.termux/files/home/log.log
  fi
  
fi
#使用說明
#首先切換的超級用戶
su
#查看當前狀態,1代表開啟,0代表關閉
./dns.sh s
#關閉dnscrypt-proxy
./dns.sh 0
#開啟dnscrypt-proxy
./dns.sh 1
#重新啟動dnscrypt-proxy
./dns.sh 2

啟動完成後可以通過dnsleaktest.com來查看當前的本機的dns。本來腳本還做了自啟動的適配,但是無論是Termux的自動啟動還是Magisk的自動啟動,都不太好用就算了。

Android套用日文字體

據說有的手機(三星,LG,HTC)可以直接選擇系統字體,真好,但是索尼不行。我只是修改了系統的字體配置文件,讓顯示簡體中文時,首先套用日語SomcUDGothic-Regular.ttf字體,如果沒有再用回原來的NotoSansCJK-Regular.ttc字體。這樣不會出現口口口,但時畢竟字體差異在那裡,如果追求完美顯示的話,這個方法是不合適的。

#備份原始文件
cp /system/etc/fonts.xml /system/etc/fonts.xml.bak
vi /system/etc/fonts.xml
#添加如下三行到<family lang="zh-Hans">前。
    <family lang="zh-Hans">
        <font weight="400" style="normal">SomcUDGothic-Regular.ttf</font>
    </family>
#重啟手機即可

python查詢aqicn的空氣質量數據

#!/data/data/com.termux/files/usr/bin/python
# -*- coding: utf8 -*-

#aqicn空氣質量 #https://aqicn.org/api/
#v2 同時指定多個監測站,已防止單個站點很久不更新數據
import json,requests,sys,time

#token從https://aqicn.org/data-platform/token/獲取,只需郵箱即可
token = 'YourToken'
#預設為當前IP位置,可自行指定基站,幫助 --help
stationList = ["@5851","@5855","@5860"]

def getAqi(station):    
    aqiUrl = "https://api.waqi.info/feed/"+station+"/?token="+token
    try:
        res = requests.get(aqiUrl)
        a = res.json()
        if a['status']=="ok":            
            if time.time() - a['data']['time']['v'] < 86400:
                return a
            else:
                return {"status":a['data']['city']['name']+"的數據已過期。"}
        else:
            res = requests.get(aqiUrl)
            a = res.json()
            return a
    except:
        return {"status":"net error"}

def searchStation(keyword):
    searchUrl = "https://api.waqi.info/search/?token="+token+"&keyword="+keyword
    try:
        res = requests.get(searchUrl)
        a = res.json()
        res = []
        if a['status']=="ok":
            for s in a['data']:
                resT={}
                resT['uid']=s['uid']
                resT['name']=s['station']['name']
                resT['aqi']=s['aqi']+" ("+s['time']['stime']+")"
                res.append(resT)
            return res
        else:
            return a
    except:
        return {"status":"net error"}
def processAqi(aqiJson):
    s=aqiJson
#     print(json.dumps(s, indent=4))
    res={}
    if s['status']=="ok":
        res['cityName']=s['data']['city']['name']
        res['time']=s['data']['time']['s']
        res['aqi']=s['data']['aqi']
        try:
            res['pm25']=s['data']['iaqi']['pm25']['v']
        except:
            res['pm25']="N/A"
        try:
            res['pm10']=s['data']['iaqi']['pm10']['v']
        except:
            res['pm10']="N/A"
        try:
            res['temp']=s['data']['iaqi']['t']['v']
        except:
            res['temp']="N/A"
        try:
            res['humidity']=s['data']['iaqi']['h']['v']
        except:
            res['humidity']="N/A"
        try:
            res['wind']=s['data']['iaqi']['w']['v']
        except:
            res['wind']="N/A"
    else:
        res=s
    return res

def main():
    global station
    if len(sys.argv)==1:
        for station in stationList:
            res = processAqi(getAqi(station))
            print(json.dumps(res, indent=2, ensure_ascii=False))
    elif len(sys.argv)==2:
        station = str(sys.argv[1])
        if station == "--help":
            res={"@5851":"根據觀測點編號查詢","Nanyang":"根據城市名稱查詢",
                 "here":"根據IP查詢","s shenzhen":"查詢深圳觀測點",}
        else:
            res = processAqi(getAqi(station))
        print(json.dumps(res, indent=2, ensure_ascii=False))
    elif len(sys.argv)==3:
        res = searchStation(str(sys.argv[2]))
        print(json.dumps(res, indent=2, ensure_ascii=False))
    
if __name__ == '__main__':
    main()

前天迎來如秋後的第一場中度霧霾。

18081708

最近看到騰訊牽頭成立的微眾銀行,定期存款年利率最高可達4.875%,比普通理財產品都有高很多。於是決定試一試。在微信搜索微眾銀行可以方便進入其小程序,但小程序說完整功能請使用微眾銀行APP。通過微眾銀行公眾號的鏈接下載,跳轉瀏覽器,順利下載到了微眾銀行APP,不過我留意到下載鏈接竟然是http開頭的。安裝後打開,APP即提示有新版本,建議更新。點擊更新後不能安裝,因為下載到的新安裝包版本比現在安裝的還舊。於是通過微眾銀行官網的下載鏈接下載apk後安裝,獲得的仍然是舊版本,舊到不更新不能使用。多次嘗試無果後,將手機切換到電信網絡下,下來就是最新的APP了。

所以我粗略判斷,天威網絡緩存了微眾銀行的舊版本包,導致用戶無法升級。作為金融類APP,安裝包居然是明文傳輸,這就是國內一線大企業的做法。

般若波羅蜜多心經

《般若波羅蜜多心經》 唐·三藏法師玄奘譯

觀自在菩薩,行深般若波羅蜜多時。照見五蘊皆空,度一切苦厄。舍利子,色不異空,空不異色,色即是空,空即是色。受想行識,亦復如是。舍利子,是諸法空相,不生不減,不垢不凈,不增不減。是故空中無色,無受想行識,無眼耳鼻舌身意,無色聲香味觸法,無眼界,乃至無意識界。無無明,亦無無明盡,乃至無老死,亦無老死盡。無苦集滅道,無智亦無得,以無所得故。菩提薩埵,依般若波羅蜜多故,心無罣礙,無罣礙故,無有恐怖,遠離顛倒夢想,究竟涅盤。三世諸佛,依般若波羅蜜多故,得阿耨多羅三藐三菩提。故知般若波羅蜜多,是大神咒,是大明咒,是無上咒,是無等等咒,能除一切苦,真實不虛故。說般若波羅蜜多咒,即說咒曰:揭諦、揭諦、波羅揭諦,波羅僧揭諦,菩提薩婆訶。


bō rě bō luó mì duō xīn jīng


guān zì zài pú sà,xíng shēn bō rě bō luó mì duō shí。
zhào jiàn wǔ yùn jiē kōng,dù yī qiē kǔ è。
shè lì zǐ,sè bù yì kōng,kōng bù yì sè,sè jí shì kōng,kōng jí shì sè。
shòu xiǎng xíng shí,yì fù rú shì。
shè lì zǐ,shì zhū fǎ kōng xiàng,
bù shēng bù miè,bù gòu bù jìng,bù zēng bù jiǎn。
shì gù kōng zhōng wú sè,wú shòu xiǎng xíng shí,
wú yǎn ěr bí shé shēn yì,wú sè shēng xiāng wèi chù fǎ,
wú yǎn jiè,nǎi zhì wú yì shí jiè。
wú wú míng,yì wú wú míng jìn,nǎi zhì wú lǎo sǐ,yì wú lǎo sǐ jìn。
wú kǔ jí miè dào,wú zhì yì wú dé,yǐ wú suǒ dé gù。
pú tí sà duǒ,yī bō rě bō luó mì duō gù,xīn wú guà ài,
wú guà ài gù,wú yǒu kǒng bù,yuǎn lí diān dǎo mèng xiǎng,jiū jìng niè pán。
sān shì zhū fó,yī bō rě bō luó mì duō gù,dé ā nòu duō luó sān miǎo sān pú tí。
gù zhī bō rě bō luó mì duō,shì dà shén zhòu,shì dà míng zhòu,
shì wú shàng zhòu,shì wú děng děng zhòu。néng chú yī qiē kǔ,zhēn shí bù xū gù。
shuō bō rě bō luó mì duō zhòu,jí shuō zhòu yuē:
jiē dì jiē dì, bō luó jiē dì, bō luó sēng jiē dì, pú tí sà pó hē。