def process(self): super(AutorootArgParser, self).process() identifier = self.args["base"] or self.args["variant"] config = self.configTreeParser.parseJSON(identifier) if config.get("__config__") is None: sys.stderr.write( "You are using an outdated config tree. Please run 'incept sync -v VARIANT_CODE' or set __config__ (see https://goo.gl/aFWPby)\n" ) sys.exit(1) autorootBase = identifier if config.isBase() else ".".join( identifier.split(".")[:-1]) config = ConfigV2.new(autorootBase + ".autoroot", "autoroot", config) if self.args["output"]: config.setOutPath(self.args["output"]) config.set("update.restore_stock_recovery", True) config.set("update.__make__", True) config.set("odin.__make__", True) config.set("odin.checksum", True) config.set("cache.__make__", True) config.set("update.databases.__make__", False) config.set("update.settings.__make__", False) config.set("update.adb.__make__", False) config.set("update.property.__make__", False) config.set("update.apps.__make__", False) config.set("update.network.__make__", False) config.set("update.script.format_data", False) config.set("update.root_method", "supersu") config.set("update.busybox.__make__", False) config.set("update.files.__override__", True) config.set("update.script.wait", 0) config.set("update.keys", "test") config.set("recovery.__make__", not self.args["no_recovery"]) config.set("boot.__make__", False) config.set("__config__.target.root.methods.supersu.include_apk", True) config.set("__config__.target.root.methods.supersu.include_archs", []) if not config.get("recovery.stock"): print( "Autoroot requires having recovery.stock set, and it's not for %s" % identifier) sys.exit(1) if not self.args["no_recovery"] and not config.get("recovery.img"): logger.error( "recovery.img is not set, use --no-recovery to not make recovery" ) sys.exit(1) with FileTools.newTmpDir() as workDir: config.make(workDir) return True
def process(self): super(AutorootArgParser, self).process() identifier = self.args["base"] or self.args["variant"] config = self.configTreeParser.parseJSON(identifier) if config.get("__config__") is None: sys.stderr.write("You are using an outdated config tree. Please run 'incept sync -v VARIANT_CODE' or set __config__ (see https://goo.gl/aFWPby)\n") sys.exit(1) autorootBase = identifier if config.isBase() else ".".join(identifier.split(".")[:-1]) config = ConfigV2.new(autorootBase + ".autoroot", "autoroot", config) if self.args["output"]: config.setOutPath(self.args["output"]) config.set("update.restore_stock_recovery", True) config.set("update.__make__", True) config.set("odin.__make__", True) config.set("odin.checksum", True) config.set("cache.__make__", True) config.set("update.databases.__make__", False) config.set("update.settings.__make__", False) config.set("update.adb.__make__", False) config.set("update.property.__make__", False) config.set("update.apps.__make__", False) config.set("update.network.__make__", False) config.set("update.script.format_data", False) config.set("update.root_method", "supersu") config.set("update.busybox.__make__", False) config.set("update.files.__override__", True) config.set("update.script.wait", 0) config.set("update.keys", "test") config.set("recovery.__make__", not self.args["no_recovery"]) config.set("boot.__make__", False) config.set("__config__.target.root.methods.supersu.include_apk", True) config.set("__config__.target.root.methods.supersu.include_archs", []) if not config.get("recovery.stock"): print("Autoroot requires having recovery.stock set, and it's not for %s" % identifier) sys.exit(1) if not self.args["no_recovery"] and not config.get("recovery.img"): logger.error("recovery.img is not set, use --no-recovery to not make recovery") sys.exit(1) with FileTools.newTmpDir() as workDir: config.make(workDir) return True
def createNewConfig(self, identifier, name, baseConfig): return ConfigV2.new(identifier, name, baseConfig)