dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.92k stars 526 forks source link

Call ZipArchive.ExtractToDirectory throws System.UnauthorizedAccessException. #6343

Closed ibocon closed 2 years ago

ibocon commented 2 years ago

Steps to Reproduce

  1. Prepare SAMSUNG Galaxy Note 4 or 5 (Android 7.0 or lower)
  2. Download and Run reproducing project. Github
  3. Allow 'WriteExternalStorage' permission
  4. Tap 'DECOMPRESS' button

Expected Behavior

  1. 'Test.zip' decompress to ExternalFilesDir
  2. Read 'Test.txt'
  3. See 'Hello, World!' on button.

Actual Behavior

throw System.UnauthorizedAccessException.

System.UnauthorizedAccessException: Access to the path '/storage/emulated/0/Android/data/com.ibocon.unauthorizedaccessexception/files/Test.txt' is denied. ---> System.IO.IOException: Operation not permitted --- End of inner exception stack trace ---

Version Information

Android Device

Screenshot_2021-09-28-16-13-20

OS

image

Visual Studio for Mac

image

=== Visual Studio Professional 2019 for Mac ===

Version 8.10.9 (build 3)
Installation UUID: e3325b65-6a88-49a9-aa3b-68f3453213cc
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

    Package version: 612000140

=== Mono Framework MDK ===

Runtime:
    Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit)
    Package version: 612000140

=== Roslyn (Language Service) ===

3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb

=== NuGet ===

Version: 5.9.0.7134

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/6.0.100-rc.1.21463.6/Sdks
SDK Versions:
    6.0.100-rc.1.21463.6
    6.0.100-preview.7.21379.14
    5.0.401
    5.0.400
    5.0.302
    5.0.301
    5.0.300
    5.0.203
    5.0.202
    5.0.201
    5.0.103
    5.0.102
    5.0.101
    5.0.100
    3.1.413
    3.1.412
    3.1.411
    3.1.410
    3.1.409
    3.1.408
    3.1.407
    3.1.406
    3.1.405
    3.1.404
    3.1.403
    3.1.402
    3.1.401
    3.1.300
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    6.0.0-rc.1.21451.13
    6.0.0-preview.7.21377.19
    5.0.10
    5.0.9
    5.0.8
    5.0.7
    5.0.6
    5.0.5
    5.0.4
    5.0.3
    5.0.2
    5.0.1
    5.0.0
    3.1.19
    3.1.18
    3.1.17
    3.1.16
    3.1.15
    3.1.14
    3.1.13
    3.1.12
    3.1.11
    3.1.10
    3.1.9
    3.1.8
    3.1.7
    3.1.4
    2.1.23
    2.1.22
    2.1.21
    2.1.18

=== .NET Core 3.1 SDK ===

SDK: 3.1.413

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Xamarin.Android ===

Version: 12.0.99.16 (Visual Studio Professional)
Commit: xamarin-android/main/8fa383d
Android SDK: /Users/yegunkim/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        7.0 (API level 24)
        7.1 (API level 25)
        8.0 (API level 26)
        8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 30.0.2

Build Information: 
Mono: c633fe9
Java.Interop: xamarin/java.interop/main@b7982e4
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.36.0@a575761
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@9b658b2

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/yegunkim/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.10.0.13
Hash: 1b81df5
Branch: remotes/origin/d16-10
Build date: 2021-08-12 20:43:52 UTC

=== Android Device Manager ===

Version: 16.10.0.15
Hash: 89dcc0b
Branch: remotes/origin/d16-10
Build date: 2021-08-12 20:44:10 UTC

=== Apple Developer Tools ===

Xcode 12.5.1 (18212)
Build 12E507

=== Xamarin.Mac ===

Version: 7.14.0.24 (Visual Studio Professional)
Hash: c4b89cddb
Branch: d16-10
Build date: 2021-06-15 22:03:00-0400

=== Xamarin.iOS ===

Version: 14.20.0.24 (Visual Studio Professional)
Hash: c4b89cddb
Branch: d16-10
Build date: 2021-06-15 22:03:01-0400

