mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 11:20:48 +00:00
Searching in browsers cache (Chrome, Firefox)
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
package com.jpexs.browsers.cache.firefox;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class MetaData {
|
||||
|
||||
public int majorVersion;
|
||||
public int minorVersion;
|
||||
public long location;
|
||||
public long fetchCount;
|
||||
public long firstFetchTime;
|
||||
public long lastFetchTime;
|
||||
public long expireTime;
|
||||
public long dataSize;
|
||||
public long requestSize;
|
||||
public long infoSize;
|
||||
public String request;
|
||||
public Map<String, String> response;
|
||||
|
||||
public MetaData(InputStream is) throws IOException {
|
||||
CacheInputStream cis = new CacheInputStream(is);
|
||||
majorVersion = cis.readInt16();
|
||||
minorVersion = cis.readInt16();
|
||||
location = cis.readInt32();
|
||||
fetchCount = cis.readInt32();
|
||||
firstFetchTime = cis.readInt32();
|
||||
lastFetchTime = cis.readInt32();
|
||||
expireTime = cis.readInt32();
|
||||
dataSize = cis.readInt32();
|
||||
requestSize = cis.readInt32();
|
||||
infoSize = cis.readInt32();
|
||||
byte req[] = new byte[(int) requestSize];
|
||||
cis.read(req);
|
||||
request = new String(req, 0, (int) requestSize - 1/*Ends with char 0*/);
|
||||
byte res[] = new byte[(int) infoSize];
|
||||
cis.read(res);
|
||||
String responseStr = new String(res);
|
||||
int nulpos;
|
||||
boolean inKey = true;
|
||||
String key = null;
|
||||
response = new HashMap<>();
|
||||
while ((nulpos = responseStr.indexOf(0)) > 0) {
|
||||
String v = responseStr.substring(0, nulpos);
|
||||
responseStr = responseStr.substring(nulpos + 1);
|
||||
if (inKey) {
|
||||
key = v;
|
||||
} else {
|
||||
response.put(key, v);
|
||||
}
|
||||
inKey = !inKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user