HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/platformdirs/__pycache__/android.cpython-310.pyc
o

j�h5#�@s�dZddlmZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZGdd	�d	e�Z
edd
�dd
d��Zedd
�ddd��Zedd
�ddd��Zedd
�ddd��Zedd
�ddd��Zedd
�ddd��Zd	gZdS)zAndroid.�)�annotationsN)�	lru_cache)�
TYPE_CHECKING�cast�)�PlatformDirsABCc@s�eZdZdZed%dd��Zed%dd��Zed%dd	��Zed%d
d��Zed%dd
��Z	ed%dd��Z
ed%dd��Zed%dd��Zed%dd��Z
ed%dd��Zed%dd��Zed%dd��Zed%dd��Zed%dd��Zed%d d!��Zed%d"d#��Zd$S)&�Androida"
    Follows the guidance `from here <https://android.stackexchange.com/a/216132>`_.

    Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `version
    <platformdirs.api.PlatformDirsABC.version>`, `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.

    �return�strcC�|�tdt��d�S)zd:return: data directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/files/<AppName>``r
�files��_append_app_name_and_versionr�_android_folder��self�r�?/usr/local/lib/python3.10/dist-packages/platformdirs/android.py�
user_data_dir�zAndroid.user_data_dircC�|jS)z@:return: data directory shared by users, same as `user_data_dir`�rrrrr�
site_data_dir�zAndroid.site_data_dircCr)z�
        :return: config directory tied to the user, e.g.         ``/data/user/<userid>/<packagename>/shared_prefs/<AppName>``
        r
�shared_prefsr
rrrr�user_config_dir!szAndroid.user_config_dircCr)zH:return: config directory shared by the users, same as `user_config_dir`)rrrrr�site_config_dir)rzAndroid.site_config_dircCr)ze:return: cache directory tied to the user, e.g.,``/data/user/<userid>/<packagename>/cache/<AppName>``r
�cacher
rrrr�user_cache_dir.rzAndroid.user_cache_dircCr)zB:return: cache directory shared by users, same as `user_cache_dir`)rrrrr�site_cache_dir3rzAndroid.site_cache_dircCr)zB:return: state directory tied to the user, same as `user_data_dir`rrrrr�user_state_dir8rzAndroid.user_state_dircC�|j}|jr
tj�|d�}|S)z�
        :return: log directory tied to the user, same as `user_cache_dir` if not opinionated else ``log`` in it,
          e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>/log``
        �log�r�opinion�os�path�join�rr&rrr�user_log_dir=�zAndroid.user_log_dircC�t�S)zT:return: documents directory tied to the user e.g. ``/storage/emulated/0/Documents``)�_android_documents_folderrrrr�user_documents_dirHrzAndroid.user_documents_dircCr+)zT:return: downloads directory tied to the user e.g. ``/storage/emulated/0/Downloads``)�_android_downloads_folderrrrr�user_downloads_dirMrzAndroid.user_downloads_dircCr+)zR:return: pictures directory tied to the user e.g. ``/storage/emulated/0/Pictures``)�_android_pictures_folderrrrr�user_pictures_dirRrzAndroid.user_pictures_dircCr+)zS:return: videos directory tied to the user e.g. ``/storage/emulated/0/DCIM/Camera``)�_android_videos_folderrrrr�user_videos_dirWrzAndroid.user_videos_dircCr+)zL:return: music directory tied to the user e.g. ``/storage/emulated/0/Music``)�_android_music_folderrrrr�user_music_dir\rzAndroid.user_music_dircCsdS)zP:return: desktop directory tied to the user e.g. ``/storage/emulated/0/Desktop``z/storage/emulated/0/Desktoprrrrr�user_desktop_diraszAndroid.user_desktop_dircCr!)z�
        :return: runtime directory tied to the user, same as `user_cache_dir` if not opinionated else ``tmp`` in it,
          e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>/tmp``
        �tmpr#r(rrr�user_runtime_dirfr*zAndroid.user_runtime_dircCr)zF:return: runtime directory shared by users, same as `user_runtime_dir`)r8rrrr�site_runtime_dirqrzAndroid.site_runtime_dirN�r	r
)�__name__�
__module__�__qualname__�__doc__�propertyrrrrrrr r)r-r/r1r3r5r6r8r9rrrrrsD

r)�maxsizer	�
str | NonecCsd}ts'zddlm}td|���}|������}Wnty&d}Ynw|durKzddl	m
}|d�}|������}WntyJd}Ynw|durjt�d�}t
jD]}|�|�rg|�d�d}nqWd}|dur�t�d�}t
jD]}|�|�r�|�d�d}|Sqvd}|S)	zE:return: base folder for the Android OS or None if it cannot be foundNr)�	mActivity�android.content.Context��	autoclassz /data/(data|user/\d+)/(.+)/filesz/filesz7/mnt/expand/[a-fA-F0-9-]{36}/(data|user/\d+)/(.+)/files)r�androidrBr�getApplicationContext�getFilesDir�
getParentFile�getAbsolutePath�	Exception�jniusrE�re�compile�sysr&�match�split)�resultrB�contextrE�patternr&rrrrwsF��


�


�rr
cC�Lzddlm}|d�}|d�}|�|j���}W|Sty%d}Y|Sw)z,:return: documents folder for the Android OSrrDrC�android.os.Environmentz/storage/emulated/0/Documents)rLrE�getExternalFilesDir�DIRECTORY_DOCUMENTSrJrK)rErS�environment�
documents_dirrrrr,����r,cCrU)z,:return: downloads folder for the Android OSrrDrCrVz/storage/emulated/0/Downloads)rLrErW�DIRECTORY_DOWNLOADSrJrK)rErSrY�
downloads_dirrrrr.�r[r.cCrU)z+:return: pictures folder for the Android OSrrDrCrVz/storage/emulated/0/Pictures)rLrErW�DIRECTORY_PICTURESrJrK)rErSrY�pictures_dirrrrr0�r[r0cCrU)z):return: videos folder for the Android OSrrDrCrVz/storage/emulated/0/DCIM/Camera)rLrErW�DIRECTORY_DCIMrJrK)rErSrY�
videos_dirrrrr2�r[r2cCrU)z(:return: music folder for the Android OSrrDrCrVz/storage/emulated/0/Music)rLrErW�DIRECTORY_MUSICrJrK)rErSrY�	music_dirrrrr4�r[r4)r	rAr:)r>�
__future__rr%rMrO�	functoolsr�typingrr�apirrrr,r.r0r2r4�__all__rrrr�<module>s.i/