termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
34.93k stars 3.67k forks source link

[Bug]: Unable to install bootstrap #3167

Closed ltomb closed 1 year ago

ltomb commented 1 year ago

Problem description

Unable to install termux on oneplus 6t, on android 11. Termux was downloaded from Github. Looking in previous issues, I checked the connection to http://termux.net/bootstrap/ and i get PAGE_NOT_FOUND.

Anyway here's the log

Report Info

User Action: crash report
Sender: TermuxInstaller
Report Timestamp: 2023-01-03 08:56:24.843 UTC

Bootstrap Error

(150) FileUtils Error: The termux files directory not found at path "/data/data/com.termux/files". TERMUX_FILES_DIR: /data/data/com.termux/files

Termux Files Info

TERMUX_REQUIRED_FILES_DIR_PATH ($PREFIX): /data/data/com.termux/files
ANDROID_ASSIGNED_FILES_DIR_PATH: /data/user/0/com.termux/files

$ echo 'ls info:'
/system/bin/ls -lhdZ '/data/data' '/data/user/0' '/data/data/com.termux' '/data/user/0/com.termux' '/data/data/com.termux/files' '/data/user/0/com.termux/files' '/data/user/0/com.termux/files' '/data/user/com.termux/files' '/data/data/com.termux/files/usr-staging' '/data/data/com.termux/files/usr' '/data/data/com.termux/files/home' '/data/data/com.termux/files/usr/bin/login' 2>&1
echo; echo 'mount info:'
/system/bin/grep -E '( /data )|( /data/data )|( /data/user/[0-9]+ )' /proc/self/mountinfo 2>&1 | /system/bin/grep -v '/data_mirror' 2>&1

ls info:
ls: /data/data/com.termux/files: Permission denied
ls: /data/user/0/com.termux/files: Permission denied
ls: /data/user/0/com.termux/files: Permission denied
ls: /data/user/com.termux/files: No such file or directory
ls: /data/data/com.termux/files/usr-staging: Permission denied
ls: /data/data/com.termux/files/usr: Permission denied
ls: /data/data/com.termux/files/home: Permission denied
ls: /data/data/com.termux/files/usr/bin/login: Permission denied
drwxrwx--x 452 system  system  u:object_r:system_data_file:s0                   36K 2023-01-02 15:07 /data/data
drwx------   3 u0_a600 u0_a600 u:object_r:app_data_file:s0:c81,c258,c512,c768  4.0K 2023-01-03 09:49 /data/data/com.termux
drwxrwx--x 452 system  system  u:object_r:system_data_file:s0                   36K 2023-01-02 15:07 /data/user/0
drwx------   3 u0_a600 u0_a600 u:object_r:app_data_file:s0:c81,c258,c512,c768  4.0K 2023-01-03 09:49 /data/user/0/com.termux

mount info:
20905 20801 259:1 / /data rw,nosuid,nodev,noatime master:30 - ext4 /dev/block/bootdevice/by-name/userdata rw,seclabel,discard,noauto_da_alloc,resgid=1065,data=ordered
20906 20905 259:1 /data /data/user/0 rw,nosuid,nodev,noatime master:30 - ext4 /dev/block/bootdevice/by-name/userdata rw,seclabel,discard,noauto_da_alloc,resgid=1065,data=ordered

Logcat Dump

