当前位置:网站首页>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
- Kotlin coroutine suspend function suspend keyword
- Learning and Development notes of mongdb
- MySQL queries the quantity of each month and the year-on-year and month on month data of each month
- Kali system -- dnsmap for DNS collection and analysis
- Cve-2021-24078 vulnerability analysis
- [sca-cnn interpretation] spatial and channel wise attention
- 为什么磁盘分区的时候,第一个分区前面总有一段空间(63或者2048个扇区)
- Comparison of disk partition modes (MBR and GPT)
- Mongodb array operation
猜你喜欢

How to solve the duplication problem when MySQL inserts data in batches?

Kali system -- fierce of DNS collection and analysis
![[JS component] simulation framework](/img/f2/8d5bb7e0db55a87ce76c09fae03694.jpg)
[JS component] simulation framework

Stack overflow learning summary

Canvas airplane game
![[gxyctf2019] no dolls -- detailed explanation](/img/c8/8c588ab8f58e2b38b9c64c4ccd733f.png)
[gxyctf2019] no dolls -- detailed explanation

Aof persistence

How many steps are appropriate for each cycle of deep learning?

Learning and Development notes of mongdb

三角波与三角波卷积
随机推荐
Static analysis of malicious code
Why is there always a space (63 or 2048 sectors) in front of the first partition when partitioning a disk
深度学习训练多少轮?迭代多少次?
Andersen Global通过在芬兰和丹麦的合作协议拓展北欧地区业务版图
三角波与三角波卷积
Kali system -- dnsmap for DNS collection and analysis
Triangle wave and triangle wave convolution
People and gods are angry. Details of Tangshan "mass beating of women incident"
Kali system -- dnsrecon for DNS collection and analysis
[server data recovery] successful cases of data loss recovery during data migration between storage servers
Hard (magnetic) disk (II)
Arduino interrupt
(01).NET MAUI实战 建项目
The grass is bearing seeds
Arduino uses esp8266+ lighting technology + Xiaoai audio to realize voice control switch
磁盘分区方式对比(MBR与GPT)
Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not
OceanBase 雄踞墨天轮2021年度中国数据库魔力象限领导者
sort
Arduino control soil moisture sensor