当前位置:网站首页>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] battle chess
- Canvas game 2048 free map size
- Today's sleep quality record 74 points
- 单片机串口中断以及消息收发处理——对接受信息进行判断实现控制
- [error] invalid use of incomplete type uses an undefined type
- Kotlin coroutine withcontext switch thread
- [003] embedded learning: creating project templates - using stm32cubemx
- 阿姨学代码续集:能力吊打大批程序员
- Card constructions -- two points
- What are the conditions of index invalidation?
猜你喜欢
市值破万亿,连续三个月销量破10万,比亚迪会成为最强国产品牌?
硬(磁)盘(二)
Penetration test summary
Download nail live playback through packet capturing
[network protocol] problems and solutions in the use of LwIP
[MRCTF2020]Ez_ bypass --BUUCTF
What is pytorch? Explain the basic concepts of pytorch
[sca-cnn interpretation] spatial and channel wise attention
[JS component] customize the right-click menu
[003] embedded learning: creating project templates - using stm32cubemx
随机推荐
With a market value of more than trillion yuan and a sales volume of more than 100000 yuan for three consecutive months, will BYD become the strongest domestic brand?
Stack overflow learning summary
Composite key relationships using Sqlalchemy - relationships on composite keys using Sqlalchemy
什么是 Meebits?一个简短的解释
今日在家休息
[GYCTF2020]Ezsqli --BUUCTF
Kotlin coroutine withcontext switch thread
MySQL query table field information
杂记:intel11代和12代移动版支持原生Thunderbolt4接口,桌面版不支持
Kali system -- dnsmap for DNS collection and analysis
[JS component] customize the right-click menu
Mysql批量插入数据时如何解决重复问题?
Can GPU acceleration pytorch work?
Blinker FAQs
Win10 home vs pro vs enterprise vs enterprise LTSC
[virtual machine] notes on virtual machine environment problems
What is meebits? A brief explanation
Triangle wave and triangle wave convolution
Download nail live playback through packet capturing
Leetcode weekly -- April to May