$ /system/bin/logcat -d -t 3000 2>&1
--------- beginning of main
01-03 09:56:22.494 10103 10103 I com.termux: Late-enabling -Xcheck:jni
01-03 09:56:22.511 10103 10103 I com.termux: Unquickening 21 vdex files!
01-03 09:56:22.560 10103 10103 E com.termux: Unknown bits set in runtime_flags: 0x800000
01-03 09:56:22.783 10103 10103 W re-initialized>: type=1400 audit(0.0:25189): avc: denied { search } for name="com.termux" dev="sda17" ino=4710699 scontext=u:r:untrusted_app_27:s0:c88,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c81,c258,c512,c768 tclass=dir permissive=0 app=com.termux
01-03 09:56:22.833 10103 10103 D ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
--------- beginning of perf
01-03 09:56:22.912 10103 10103 I 100     : Open /data/app/~~PNfNajqQfjeoKKASVxvofA==/com.termux-ZX5Dlm5fBhytVdCkBGGJcA==/base.apk took:78ms
01-03 09:56:22.925 10103 10103 W com.termux: JIT profile information will not be recorded: profile file does not exist.
01-03 09:56:22.964 10103 10103 I Perf    : Connecting to perf service.
01-03 09:56:22.963 10103 10103 W com.termux: type=1400 audit(0.0:25190): avc: denied { search } for name="com.termux" dev="sda17" ino=4710699 scontext=u:r:untrusted_app_27:s0:c88,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c81,c258,c512,c768 tclass=dir permissive=0 app=com.termux
01-03 09:56:22.963 10103 10103 I chatty  : uid=10600(com.termux) identical 1 line
01-03 09:56:22.963 10103 10103 W com.termux: type=1400 audit(0.0:25192): avc: denied { search } for name="com.termux" dev="sda17" ino=4710699 scontext=u:r:untrusted_app_27:s0:c88,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c81,c258,c512,c768 tclass=dir permissive=0 app=com.termux
01-03 09:56:22.970 10103 10103 W ContextImpl: Failed to ensure /data/user/0/com.termux/cache: mkdir failed: EACCES (Permission denied)
01-03 09:56:22.970 10103 10103 W ContextImpl: Failed to update user.inode_cache: stat failed: EACCES (Permission denied)
01-03 09:56:22.972 10103 10103 W ContextImpl: Failed to ensure /data/user_de/0/com.termux/code_cache: mkdir failed: ENOENT (No such file or directory)
01-03 09:56:22.972 10103 10103 W ContextImpl: Failed to update user.inode_code_cache: stat failed: ENOENT (No such file or directory)
01-03 09:56:22.986 10103 10103 I com.termux: [GL_OOM] ClampGrowthLimit 268435456
01-03 09:56:22.990 10103 10103 D NetworkSecurityConfig: No Network Security Config specified, using platform default
01-03 09:56:22.992 10103 10103 D NetworkSecurityConfig: No Network Security Config specified, using platform default
01-03 09:56:23.003 10103 10103 W Binder:10103_2: type=1400 audit(0.0:25193): avc: denied { search } for name="com.termux" dev="sda17" ino=4710699 scontext=u:r:untrusted_app_27:s0:c88,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c81,c258,c512,c768 tclass=dir permissive=0 app=com.termux
01-03 09:56:23.022 10103 10103 E Config:Grabber:OnePlusFontConfig: Index 0 requested, with a size of 0
01-03 09:56:23.029 10103 10103 W ContextImpl: Failed to ensure /data/user/0/com.termux/shared_prefs: mkdir failed: EACCES (Permission denied)
01-03 09:56:23.059 10103 10103 E com.termux: [frame_perf] perfboost open tb_ctl file failed, isApp[1], errno=No such file or directory
01-03 09:56:23.060 10103 10103 E libprocessgroup: set_timerslack_ns write failed: Operation not permitted
01-03 09:56:23.093 10103 10103 W ContextImpl: Failed to ensure /data/user/0/com.termux/shared_prefs: mkdir failed: EACCES (Permission denied)
01-03 09:56:23.098 10103 28521 E Termux  : Failed to get file type for file at path "/data/data/com.termux/files/home/crash_log.md": Failed to run Os.lstat() on file at path "/data/data/com.termux/files/home/crash_log.md": lstat failed: EACCES (Permission denied)
01-03 09:56:23.099 10103 10103 W Termux:SharedProperties: Not loading properties since file is null
01-03 09:56:23.103 10103 28522 W ContextImpl: Failed to ensure /data/user/0/com.termux/cache: mkdir failed: EACCES (Permission denied)
01-03 09:56:23.103 10103 28522 W ContextImpl: Failed to update user.inode_cache: stat failed: EACCES (Permission denied)
01-03 09:56:23.104 10103 28522 E Termux  : Failed to get file type for file at path "/data/user/0/com.termux/cache/report_activity": Failed to run Os.lstat() on file at path "/data/user/0/com.termux/cache/report_activity": lstat failed: EACCES (Permission denied)
01-03 09:56:23.135 10103 28516 E SharedPreferencesImpl: Couldn't create directory for SharedPreferences file /data/user/0/com.termux/shared_prefs/com.termux_preferences.xml
01-03 09:56:23.135 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.141 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.154 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.156 10103 10103 I chatty  : uid=10600(com.termux) identical 2 lines
01-03 09:56:23.157 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.162 10103 10103 W ContextImpl: Failed to ensure /data/user/0/com.termux/shared_prefs: mkdir failed: EACCES (Permission denied)
01-03 09:56:23.208 10103 10103 I OPFD_Manager: Dark? false, OP Force ? false
01-03 09:56:23.209 10103 10103 V ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
--------- beginning of system
01-03 09:56:23.212 10103 10103 D ViewRootImpl: support adaptive color gamut feature!
01-03 09:56:23.219 10103 28525 D CCodec  : allocate(c2.android.vorbis.decoder)
01-03 09:56:23.221 10103 28525 I Codec2Client: Available Codec2 services: "software"
01-03 09:56:23.239 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.243 10103 10103 I chatty  : uid=10600(com.termux) identical 4 lines
01-03 09:56:23.243 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.244 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.246 10103 10103 I chatty  : uid=10600(com.termux) identical 4 lines
01-03 09:56:23.247 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.250 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.256 10103 10103 I chatty  : uid=10600(com.termux) identical 10 lines
01-03 09:56:23.256 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.257 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.258 10103 10103 I chatty  : uid=10600(com.termux) identical 2 lines
01-03 09:56:23.259 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.271 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.272 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.272 10103 10103 E com.termux: Invalid ID 0x00000000.
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: QUALCOMM build                   : 8e5405b, I57aaec3440
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: Build Date                       : 05/21/21
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.32.02.10
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: Local Branch                     : mybranchebba1dbe-451b-f160-ac81-1458d0b52ae8
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: Remote Branch                    : quic/gfx-adreno.lnx.1.0.r135-rel
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: Remote Branch                    : NONE
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: Reconstruct Branch               : NOTHING
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: Build Config                     : S P 10.0.7 AArch64
01-03 09:56:23.548 10103 28517 I AdrenoGLES-0: Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so
01-03 09:56:23.551 10103 28525 I CCodec  : Created component [c2.android.vorbis.decoder]
01-03 09:56:23.551 10103 28517 I AdrenoGLES-0: PFP: 0x016ee190, ME: 0x00000000
01-03 09:56:23.551 10103 28525 D CCodecConfig: read media type: audio/vorbis
01-03 09:56:23.552 10103 28525 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.max-count.values
01-03 09:56:23.552 10103 28525 D ReflectedParamUpdater: extent() != 1 for single value type: output.subscribed-indices.values
01-03 09:56:23.552 10103 28525 D ReflectedParamUpdater: extent() != 1 for single value type: input.buffers.allocator-ids.values
01-03 09:56:23.553 10103 28525 D ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.allocator-ids.values
01-03 09:56:23.553 10103 28525 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.allocator-ids.values
01-03 09:56:23.553 10103 28525 D ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.pool-ids.values
01-03 09:56:23.553 10103 28525 D ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.pool-ids.values
01-03 09:56:23.554 10103 28525 I CCodecConfig: query failed after returning 7 values (BAD_INDEX)
01-03 09:56:23.554 10103 28525 D CCodecConfig: c2 config diff is Dict {
01-03 09:56:23.554 10103 28525 D CCodecConfig:   c2::u32 coded.bitrate.value = 64000
01-03 09:56:23.554 10103 28525 D CCodecConfig:   c2::u32 input.buffers.max-size.value = 32768
01-03 09:56:23.554 10103 28525 D CCodecConfig:   c2::u32 input.delay.value = 0
01-03 09:56:23.554 10103 28525 D CCodecConfig:   string input.media-type.value = "audio/vorbis"
01-03 09:56:23.554 10103 28525 D CCodecConfig:   string output.media-type.value = "audio/raw"
01-03 09:56:23.554 10103 28525 D CCodecConfig:   c2::u32 raw.channel-count.value = 1
01-03 09:56:23.554 10103 28525 D CCodecConfig:   c2::u32 raw.sample-rate.value = 48000
01-03 09:56:23.554 10103 28525 D CCodecConfig: }
01-03 09:56:23.554 10103 28525 D CCodec  : [c2.android.vorbis.decoder] buffers are bound to CCodec for this session
01-03 09:56:23.554 10103 28525 D CCodecConfig: no c2 equivalents for durationUs
01-03 09:56:23.554 10103 28525 D CCodecConfig: no c2 equivalents for track-id
01-03 09:56:23.554 10103 28525 D CCodecConfig: no c2 equivalents for csd-1
01-03 09:56:23.554 10103 28525 D CCodecConfig: no c2 equivalents for language
01-03 09:56:23.554 10103 28525 D CCodecConfig: no c2 equivalents for file-format
01-03 09:56:23.554 10103 28525 D CCodecConfig: no c2 equivalents for flags
01-03 09:56:23.555 10103 28525 D CCodecConfig: config failed => CORRUPTED
01-03 09:56:23.555 10103 28525 D CCodecConfig: c2 config diff is   c2::u32 raw.sample-rate.value = 44100
01-03 09:56:23.555 10103 28525 W Codec2Client: query -- param skipped: index = 1107298332.
01-03 09:56:23.555 10103 28525 D CCodec  : setup formats input: AMessage(what = 0x00000000) = {
01-03 09:56:23.555 10103 28525 D CCodec  :   int32_t channel-count = 1
01-03 09:56:23.555 10103 28525 D CCodec  :   int32_t max-input-size = 65307
01-03 09:56:23.555 10103 28525 D CCodec  :   string mime = "audio/vorbis"
01-03 09:56:23.555 10103 28525 D CCodec  :   int32_t sample-rate = 44100
01-03 09:56:23.555 10103 28525 D CCodec  : } and output: AMessage(what = 0x00000000) = {
01-03 09:56:23.555 10103 28525 D CCodec  :   int32_t channel-count = 1
01-03 09:56:23.555 10103 28525 D CCodec  :   string mime = "audio/raw"
01-03 09:56:23.555 10103 28525 D CCodec  :   int32_t sample-rate = 44100
01-03 09:56:23.555 10103 28525 D CCodec  : }
01-03 09:56:23.555 10103 28525 W Codec2Client: query -- param skipped: index = 1342179345.
01-03 09:56:23.555 10103 28525 W Codec2Client: query -- param skipped: index = 2415921170.
01-03 09:56:23.556 10103 28525 E FMQ     : grantorIdx must be less than 3
01-03 09:56:23.556 10103 28525 E FMQ     : grantorIdx must be less than 3
01-03 09:56:23.556 10103 28525 D CCodecBufferChannel: [c2.android.vorbis.decoder#754] Created input block pool with allocatorID 16 => poolID 17 - OK (0)
01-03 09:56:23.557 10103 28525 I CCodecBufferChannel: [c2.android.vorbis.decoder#754] Created output block pool with allocatorID 16 => poolID 1259 - OK
01-03 09:56:23.557 10103 28525 D CCodecBufferChannel: [c2.android.vorbis.decoder#754] Configured output block pool ids 1259 => OK
01-03 09:56:23.557 10103 28525 D CCodecBufferChannel: [c2.android.vorbis.decoder#754] start: updating output delay 0
01-03 09:56:23.557 10103 28525 E ion     : ioctl c0044901 failed with code -1: Invalid argument
01-03 09:56:23.558 10103 28525 E FMQ     : grantorIdx must be less than 3
01-03 09:56:23.563 10103 28529 E FMQ     : grantorIdx must be less than 3
01-03 09:56:23.574 10103 28525 D CCodecBufferChannel: [c2.android.vorbis.decoder#754] MediaCodec discarded an unknown buffer
01-03 09:56:23.574 10103 28525 I chatty  : uid=10600(com.termux) identical 1 line
01-03 09:56:23.574 10103 28525 D CCodecBufferChannel: [c2.android.vorbis.decoder#754] MediaCodec discarded an unknown buffer
01-03 09:56:23.575 10103 28525 I hw-BpHwBinder: onLastStrongRef automatically unlinking death recipients
01-03 09:56:23.594 10103 28517 I Gralloc4: mapper 4.x is not supported
01-03 09:56:23.594 10103 28517 W Gralloc3: mapper 3.x is not supported
01-03 09:56:23.633 10103 10103 D DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@8770456[TermuxActivity]
01-03 09:56:23.634 10103 10103 D ViewRootImpl[TermuxActivity]: windowFocusChanged hasFocus=true inTouchMode=true
01-03 09:56:23.648 10103 10103 W ContextImpl: Failed to ensure /data/user/0/com.termux/files: mkdir failed: EACCES (Permission denied)
01-03 09:56:23.648 10103 10103 E Termux  : Failed to get file type for file at path "/data/data/com.termux/files": Failed to run Os.stat() on file at path "/data/data/com.termux/files": stat failed: EACCES (Permission denied)
01-03 09:56:23.650 10103 10103 E Termux:TermuxInstaller: (150) FileUtils Error: The termux files directory not found at path "/data/data/com.termux/files".
01-03 09:56:23.650 10103 10103 E Termux:TermuxInstaller: TERMUX_FILES_DIR: `/data/data/com.termux/files`
01-03 09:56:23.652 10103 10103 W ContextImpl: Failed to ensure /data/user/0/com.termux/files: mkdir failed: EACCES (Permission denied)
01-03 09:56:23.663 10103 10103 W com.termux: Accessing hidden field Ljava/lang/UNIXProcess;->pid:I (greylist, reflection, allowed)
01-03 09:56:24.413 28540 28540 W ls      : type=1400 audit(0.0:25233): avc: denied { search } for name="com.termux" dev="sda17" ino=4710699 scontext=u:r:untrusted_app_27:s0:c88,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c81,c258,c512,c768 tclass=dir permissive=0 app=com.termux
01-03 09:56:24.433 28540 28540 I chatty  : uid=10600(com.termux) /system/bin/ls identical 3 lines
01-03 09:56:24.433 28540 28540 W ls      : type=1400 audit(0.0:25237): avc: denied { search } for name="com.termux" dev="sda17" ino=4710699 scontext=u:r:untrusted_app_27:s0:c88,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c81,c258,c512,c768 tclass=dir permissive=0 app=com.termux

Termux App Info

APP_NAME: Termux
PACKAGE_NAME: com.termux
VERSION_NAME: 0.118.0
VERSION_CODE: 118
TARGET_SDK: 28
IS_DEBUGGABLE_BUILD: true
TERMUX_FILES_DIR: /data/data/com.termux/files
IS_TERMUX_FILES_DIR_ACCESSIBLE: false - (150) FileUtils Error: The termux files directory not found at path "/data/data/com.termux/files".
APK_RELEASE: Github
SIGNING_CERTIFICATE_SHA256_DIGEST: B6DA01480EEFD5FBF2CD3771B8D1021EC791304BDD6C4BF41D3FAABAD48EE5E1

Device Info

Software

OS_VERSION: 4.9.227-perf+
SDK_INT: 30
RELEASE: 11
ID: RKQ1.201217.002
DISPLAY: ONEPLUS A6013_41_211125
INCREMENTAL: 2111252327
SECURITY_PATCH: 2021-07-01
IS_DEBUGGABLE: 0
IS_TREBLE_ENABLED: true
TYPE: user
TAGS: release-keys

Hardware

MANUFACTURER: OnePlus
BRAND: OnePlus
MODEL: ONEPLUS A6013
PRODUCT: OnePlus6T
BOARD: sdm845
HARDWARE: qcom
DEVICE: OnePlus6T
SUPPORTED_ABIS: arm64-v8a, armeabi-v7a, armeabi

Steps to reproduce the behavior.

Installing from github APK, release 0.118

What is the expected behavior?

No response

System information

agnostic-apollo commented 1 year ago

avc: denied { search } for name="com.termux" dev="sda17" ino=4710699 scontext=u:r:untrusted_app_27:s0:c88,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c81,c258,c512,c768 tclass=dir permissive=0 app=com.termux

drwx------ 3 u0_a600 u0_a600 u:object_r:app_data_file:s0:c81,c258,c512,c768 4.0K 2023-01-03 09:49 /data/data/com.termux

Issue is that your /data/data/com.termux directory is owned by uid 10600, the same as termux app process security context c88,c258 but security context assigned to the directory is c81,c258, which is for uid 10593, resulting in selinux denials.

If you are rooted, there may have been root owned files under /data/data/com.termux that prevented deletion of the directory during last uninstallation.

If you are rooted, then run su -c "rm -rf '/data/data/com.termux'" from a failsafe session, then uninstall termux app and install termux app again.

https://wiki.termux.com/wiki/Recover_a_broken_environment

If you are not rooted, then try uninstalling termux app, then rebooting and installing it again. If same issue, then factory reset would likely be required since won't be able to delete directory or restore its context with restorecon without root AFAIK, the adb shell user doesn't have such privileges either.

I checked the connection to http://termux.net/bootstrap/ and i get PAGE_NOT_FOUND.

That is from very old version. Termux does not download bootstrap anymore and is irrelevant.

Closing since not an issue with termux app itself.

Multi-Category Security

The c[0-9]+,c[0-9]+,c[0-9]+,c[0-9]+ categories are part of Multi-Category Security (MCS) and required to Isolate the app data from access by another app and Isolate the app data from one physical user to another. Both the process and file security context have categories assigned and the process categories must be a superset or equal the file categories to be allowed access. For example for c160,c256,c512,c768:

AID_USER_OFFSET 100000 /* offset for uid ranges for each user */
AID_APP_START 10000 /* first app user */
AID_APP_END 19999   /* last app user */
profile user 0: (0 * 100000 + 10000 + 160) -> 10160/u0_a160
profile user 10: (10 * 100000 + 10000 + 160) -> 1010160/u10_a160
profile user 256: (256 * 100000 + 10000 + 160) -> 25610160/u256_a160
public static String getCategories(int uid) {
    int userid = (uid / 100000 /* AID_USER_OFFSET */);
    int appid = ((uid % 100000 /* AID_USER_OFFSET */) - 10000 /* AID_APP_START */);
    return "c" + (appid & 0xff) +
            ",c" + (256 + (appid>>8 & 0xff)) +
            ",c" + (512 + (userid & 0xff)) +
            ",c" + (768 + (userid>>8 & 0xff));
}
# (uid, userid) = (categories)

(10000,0) = (c0,c256,c512,c768)
(10088,0) = (c88,c256,c512,c768)
(10099,0) = (c99,c256,c512,c768)
(10100,0) = (c100,c256,c512,c768)
(10160,0) = (c160,c256,c512,c768)
(10212,0) = (c212,c256,c512,c768)
(10255,0) = (c255,c256,c512,c768)
(10256,0) = (c0,c257,c512,c768)
(10511,0) = (c255,c257,c512,c768)
(10512,0) = (c0,c258,c512,c768)
(10593,0) = (c81,c258,c512,c768)
(10600,0) = (c88,c258,c512,c768)
(10999,0) = (c231,c259,c512,c768)
(11000,0) = (c232,c259,c512,c768)
(1010000,10) = (c0,c256,c522,c768)
(1010088,10) = (c88,c256,c522,c768)
(1010099,10) = (c99,c256,c522,c768)
(1010100,10) = (c100,c256,c522,c768)
(1010160,10) = (c160,c256,c522,c768)
(1010212,10) = (c212,c256,c522,c768)
(1010255,10) = (c255,c256,c522,c768)
(1010256,10) = (c0,c257,c522,c768)
(1010511,10) = (c255,c257,c522,c768)
(1010512,10) = (c0,c258,c522,c768)
(1010593,10) = (c81,c258,c522,c768)
(1010600,10) = (c88,c258,c522,c768)
(1010999,10) = (c231,c259,c522,c768)
(1011000,10) = (c232,c259,c522,c768)
(25610160,256) = (c160,c256,c512,c769)
(25610255,256) = (c255,c256,c512,c769)
(25610256,256) = (c0,c257,c512,c769)
(25610511,256) = (c255,c257,c512,c769)
(25610512,256) = (c0,c258,c512,c769)
(25610600,256) = (c88,c258,c512,c769)
ltomb commented 1 year ago

Thanks for your reply,

  • Did you install termux previously and uninstalled it?
  • Are you rooted?
  • Did you restore termux app data with a backup app?

If you are rooted, there may have been root owned files under /data/data/com.termux that prevented deletion of the directory during last uninstallation.

Under /data/data/ I have no com.termux folder

If you are rooted, then uninstall termux app, then run su -c "rm -rf '/data/data/com.termux'" from a failsafe session and install termux app again.

How should I run a Failsafe session with no termux app installed?

ltomb commented 1 year ago

I managed to solve by manually deleting the com.termux folder in /data_mirror/data_ce/null/0 and then reinstalling. Since in Android 11 data/data folder is no longer accessible for privacy reason, i couldn't access the directory from solid explorer. And i also could not run any command from termux

https://forum.xda-developers.com/t/android-11-how-to-access-and-modify-all-files-in-root-data-data.4373729/ https://www.ghisler.ch/board/viewtopic.php?t=75934

agnostic-apollo commented 1 year ago

Welcome. Cool.