=== Xamarin Designer ===

Version: 16.10.0.119
Hash: 36a2d986f
Branch: remotes/origin/d16-10
Build date: 2021-06-02 19:41:34 UTC

=== Build Information ===

Release ID: 810090003
Git revision: 156eb53c9c668cb7ff4311ae3d1dab894549848b
Build date: 2021-09-08 07:26:54-04
Build branch: release-8.10

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.5.0 Darwin Kernel Version 20.5.0
    Sat May  8 05:10:33 PDT 2021
    root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

Xamarin.Forms HotReload extension 1.4.0
Log Monitor 0.2
.NET Core support for Mono.Debugging 8.0.5
EditorConfig 1.3
HotReloading 0.3.1

Log File

Forwarding debugger port 8895
Detecting existing process
> am start -n "com.ibocon.unauthorizedaccessexception/crc64b663678006b2d683.MainActivity"
> Starting: Intent { cmp=com.ibocon.unauthorizedaccessexception/crc64b663678006b2d683.MainActivity }

Loaded assembly: UnauthorizedAccessException.Android.dll
Loaded assembly: FormsViewGroup.dll
Loaded assembly: UnauthorizedAccessException.dll
Loaded assembly: Xamarin.AndroidX.Activity.dll
Loaded assembly: Xamarin.AndroidX.Annotation.dll
Loaded assembly: Xamarin.AndroidX.Annotation.Experimental.dll
Loaded assembly: Xamarin.AndroidX.AppCompat.AppCompatResources.dll
Loaded assembly: Xamarin.AndroidX.AppCompat.dll
Loaded assembly: Xamarin.AndroidX.Arch.Core.Common.dll
Loaded assembly: Xamarin.AndroidX.Arch.Core.Runtime.dll
Loaded assembly: Xamarin.AndroidX.AsyncLayoutInflater.dll
Loaded assembly: Xamarin.AndroidX.Browser.dll
Loaded assembly: Xamarin.AndroidX.CardView.dll
Loaded assembly: Xamarin.AndroidX.Collection.dll
Loaded assembly: Xamarin.AndroidX.CoordinatorLayout.dll
Loaded assembly: Xamarin.AndroidX.Core.dll
Loaded assembly: Xamarin.AndroidX.CursorAdapter.dll
Loaded assembly: Xamarin.AndroidX.CustomView.dll
Loaded assembly: Xamarin.AndroidX.DocumentFile.dll
Loaded assembly: Xamarin.AndroidX.DrawerLayout.dll
Loaded assembly: Xamarin.AndroidX.Fragment.dll
Loaded assembly: Xamarin.AndroidX.Interpolator.dll
Loaded assembly: Xamarin.AndroidX.Legacy.Support.Core.UI.dll
Loaded assembly: Xamarin.AndroidX.Legacy.Support.Core.Utils.dll
Loaded assembly: Xamarin.AndroidX.Legacy.Support.V4.dll
Loaded assembly: Xamarin.AndroidX.Lifecycle.Common.dll
Loaded assembly: Xamarin.AndroidX.Lifecycle.LiveData.Core.dll
Loaded assembly: Xamarin.AndroidX.Lifecycle.LiveData.dll
Loaded assembly: Xamarin.AndroidX.Lifecycle.Runtime.dll
Loaded assembly: Xamarin.AndroidX.Lifecycle.ViewModel.dll
Loaded assembly: Xamarin.AndroidX.Lifecycle.ViewModelSavedState.dll
Loaded assembly: Xamarin.AndroidX.Loader.dll
Loaded assembly: Xamarin.AndroidX.LocalBroadcastManager.dll
Loaded assembly: Xamarin.AndroidX.Media.dll
Loaded assembly: Xamarin.AndroidX.MultiDex.dll
Loaded assembly: Xamarin.AndroidX.Print.dll
Loaded assembly: Xamarin.AndroidX.RecyclerView.dll
Loaded assembly: Xamarin.AndroidX.SavedState.dll
Loaded assembly: Xamarin.AndroidX.SlidingPaneLayout.dll
Loaded assembly: Xamarin.AndroidX.SwipeRefreshLayout.dll
Loaded assembly: Xamarin.AndroidX.Transition.dll
Loaded assembly: Xamarin.AndroidX.VectorDrawable.Animated.dll
Loaded assembly: Xamarin.AndroidX.VectorDrawable.dll
Loaded assembly: Xamarin.AndroidX.VersionedParcelable.dll
Loaded assembly: Xamarin.AndroidX.ViewPager.dll
Loaded assembly: Xamarin.AndroidX.ViewPager2.dll
Loaded assembly: Xamarin.Essentials.dll
Loaded assembly: Xamarin.Forms.Core.dll
Loaded assembly: Xamarin.Forms.Platform.Android.dll
Loaded assembly: Xamarin.Forms.Platform.dll
Loaded assembly: Xamarin.Forms.Xaml.dll
Loaded assembly: Xamarin.Google.Android.Material.dll
Loaded assembly: Xamarin.Google.Guava.ListenableFuture.dll
Loaded assembly: Mono.Android.dll
Loaded assembly: Java.Interop.dll
Resolved pending breakpoint for 'Android.Runtime.JNIEnv.RegisterJniNatives(System.IntPtr, System.Int32, System.IntPtr, System.IntPtr, System.Int32)' to /Users/builder/azdo/_work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnv.cs:124 [0x00000].
Loaded assembly: System.dll
Loaded assembly: Mono.Security.dll
Loaded assembly: data-0x98bd5000
Loaded assembly: data-0x98b82000
Loaded assembly: data-0x98b9c000
Loaded assembly: data-0x98b40000
Loaded assembly: data-0x98b32000
Loaded assembly: netstandard.dll
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to /Users/runner/work/1/s/HotReload/Source/Xamarin.HotReload.Agent/HotReloadAgent.cs:405 [0x00000].
Loaded assembly: System.Core.dll
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to /Users/runner/work/1/s/HotReload/Source/Xamarin.HotReload.Agent/HotReloadAgent.cs:400 [0x00000].
[Zygote] v2
[SELinux] Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0035
[Zygote] accessInfo : 0
[libpersona] KNOX_SDCARD checking this for 10218
[libpersona] KNOX_SDCARD not a persona
[SELinux] SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.ibocon.unauthorizedaccessexception 
[art] Late-enabling -Xcheck:jni
[TimaKeyStoreProvider] TimaSignature is unavailable
[monodroid] Creating public update directory: `/data/user/0/com.ibocon.unauthorizedaccessexception/files/.__override__`
[art] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8895,server=y,embedding=1
[] Symbol file data-0x9e962000 doesn't match image UnauthorizedAccessException.dll
[] Symbol file LoadedFromMemory is not a mono symbol file
[] Symbol file data-0x9d44b000 doesn't match image Xamarin.AndroidX.AppCompat.dll
[] Symbol file LoadedFromMemory is not a mono symbol file
[] Symbol file data-0x9cf52000 doesn't match image Xamarin.AndroidX.Lifecycle.LiveData.dll
[] Symbol file LoadedFromMemory is not a mono symbol file
[] Symbol file data-0x9cc5c000 doesn't match image Xamarin.AndroidX.VectorDrawable.dll
[] Symbol file LoadedFromMemory is not a mono symbol file
[] Symbol file data-0x9c6c0000 doesn't match image Xamarin.Forms.Platform.dll
[] Symbol file LoadedFromMemory is not a mono symbol file
[monodroid-gc] GREF GC Threshold: 46080
[] Symbol file data-0x98d42000 doesn't match image System.dll
[] Symbol file LoadedFromMemory is not a mono symbol file
[art] Attempt to remove non-JNI local reference, dumping thread
[art] Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
[art] Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
[art] Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
[TextView] setTypeface with style : 0
[TextView] setTypeface with style : 0
Thread started:  #2
Thread started:  #3
Thread started:  #4
Loaded assembly: System.Runtime.Serialization.dll
Loaded assembly: System.Xml.dll
Loaded assembly: System.ServiceModel.Internals.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Forms.Platform.Android.AppLinks.dll
[TextView] setTypeface with style : 0
[SecWifiDisplayUtil] Metadata value : none
[ViewRootImpl] #1 mView = com.android.internal.policy.PhoneWindow$DecorView{d05c300 I.E...... R.....ID 0,0-0,0}
[OpenGLRenderer] Use EGL_SWAP_BEHAVIOR_PRESERVED: true
Thread started:  #5
[libEGL] eglInitialize EGLDisplay = 0x96e847c4
[OpenGLRenderer] Initialized EGL, version 1.4
[mali_winsys] new_window_surface returns 0x3000,  [1440x2560]-format:1
[DisplayListCanvas] DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
[ViewRootImpl] MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
[Timeline] Timeline: Activity_idle id: android.os.BinderProxy@89e2194 time:9873858
Thread started: <Thread Pool> #6
Thread started: <Thread Pool> #7
Thread started: <Thread Pool> #8
Thread started: <Thread Pool> #9
[Timeline] Timeline: Activity_idle id: android.os.BinderProxy@89e2194 time:9877096
Thread started: <Thread Pool> #10
[ViewRootImpl] ViewPostImeInputStage processPointer 0
[ViewRootImpl] ViewPostImeInputStage processPointer 1
Loaded assembly: System.IO.Compression.dll
Loaded assembly: System.IO.Compression.FileSystem.dll
Thread finished: <Thread Pool> #9
Thread finished: <Thread Pool> #10
Thread finished: <Thread Pool> #8
Thread finished: <Thread Pool> #7
Thread finished: <Thread Pool> #6
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
Thread started: <Thread Pool> #14
Thread finished: <Thread Pool> #12
Thread finished: <Thread Pool> #14
Thread started: <Thread Pool> #15

