本文主要是介绍微信小程序控制台获取储存的账号信息和云函数加密,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
需要借助的hook强制打开微信DevTools的工具:
https://github.com/JaveleyQAQ/WeChatOpenDevTools-Python
window[1].wx.getStorageInfo({success: function(res) {console.log(res.keys); res.keys.forEach(function(key) {var value = window[1].wx.getStorageSync(key);console.log('Key: ' + key + ', Value: ' + JSON.stringify(value));});},fail: function() {console.error('获取存储信息失败');}
});
window[1].wx.getUserCryptoManager().getLatestUserKey({success: res => {var timestamp = res.expireTime; var date = new Date(timestamp);var year = date.getFullYear();var month = ('0' + (date.getMonth() + 1)).slice(-2); // getMonth() 返回的月份是从0开始的var day = ('0' + date.getDate()).slice(-2);var hours = ('0' + date.getHours()).slice(-2);var minutes = ('0' + date.getMinutes()).slice(-2);var seconds = ('0' + date.getSeconds()).slice(-2);var formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;console.log(JSON.stringify({version: res.version,key: res.encryptKey,iv: res.iv,expireTime: formattedDate}));}
});
仅做代码交流学习使用
这篇关于微信小程序控制台获取储存的账号信息和云函数加密的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!