Merge pull request #10090 from SomberNight/202507_android_chain_hack
android: extend testnet package name hack to other chains
This commit is contained in:
@@ -239,6 +239,14 @@ class SimpleConfig(Logger):
|
|||||||
make_dir(path, allow_symlink=False)
|
make_dir(path, allow_symlink=False)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def set_chain_config_opt_based_on_android_packagename(cls, config_options: dict[str, Any]) -> None:
|
||||||
|
# ~hack for easier testnet builds. pkgname subject to change.
|
||||||
|
android_pkg_name = util.get_android_package_name()
|
||||||
|
for chain in constants.NETS_LIST:
|
||||||
|
if android_pkg_name == f"org.electrum.{chain.cli_flag()}.electrum":
|
||||||
|
config_options[chain.cli_flag()] = True
|
||||||
|
|
||||||
def get_selected_chain(self) -> Type[constants.AbstractNet]:
|
def get_selected_chain(self) -> Type[constants.AbstractNet]:
|
||||||
selected_chains = [
|
selected_chains = [
|
||||||
chain for chain in constants.NETS_LIST
|
chain for chain in constants.NETS_LIST
|
||||||
|
|||||||
@@ -391,12 +391,7 @@ def main():
|
|||||||
SimpleConfig.GUI_NAME.key(): 'qml',
|
SimpleConfig.GUI_NAME.key(): 'qml',
|
||||||
SimpleConfig.WALLET_USE_SINGLE_PASSWORD.key(): True,
|
SimpleConfig.WALLET_USE_SINGLE_PASSWORD.key(): True,
|
||||||
}
|
}
|
||||||
if util.get_android_package_name() == "org.electrum.testnet.electrum":
|
SimpleConfig.set_chain_config_opt_based_on_android_packagename(config_options)
|
||||||
# ~hack for easier testnet builds. pkgname subject to change.
|
|
||||||
config_options['testnet'] = True
|
|
||||||
elif util.get_android_package_name() == "org.electrum.regtest.electrum":
|
|
||||||
# ~hack for easier regtest builds. pkgname subject to change.
|
|
||||||
config_options['regtest'] = True
|
|
||||||
else:
|
else:
|
||||||
# save sys args for next parser
|
# save sys args for next parser
|
||||||
saved_sys_argv = sys.argv[:]
|
saved_sys_argv = sys.argv[:]
|
||||||
|
|||||||
Reference in New Issue
Block a user