需要借助的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
}));
}
});
仅做代码交流学习使用