Notes

can be related with #3426 and issue

grendello commented 2 years ago

I don't have a relevant device, and I couldn't reproduce the issue neither on Pixel 3 XL running Android 11 nor in an emulator running Android 7. Can you please record a logcat output using these commands:

$ adb logcat -G 16M
$ adb shell setprop debug.mono.log default,assembly,mono_log_level=debug,mono_log_mask=io-layer
$ adb logcat -c
# start the application here and cause it to error out
$ adb logcat -d > logcat.txt

Please attach the logcat.txt file to this report, hopefully it will contain some clues we can follow, thanks!

ibocon commented 2 years ago

Terminal Output

$ adb logcat -G 16M
failed to set the log size(base)
$ adb logcat -g 16m
main: ring buffer is 2Mb (1Mb consumed), max entry is 5120b, max payload is 4076b
system: ring buffer is 256Kb (130Kb consumed), max entry is 5120b, max payload is 4076b
$ adb shell setprop debug.mono.log default,assembly,mono_log_level=debug,mono_log_mask=io-layer
$ adb logcat -c
# build and install, run application
$ adb logcat -d > ~/Desktop/logcat.txt

logcat.txt

logcat.txt

Note

On line 7186 - 7290, you may find useful info.

09-29 08:55:57.174 3429 3429 D Mono : mono_w32file_create: Opening /storage/emulated/0/Android/data/com.ibocon.unauthorizedaccessexception/files/Test.txt with share 0x0 and access 0x40000000

