frida-il2cpp-bridge-my
Version:
(my:Support IOS)Frida module to dump, manipulate and hijack any IL2CPP application at runtime with a high level of abstraction.
54 lines (53 loc) • 2.35 kB
JavaScript
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnityVersion = void 0;
const decorator_cache_getter_1 = require("decorator-cache-getter");
const console_1 = require("../utils/console");
const matchPattern = /(20\d{2}|\d)\.(\d)\.(\d{1,2})(?:([abcfp]|rc){0,2}\d?)/;
class UnityVersion {
constructor(source) {
this.toString = () => this.source;
this.isEqual = (other) => this.compare(other) == 0;
this.isAbove = (other) => this.compare(other) == 1;
this.isBelow = (other) => this.compare(other) == -1;
this.isEqualOrAbove = (other) => this.compare(other) >= 0;
this.isEqualOrBelow = (other) => this.compare(other) <= 0;
const matches = source.match(matchPattern);
this.source = matches ? matches[0] : source;
this.major = matches ? Number(matches[1]) : -1;
this.minor = matches ? Number(matches[2]) : -1;
this.revision = matches ? Number(matches[3]) : -1;
if (matches == null) {
console_1.warn(`"${source}" is not a valid Unity version.`);
}
}
get isLegacy() {
return this.isBelow("2018.3.0");
}
compare(otherSource) {
const other = new UnityVersion(otherSource);
if (this.major > other.major)
return 1;
if (this.major < other.major)
return -1;
if (this.minor > other.minor)
return 1;
if (this.minor < other.minor)
return -1;
if (this.revision > other.revision)
return 1;
if (this.revision < other.revision)
return -1;
return 0;
}
}
__decorate([
decorator_cache_getter_1.cache
], UnityVersion.prototype, "isLegacy", null);
exports.UnityVersion = UnityVersion;