Add allowing downgrade installation option
This commit is contained in:
parent
281c42a18f
commit
28b9bdf7ed
|
|
@ -12,6 +12,7 @@ object Patcher {
|
|||
private val v2: Boolean,
|
||||
private val v3: Boolean,
|
||||
private val useManager: Boolean,
|
||||
private val overrideVersionCode: Boolean,
|
||||
private val verbose: Boolean,
|
||||
private val embeddedModules: List<String>
|
||||
) {
|
||||
|
|
@ -26,6 +27,7 @@ object Patcher {
|
|||
add("--v2"); add(v2.toString())
|
||||
add("--v3"); add(v3.toString())
|
||||
if (useManager) add("--manager")
|
||||
if (overrideVersionCode) add("-r")
|
||||
if (verbose) add("-v")
|
||||
if (embeddedModules.isNotEmpty()) {
|
||||
add("-m"); addAll(embeddedModules)
|
||||
|
|
|
|||
|
|
@ -80,6 +80,9 @@ public class LSPatch {
|
|||
@Parameter(names = {"--manager"}, description = "Use manager (Cannot work with embedding modules)")
|
||||
private boolean useManager = false;
|
||||
|
||||
@Parameter(names = {"-r", "--allowdown"}, description = "Allow downgrade installation by overriding versionCode to 1 (In most cases, the app can still get the correct versionCode)")
|
||||
private boolean overrideVersionCode = false;
|
||||
|
||||
@Parameter(names = {"-v", "--verbose"}, description = "Verbose output")
|
||||
private boolean verbose = false;
|
||||
|
||||
|
|
@ -345,6 +348,8 @@ public class LSPatch {
|
|||
|
||||
if (!modules.isEmpty())
|
||||
property.addApplicationAttribute(new AttributeItem("extractNativeLibs", true));
|
||||
if (overrideVersionCode)
|
||||
property.addManifestAttribute(new AttributeItem(NodeValue.Manifest.VERSION_CODE, 1));
|
||||
property.addApplicationAttribute(new AttributeItem(NodeValue.Application.DEBUGGABLE, debuggableFlag));
|
||||
property.addApplicationAttribute(new AttributeItem("appComponentFactory", PROXY_APP_COMPONENT_FACTORY));
|
||||
// TODO: replace query_all with queries -> manager
|
||||
|
|
|
|||
Loading…
Reference in New Issue