09-29 08:55:57.104  3429  3429 D Mono    : Request to load System.IO.Compression in (domain 0xae8a3a00, alc 0x0)
09-29 08:55:57.104  3429  3429 D Mono    : Found assembly remapping for System.IO.Compression and was for the same version 2.0.5.0
09-29 08:55:57.104  3429  3429 D Mono    : Found assembly remapping for System.IO.Compression and was for the same version 2.0.5.0
09-29 08:55:57.104  3429  3429 I monodroid-assembly: open_from_update_dir: trying to open assembly: /data/user/0/com.ibocon.unauthorizedaccessexception/files/.__override__/System.IO.Compression.dll
09-29 08:55:57.104  3429  3429 D monodroid-assembly: open_from_bundles: looking for bundled name: 'System.IO.Compression.dll'
09-29 08:55:57.104  3429  3429 I monodroid-assembly:                        mmap_start: 0x929dc000  mmap_end: 0x92a4f840  mmap_len:       118288  file_start: 0x929dca10  file_end: 0x92a4da10  file_len:       115712      apk descriptor: 22  file: System.IO.Compression.dll
09-29 08:55:57.104  3429  3429 I monodroid-assembly: file-offset:  4b7fa10  start: 0x929dca10  end: 0x929f8e10  len:       115712  zip-entry:  System.IO.Compression.dll name: System.IO.Compression.dll [MZ......]
09-29 08:55:57.109  3429  3429 D Mono    : mono_pe_file_map: Error opening file System.IO.Compression.dll (3): No such file or directory
09-29 08:55:57.109  3429  3429 I monodroid-assembly:                        mmap_start: 0x93c13000  mmap_end: 0x93c3aa60  mmap_len:        40600  file_start: 0x93c13e5c  file_end: 0x93c37f4c  file_len:        36924      apk descriptor: 22  file: System.IO.Compression.pdb
09-29 08:55:57.109  3429  3429 I Mono    : Image addref System.IO.Compression[0x9729a1c0] (asmctx DEFAULT) -> System.IO.Compression.dll[0x94a5ff00]: 3
09-29 08:55:57.109  3429  3429 I Mono    : Prepared to set up assembly 'System.IO.Compression' (System.IO.Compression.dll)
09-29 08:55:57.109  3429  3429 D Mono    : Loading assembly System.IO.Compression (0x9729a1c0) into domain RootDomain (0xae8a3a00) and ALC 0x0
09-29 08:55:57.109  3429  3429 I Mono    : Assembly System.IO.Compression[0x9729a1c0] added to domain RootDomain, ref_count=1
09-29 08:55:57.109  3429  3429 I Mono    : Assembly Ref addref netstandard[0x9cc2c8a0] -> System.IO.Compression[0x9729a1c0]: 2
09-29 08:55:57.109  3429  3429 I Mono    : Requesting loading reference 0 (of 2) of System.IO.Compression.dll
09-29 08:55:57.109  3429  3429 I Mono    : Loading reference 0 of System.IO.Compression.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
09-29 08:55:57.109  3429  3429 D Mono    : Request to load mscorlib in (domain 0xae8a3a00, alc 0x0)
09-29 08:55:57.109  3429  3429 D Mono    : Found assembly remapping for mscorlib and was for the same version 2.0.5.0
09-29 08:55:57.109  3429  3429 D Mono    : Found assembly remapping for mscorlib and was for the same version 2.0.5.0
09-29 08:55:57.109  3429  3429 I Mono    : Assembly Ref addref System.IO.Compression[0x9729a1c0] -> mscorlib[0xae571d40]: 61
09-29 08:55:57.109  3429  3429 I Mono    : Requesting loading reference 7 (of 16) of netstandard.dll
09-29 08:55:57.109  3429  3429 I Mono    : Loading reference 7 of netstandard.dll asmctx DEFAULT, looking for System.IO.Compression.FileSystem, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
09-29 08:55:57.109  3429  3429 D Mono    : Request to load System.IO.Compression.FileSystem in (domain 0xae8a3a00, alc 0x0)
09-29 08:55:57.109  3429  3429 D Mono    : Found assembly remapping for System.IO.Compression.FileSystem and was for the same version 2.0.5.0
09-29 08:55:57.109  3429  3429 D Mono    : Found assembly remapping for System.IO.Compression.FileSystem and was for the same version 2.0.5.0
09-29 08:55:57.109  3429  3429 I monodroid-assembly: open_from_update_dir: trying to open assembly: /data/user/0/com.ibocon.unauthorizedaccessexception/files/.__override__/System.IO.Compression.FileSystem.dll
09-29 08:55:57.109  3429  3429 D monodroid-assembly: open_from_bundles: looking for bundled name: 'System.IO.Compression.FileSystem.dll'
09-29 08:55:57.109  3429  3429 I monodroid-assembly:                        mmap_start: 0x973c0000  mmap_end: 0x973d5bc0  mmap_len:        22256  file_start: 0x973c0ef0  file_end: 0x973d2ef0  file_len:        18432      apk descriptor: 22  file: System.IO.Compression.FileSystem.dll
09-29 08:55:57.109  3429  3429 I monodroid-assembly: file-offset:  4ba4ef0  start: 0x973c0ef0  end: 0x973c56f0  len:        18432  zip-entry:  System.IO.Compression.FileSystem.dll name: System.IO.Compression.FileSystem.dll [MZ......]
09-29 08:55:57.109  3429  3429 D Mono    : mono_pe_file_map: Error opening file System.IO.Compression.FileSystem.dll (3): No such file or directory
09-29 08:55:57.109  3429  3429 I monodroid-assembly:                        mmap_start: 0x97882000  mmap_end: 0x97888690  mmap_len:         6564  file_start: 0x97882748  file_end: 0x978870b8  file_len:         4700      apk descriptor: 22  file: System.IO.Compression.FileSystem.pdb
09-29 08:55:57.109  3429  3429 I Mono    : Image addref System.IO.Compression.FileSystem[0x9729a160] (asmctx DEFAULT) -> System.IO.Compression.FileSystem.dll[0x972b4900]: 3
09-29 08:55:57.109  3429  3429 I Mono    : Prepared to set up assembly 'System.IO.Compression.FileSystem' (System.IO.Compression.FileSystem.dll)
09-29 08:55:57.109  3429  3429 D Mono    : Loading assembly System.IO.Compression.FileSystem (0x9729a160) into domain RootDomain (0xae8a3a00) and ALC 0x0
09-29 08:55:57.109  3429  3429 I Mono    : Assembly System.IO.Compression.FileSystem[0x9729a160] added to domain RootDomain, ref_count=1
09-29 08:55:57.109  3429  3429 I Mono    : Assembly Ref addref netstandard[0x9cc2c8a0] -> System.IO.Compression.FileSystem[0x9729a160]: 2
09-29 08:55:57.109  3429  3429 I Mono    : Requesting loading reference 0 (of 3) of System.IO.Compression.FileSystem.dll
09-29 08:55:57.109  3429  3429 I Mono    : Loading reference 0 of System.IO.Compression.FileSystem.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
09-29 08:55:57.109  3429  3429 D Mono    : Request to load mscorlib in (domain 0xae8a3a00, alc 0x0)
09-29 08:55:57.109  3429  3429 D Mono    : Found assembly remapping for mscorlib and was for the same version 2.0.5.0
09-29 08:55:57.109  3429  3429 D Mono    : Found assembly remapping for mscorlib and was for the same version 2.0.5.0
09-29 08:55:57.109  3429  3429 I Mono    : Assembly Ref addref System.IO.Compression.FileSystem[0x9729a160] -> mscorlib[0xae571d40]: 62
09-29 08:55:57.109  3429  3429 I Mono    : Requesting loading reference 1 (of 3) of System.IO.Compression.FileSystem.dll
09-29 08:55:57.109  3429  3429 I Mono    : Loading reference 1 of System.IO.Compression.FileSystem.dll asmctx DEFAULT, looking for System.IO.Compression, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
09-29 08:55:57.109  3429  3429 D Mono    : Request to load System.IO.Compression in (domain 0xae8a3a00, alc 0x0)
09-29 08:55:57.109  3429  3429 D Mono    : Found assembly remapping for System.IO.Compression and was for the same version 2.0.5.0
09-29 08:55:57.109  3429  3429 D Mono    : Found assembly remapping for System.IO.Compression and was for the same version 2.0.5.0
09-29 08:55:57.109  3429  3429 I Mono    : Assembly Ref addref System.IO.Compression.FileSystem[0x9729a160] -> System.IO.Compression[0x9729a1c0]: 3
09-29 08:55:57.124  3429  3429 I Mono    : Requesting loading reference 1 (of 2) of System.IO.Compression.dll
09-29 08:55:57.124  3429  3429 I Mono    : Loading reference 1 of System.IO.Compression.dll asmctx DEFAULT, looking for System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
09-29 08:55:57.124  3429  3429 D Mono    : Request to load System in (domain 0xae8a3a00, alc 0x0)
09-29 08:55:57.124  3429  3429 D Mono    : Found assembly remapping for System and was for the same version 2.0.5.0
09-29 08:55:57.124  3429  3429 D Mono    : Found assembly remapping for System and was for the same version 2.0.5.0
09-29 08:55:57.124  3429  3429 I Mono    : Assembly Ref addref System.IO.Compression[0x9729a1c0] -> System[0x9cc2c360]: 9
09-29 08:55:57.139  3429  3429 I Mono    : DllImport searching in: 'libmono-native.so' ('./libmono-native.so').
09-29 08:55:57.139  3429  3429 I Mono    : Searching for 'SystemNative_MkDir'.
09-29 08:55:57.139  3429  3429 I Mono    : Probing 'SystemNative_MkDir'.
09-29 08:55:57.139  3429  3429 I Mono    : Found as 'SystemNative_MkDir'.
09-29 08:55:57.174  3429  3429 D Mono    : mono_w32file_create: Opening /data/user/0/com.ibocon.unauthorizedaccessexception/cache/CASESENSITIVETESTf6dbcd7257b641158579833f6da380e6 with share 0x0 and access 0xc0000000
09-29 08:55:57.174  3429  3429 D Mono    : share_allows_open: New file!
09-29 08:55:57.174  3429  3429 D Mono    : mono_w32file_create: returning handle 0x25
09-29 08:55:57.174  3429  3429 D Mono    : file_data_close: closing fd 37
09-29 08:55:57.174  3429  3429 D Mono    : mono_w32file_create: Opening /storage/emulated/0/Android/data/com.ibocon.unauthorizedaccessexception/files/Test.txt with share 0x0 and access 0x40000000
09-29 08:55:57.179  3429  3429 D Mono    : share_allows_open: New file!
09-29 08:55:57.179  3429  3429 D Mono    : mono_w32file_create: returning handle 0x25
09-29 08:55:57.184  3429  3429 D Mono    : file_seek: setting offset to 0 0x0 (high 0 0x0, low 0 0x0)
09-29 08:55:57.184  3429  3429 D Mono    : file_seek: moving fd 37 by 0 bytes from 0
09-29 08:55:57.184  3429  3429 D Mono    : file_seek: lseek returns 0
09-29 08:55:57.184  3429  3429 D Mono    : file_seek: move of fd 37 returning 0/0
09-29 08:55:57.189  3429  3429 D Mono    : file_data_close: closing fd 37
09-29 08:55:57.194  3429  3429 I Mono    : DllImport searching in: 'libmono-native.so' ('./libmono-native.so').
09-29 08:55:57.194  3429  3429 I Mono    : Searching for 'SystemNative_UTimes'.
09-29 08:55:57.194  3429  3429 I Mono    : Probing 'SystemNative_UTimes'.
09-29 08:55:57.194  3429  3429 I Mono    : Found as 'SystemNative_UTimes'.
09-29 08:55:57.194  3429  3429 I Mono    : DllImport searching in: 'libmono-native.so' ('./libmono-native.so').
09-29 08:55:57.194  3429  3429 I Mono    : Searching for 'SystemNative_ConvertErrorPalToPlatform'.
09-29 08:55:57.194  3429  3429 I Mono    : Probing 'SystemNative_ConvertErrorPalToPlatform'.
09-29 08:55:57.194  3429  3429 I Mono    : Found as 'SystemNative_ConvertErrorPalToPlatform'.
09-29 08:55:57.199  3429  3429 I Mono    : DllImport searching in: 'libmono-native.so' ('./libmono-native.so').
09-29 08:55:57.199  3429  3429 I Mono    : Searching for 'SystemNative_StrErrorR'.
09-29 08:55:57.199  3429  3429 I Mono    : Probing 'SystemNative_StrErrorR'.
09-29 08:55:57.199  3429  3429 I Mono    : Found as 'SystemNative_StrErrorR'.
09-29 08:55:57.279  3429  3561 D Mono    : mono_w32handle_ref_core: ref Event handle 0xae291c58, ref: 3 -> 4
09-29 08:55:57.279  3429  3561 D Mono    : ves_icall_System_Threading_Events_SetEvent_internal: setting Event handle 0xae291c58
09-29 08:55:57.279  3429  3561 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c58, ref: 4 -> 3 destroy: false
09-29 08:55:57.279  3429  3487 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c58, ref: 3 -> 2 destroy: false
09-29 08:55:57.279  3429  3487 D Mono    : event_handle_own: owning Event handle 0xae291c58
09-29 08:55:57.279  3429  3487 D Mono    : mono_w32handle_wait_one: handle 0xae291c58 signalled
09-29 08:55:57.279  3429  3487 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c58, ref: 2 -> 1 destroy: false
09-29 08:55:57.279  3429  3487 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c58, ref: 1 -> 0 destroy: true
09-29 08:55:57.279  3429  3487 D Mono    : w32handle_destroy: destroy Event handle 0xae291c58
09-29 08:55:57.279  3429  3561 D Mono    : mono_w32handle_ref_core: ref Event handle 0xae291c3c, ref: 3 -> 4
09-29 08:55:57.279  3429  3561 D Mono    : ves_icall_System_Threading_Events_SetEvent_internal: setting Event handle 0xae291c3c
09-29 08:55:57.279  3429  3561 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c3c, ref: 4 -> 3 destroy: false
09-29 08:55:57.279  3429  3561 D Mono    : mono_w32handle_ref_core: ref Event handle 0xae291c3c, ref: 3 -> 4
09-29 08:55:57.279  3429  3561 D Mono    : ves_icall_System_Threading_Events_SetEvent_internal: setting Event handle 0xae291c3c
09-29 08:55:57.279  3429  3520 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c3c, ref: 4 -> 3 destroy: false
09-29 08:55:57.279  3429  3520 D Mono    : event_handle_own: owning Event handle 0xae291c3c
09-29 08:55:57.279  3429  3520 D Mono    : mono_w32handle_wait_one: handle 0xae291c3c signalled
09-29 08:55:57.279  3429  3520 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c3c, ref: 3 -> 2 destroy: false
09-29 08:55:57.279  3429  3561 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c3c, ref: 2 -> 1 destroy: false
09-29 08:55:57.279  3429  3520 D Mono    : mono_w32handle_ref_core: ref Event handle 0xae291c3c, ref: 1 -> 2
09-29 08:55:57.279  3429  3520 D Mono    : ves_icall_System_Threading_Events_ResetEvent_internal: resetting Event handle 0xae291c3c
09-29 08:55:57.279  3429  3520 D Mono    : ves_icall_System_Threading_Events_ResetEvent_internal: obtained write lock on Event handle 0xae291c3c
09-29 08:55:57.279  3429  3520 D Mono    : mono_w32handle_unref_core: unref Event handle 0xae291c3c, ref: 2 -> 1 destroy: false

On line 7512 - 7515, you can see exception.

09-29 08:56:01.634  3429  3429 F mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.UnauthorizedAccessException: Access to the path '/storage/emulated/0/Android/data/com.ibocon.unauthorizedaccessexception/files/Test.txt' is denied. ---> System.IO.IOException: Operation not permitted
09-29 08:56:01.634  3429  3429 F mono-rt :    --- End of inner exception stack trace ---
09-29 08:56:01.634  3429  3429 F mono-rt :   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.57(intptr,intptr,intptr)
09-29 08:56:01.634  3429  3429 F mono-rt :   at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.57(intptr,intptr,intptr)
ghost commented 2 years ago

Hi @ibocon. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.