def rewrite_config():
 CONFIG['MobSF']['dir'] = (expanduser('~') + CONFIG['MobSF']['dir'])
 CONFIG['MobSF']['downloads'] = (CONFIG['MobSF']['dir'] + CONFIG['MobSF']['downloads'])
 CONFIG['MobSF']['tools'] = (CONFIG['MobSF']['dir'] + CONFIG['MobSF']['tools'])
 CONFIG['MobSF']['samples'] = (CONFIG['MobSF']['dir'] + CONFIG['MobSF']['samples'])
 CONFIG['MobSF']['key_path'] = (CONFIG['MobSF']['dir'] + CONFIG['MobSF']['key_path'])
 CONFIG['MobSF']['priv_key'] = (CONFIG['MobSF']['key_path'] + CONFIG['MobSF']['priv_key'])
 CONFIG['MobSF']['pub_key'] = (CONFIG['MobSF']['key_path'] + CONFIG['MobSF']['pub_key'])
 with open(os.path.join(CONFIG_PATH, CONFIG_FILE), 'w') as configfile:
  CONFIG.write(configfile)

def rewrite_config ( ) : CONFIG [ 'MobSF' ] [ 'dir' ] = ( expanduser ( '~' ) + CONFIG [ 'MobSF' ] [ 'dir' ] ) CONFIG [ 'MobSF' ] [ 'downloads' ] = ( CONFIG [ 'MobSF' ] [ 'dir' ] + CONFIG [ 'MobSF' ] [ 'downloads' ] ) CONFIG [ 'MobSF' ] [ 'tools' ] = ( CONFIG [ 'MobSF' ] [ 'dir' ] + CONFIG [ 'MobSF' ] [ 'tools' ] ) CONFIG [ 'MobSF' ] [ 'samples' ] = ( CONFIG [ 'MobSF' ] [ 'dir' ] + CONFIG [ 'MobSF' ] [ 'samples' ] ) CONFIG [ 'MobSF' ] [ 'key_path' ] = ( CONFIG [ 'MobSF' ] [ 'dir' ] + CONFIG [ 'MobSF' ] [ 'key_path' ] ) CONFIG [ 'MobSF' ] [ 'priv_key' ] = ( CONFIG [ 'MobSF' ] [ 'key_path' ] + CONFIG [ 'MobSF' ] [ 'priv_key' ] ) CONFIG [ 'MobSF' ] [ 'pub_key' ] = ( CONFIG [ 'MobSF' ] [ 'key_path' ] + CONFIG [ 'MobSF' ] [ 'pub_key' ] ) with open ( os . path . join ( CONFIG_PATH , CONFIG_FILE ) , 'w' ) as configfile : CONFIG . write ( configfile )
rewrite the config to take the profile path as the base path .