#include "src/profiling/deobfuscator.h"
#include <optional>
#include "perfetto/base/status.h"
#include "perfetto/ext/base/file_utils.h"
#include "perfetto/ext/base/scoped_file.h"
#include "perfetto/ext/base/string_splitter.h"
#include "perfetto/protozero/scattered_heap_buffer.h"
#include "protos/perfetto/trace/profiling/deobfuscation.pbzero.h"
#include "protos/perfetto/trace/trace.pbzero.h"
#include "protos/perfetto/trace/trace_packet.pbzero.h"
namespace perfetto {
namespace profiling {
namespace {
struct ProguardClass { … };
std::optional<ProguardClass> ParseClass(std::string line) { … }
enum class ProguardMemberType { … };
struct ProguardMember { … };
std::optional<ProguardMember> ParseMember(std::string line) { … }
std::string FlattenMethods(const std::vector<std::string>& v) { … }
}
std::string FlattenClasses(
const std::map<std::string, std::vector<std::string>>& m) { … }
base::Status ProguardParser::AddLine(std::string line) { … }
bool ProguardParser::AddLines(std::string contents) { … }
void MakeDeobfuscationPackets(
const std::string& package_name,
const std::map<std::string, profiling::ObfuscatedClass>& mapping,
std::function<void(const std::string&)> callback) { … }
bool ReadProguardMapsToDeobfuscationPackets(
const std::vector<ProguardMap>& maps,
std::function<void(std::string)> fn) { … }
std::vector<ProguardMap> GetPerfettoProguardMapPath() { … }
}
}