def try_auto_key_setup(self, pubkey_hex: str) -> bool:
        """Can be called from the GUI to store the plugin pubkey as root/admin user"""
        try:
            if sys.platform in ['windows', 'win32']:
                self._write_key_to_regedit_windows(pubkey_hex)
            elif 'ANDROID_DATA' in os.environ:
                raise Exception('platform not supported')
            elif sys.platform.startswith('darwin'):  # macOS
                self._write_key_to_root_file_macos(pubkey_hex)
            else:
                self._write_key_to_root_file_linux(pubkey_hex)
        except Exception:
            self.logger.exception(f"auto-key setup for {pubkey_hex} failed")
            return False
        return True
Can be called from the GUI to store the plugin pubkey as root/admin user
electrum/plugin.py