当前位置:网站首页>Google play console crash information collection
Google play console crash information collection
2022-06-13 00:50:00 【Small fish game development】
Recently we need to focus on google play console The collected crash stack information is processed
Everyone who has used it knows that the information it collects, and each stack type information is separated from different pages
When you open it manually and quickly, it will even give you an error . It must be anti reptile …
At first, I thought that the official might provide an interface for exporting information in batches . But I looked it over and found that it was no longer available !!! It's magic
So I'm going to crawl the crash data , open F12, open fiddler, open selenium, The fishing day has passed
With theout eggs, you are not a great God , There is no relevant information on the Internet , For me to copy and paste ..
There was no way out , Just use the browser to simulate the operation .
Ready to write browser plug-ins . But! , I won't have to learn and write now , Just search it casually Browser plug-in development
Follow the example first https://www.jianshu.com/p/51c650f98d9c
Then download scaffolding , Although I don't know how to use it . But how to say , Anyway, it doesn't matter to study
git clone https://github.com/EmailThis/extension-boilerplate.git
After downloading, directly execute the installation ? I don't know what to install . Just install it , After loading and packaging, test whether it can be used
npm install
npm run build
browser -> Tools -> Manage extensions -> Developer model -> Load the unzipped extender
Okay . The test seems to be all right . Then start to develop ?
First of all, we need to know some necessary knowledge to continue , for example
How does the plug-in get page information ?
How to simulate the operation page ?
How to open a new tab ?
js How to visit ?
How to know that the stack information is loaded ?
node_modules What the hell is a big lump in the folder ?
How to import modules ?
How to delete an insert query from an array ?
JS Do you have... Like other languages += ++ Something like that ?
readme.md Written inside npm run chrome-watch do ?
In the example ext.runtime.onMessage do ? It looks like a callback, but where is the request made ?
Wait a lot of questions
npm run chrome-watch
First verify this What's the point
After I input the terminal, it performs some operations, and then there is no following . The first reaction was that Haote was inexplicable ??? After that, I didn't care .. Until I press save , I suddenly found out that . Oh, so it's used to monitor, save and execute package updates . It's good .
How plug-ins communicate
stay popup.js The following code is found in the example , This looks like popup.js towards contentscript.js With . Can request and return data , Proper
ext.tabs.query({
active: true, currentWindow: true}, function(tabs) {
var activeTab = tabs[0];
chrome.tabs.sendMessage(activeTab.id, {
action: 'process-page' }, renderBookmark);
});
function onRequest(request, sender, sendResponse) {
if (request.action === 'process-page') {
sendResponse(extractTags())
}
}
After I try to modify the code and save it , Click on the plug-in , I want it to return different data
But I failed . The reason is that there is an error that the port cannot be found , I thought there was something wrong with my code , I changed it back , Still failed ! Continue to report port error
I tried to restart , Discovery is OK again . So far I have found that when I need popup.js and contentscript.js When communicating, you need to restart the browser to communicate normally , The exact reason is unknown . The task is too tight to study deeply , After that, I will restart the browser every time I modify it
I'm trying to contentscript.js Simulate clicking on the page , succeed . But a port error occurred in a certain time period , It took me a long time to find the error reported by the empty object . But if you directly report a port error, who knows what's going on ??? Until I was in contentscript.js Of ext.runtime.onMessage.addListener Exception handling is added to the callback , Only then can we finally get the error information correctly , Instead of the damn port error . Missing in the callback sendResponse Port errors will also be reported
function onRequest(request, sender, sendResponse) {
for (var i = 0; i < js.length; i++) {
var obj = js[i]
try {
if (request.action === obj.actionName) {
sendResponse(obj.action(request))
}
} catch (err) {
alert('error:[' + obj.actionName + ']' + err)
}
}
}
ext.runtime.onMessage.addListener(onRequest);
Create a new label
I try to use chrome.tabs.create Create a new label , And wait for the stack information to be loaded . But several tests found that setTimeout Don't wait at all
Constantly accessing stack tags . Because there is a high probability of an error when accessing a stack page , This directly causes me to constantly refresh the page .
Then I noticed background.js. After testing setTimeout Can be in this js Internal use . So I moved the label related operations to background.js
Create tags that look like this
function CreateTabs(index) {
var data = run.listDatas[index]
if (run.isPageTest) {
run.log(data.maintext + ' num:' + data.num)
return
}
if (data.maintext.indexOf('java.lang') != -1)
return
chrome.tabs.create({
url: data.href, selected: false }, function(tab) {
createTabs.push({
tab: tab,
tabid: tab.id,
cutTabRun: false,
url: data.href,
maintext: data.maintext,
secondaryline: data.secondaryline,
count: data.num
})
})
}
Get the content from the link in the list by opening a new tab , When there is an error in the loading stack, switch to other tabs to refresh and wait for the loading to complete , To avoid reading failure caused by error
background.js Communications
chrome.runtime.sendMessage({
action: 'startRun',
total: document.querySelector('#totalText').value,
tabid: activeTab.id,
soSelect: soSelects
}, data => {
if (data == null) {
alert(' Run failed ')
}
})
jenkins
After reading, of course, it is necessary to so Stack is translated into readable stack . We use jenkins Running translation , It has been opened after negotiation post privilege use XMLHttpRequest function job.
Use http://localhost:8080/buildByToken/buildWithParameters Link strap token And other parameters job
About jenkins Of API. Yes, I learned it now , There is a at the bottom of the page REST API, Click in and you'll see JsonAPI, Open with joy , The result turned out to be json. I don't know what to do . I don't know how to get Job Console information after running .. Only try every link that looks different . After reading other articles, I learned that it can directly splice link queries
http://localhost:8080/job/jobName/number/api/json?pretty=true Through the test, it is found that it is feasible . Then guess how to access the console output . Yes, guess . I don't know where there is a detailed explanation. I can only guess . Fortunately, you can guess at random
post: function(info) {
console.log('request :' + info.url)
console.log('data:' + info.data)
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if (this.readyState === 4) {
console.log(this.status)
if (this.status == 201) {
console.log('request Location: ' + this.getResponseHeader('Location'))
GetLocation(info, this.getResponseHeader('Location'))
} else {
Error(info.url)
}
}
});
xhr.open('POST', info.url)
var form = new FormData();
form.append("error", info.data);
xhr.send(form)
},
}
function GetLocation(info, url) {
var settings = {
'url': url + 'api/json',
'method': 'GET'
}
info.Location = settings.url
$.ajax(settings).done(function(response) {
if (response == null) {
return;
}
try {
info.number = response.executable.number
WaitBuildComplete(info, response.executable.url)
} catch (err) {
console.log('err===================================' + err)
console.log(response)
setTimeout(() => {
GetLocation(info, url) }, 100)
}
})
}
function WaitBuildComplete(info, url) {
var settings = {
'url': url + 'api/json',
'method': 'GET'
}
//console.log('request Wait Build: ' + url)
$.ajax(settings).done(function(response) {
if (response == null) {
return;
}
//console.log('waitBuild:')
if (response.result == null) {
setTimeout(() => {
WaitBuildComplete(info, url) }, 100)
} else {
GetConsoleText(info, url)
}
})
}
function GetConsoleText(info, url) {
var settings = {
'url': url + 'consoleText/api/json',
'method': 'GET'
}
info.consoleTextUrl = settings.url
console.log('request: ' + settings.url)
$.ajax(settings).done(function(response) {
if (response == null) {
Error(settings.url)
return;
}
Succeed(info, response)
})
}
And then wait for all the execution to be completed in potions.html The page outputs the original information and translation information . By the way, start the download to prevent the error page from being lost due to careless operation
function downloadByBlob(fileName, content) {
let blob = new Blob([content], {
type: "text/plain;charset=utf-8"
});
let reader = new FileReader();
reader.readAsDataURL(blob);
reader.onload = function(e) {
let a = document.createElement('a');
a.download = fileName;
a.href = e.target.result;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
}
边栏推荐
- 硬(磁)盘(一)
- [JS component] previous queue prompt
- Influence of higher order poles on waveform
- Kotlin collaboration, the life cycle of a job
- What is the difference between pytorch and tensorflow?
- 杂记:intel11代和12代移动版支持原生Thunderbolt4接口,桌面版不支持
- 什么是 dummy change?
- In / out / inout details of MySQL stored procedures
- pytorch是什么?解释pytorch的基本概念
- 三角波与三角波卷积
猜你喜欢
![Buuctf's babysql[geek challenge 2019]](/img/6c/957e5e09f252210d0b4cf8771d4ade.png)
Buuctf's babysql[geek challenge 2019]

People and gods are angry. Details of Tangshan "mass beating of women incident"

Kotlin 协程的作用域构建器 coroutineScope与runBlocking 与supervisorScope,协程同步运行,协程挂掉的时候其他协程如何不被挂掉。

磁盘分区方式对比(MBR与GPT)

MySQL queries the quantity of each month and the year-on-year and month on month data of each month

深度学习每周期的步数多少合适?

今日睡眠质量记录74分

Mysql database password modification

市值破万亿,连续三个月销量破10万,比亚迪会成为最强国产品牌?

Aof persistence
随机推荐
生物解锁--指纹录入流程
单片机串口中断以及消息收发处理——对接受信息进行判断实现控制
Zhouchuankai, Bank of Tianjin: from 0 to 1, my experience in implementing distributed databases
Arduino interrupt
蓝桥杯单片机第七届决赛
[North Asia server data recovery] data recovery case of Hyper-V service paralysis caused by virtual machine file loss
[buglist] serial port programming does not read data
从ADK的WinPE自己手动构建自己的PE
Kotlin 协程的四种启动模式
杂记:intel11代和12代移动版支持原生Thunderbolt4接口,桌面版不支持
硬(磁)盘(一)
Biological unlocking - Fingerprint entry process
[gxyctf2019] no dolls -- detailed explanation
Composite key relationships using Sqlalchemy - relationships on composite keys using Sqlalchemy
[network protocol] problems and solutions in the use of LwIP
Oceanbase is the leader in the magic quadrant of China's database in 2021
Comparison of disk partition modes (MBR and GPT)
kotlin 协程withContext切换线程
Andersen Global通过在芬兰和丹麦的合作协议拓展北欧地区业务版图
Kotlin collaboration, the life cycle of a job