diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d97620..9893ecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.1] + +### 2026-09-07 + +- Bug Fix: Contain Directory-scoped paths to their target directory ([#11](https://github.com/ionic-team/ion-android-filesystem/pull/11)) + ## [1.1.0] ### 2025-12-31 diff --git a/Gemfile.lock b/Gemfile.lock index e566184..f5d9a15 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,220 +1,363 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.7) - base64 - nkf - rexml - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + CFPropertyList (3.0.8) + abbrev (0.1.2) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) artifactory (3.0.17) atomos (0.1.3) - aws-eventstream (1.3.0) - aws-partitions (1.931.0) - aws-sdk-core (3.196.1) + aws-eventstream (1.4.0) + aws-partitions (1.1283.0) + aws-sdk-core (3.254.1) aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.8) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + base64 + bigdecimal jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.81.0) - aws-sdk-core (~> 3, >= 3.193.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.151.0) - aws-sdk-core (~> 3, >= 3.194.0) + logger + aws-sdk-kms (1.130.0) + aws-sdk-core (~> 3, >= 3.254.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.229.0) + aws-sdk-core (~> 3, >= 3.254.1) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.8) - aws-sigv4 (1.8.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.12.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) - base64 (0.2.0) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.1.2) claide (1.1.0) colored (1.2) colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) + csv (3.3.6) declarative (0.0.20) - digest-crc (0.6.5) + digest-crc (0.7.0) rake (>= 12.0.0, < 14.0.0) - domain_name (0.6.20240107) + domain_name (0.6.20260902) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.110.0) - faraday (1.10.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-cookie_jar (0.0.7) + erb (6.0.7) + excon (1.7.1) + logger + faraday (2.14.3) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-cookie_jar (0.0.8) faraday (>= 0.8.0) - http-cookie (~> 1.0.0) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - faraday_middleware (1.2.0) - faraday (~> 1.0) - fastimage (2.3.1) - fastlane (2.220.0) - CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.8, < 3.0.0) + http-cookie (>= 1.0.0) + faraday-follow_redirects (0.5.0) + faraday (>= 1, < 3) + faraday-multipart (1.2.0) + multipart-post (~> 2.0) + faraday-net_http (3.4.4) + net-http (~> 0.5) + faraday-retry (2.4.0) + faraday (~> 2.0) + fastimage (2.4.1) + fastlane (2.239.0) + CFPropertyList (>= 2.3, < 5.0.0) + abbrev (~> 0.1) + addressable (>= 2.9.0, < 3.0.0) artifactory (~> 3.0) - aws-sdk-s3 (~> 1.0) + aws-sdk-s3 (~> 1.197) babosa (>= 1.0.3, < 2.0.0) - bundler (>= 1.12.0, < 3.0.0) + base64 (~> 0.2) + benchmark (>= 0.1.0) + bundler (>= 2.4.0, < 5.0.0) colored (~> 1.2) commander (~> 4.6) + csv (~> 3.3) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) - excon (>= 0.71.0, < 1.0.0) - faraday (~> 1.0) - faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 1.0) + excon (>= 0.71.0, < 2.0.0) + faraday (~> 2.7) + faraday-cookie_jar (~> 0.0.8) + faraday-follow_redirects (~> 0.3) + faraday-multipart (~> 1.0) + faraday-retry (~> 2.0) fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.1.0) gh_inspector (>= 1.1.2, < 2.0.0) - google-apis-androidpublisher_v3 (~> 0.3) + google-apis-androidpublisher_v3 (~> 0.99.0) google-apis-playcustomapp_v1 (~> 0.1) - google-cloud-env (>= 1.6.0, < 2.0.0) + google-cloud-env (>= 1.6.0, < 2.4.0) google-cloud-storage (~> 1.31) highline (~> 2.0) - http-cookie (~> 1.0.5) + irb (>= 1.8) json (< 3.0.0) - jwt (>= 2.1.0, < 3) + jwt (>= 2.10.3, < 4) + logger (>= 1.6, < 2.0) mini_magick (>= 4.9.4, < 5.0.0) + multi_json (~> 1.12) multipart-post (>= 2.0.0, < 3.0.0) + mutex_m (~> 0.3) naturally (~> 2.2) + nkf (~> 0.2) optparse (>= 0.1.1, < 1.0.0) + ostruct (>= 0.1.0) plist (>= 3.1.0, < 4.0.0) rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.5) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (~> 3) + terminal-table (~> 4) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) + xcpretty (~> 0.4.1) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-sirp (1.1.0) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.54.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.3) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) + google-apis-androidpublisher_v3 (0.99.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-core (1.2.5) + addressable (~> 2.9) + faraday (~> 2.13) + faraday-follow_redirects (~> 0.3) + googleauth (~> 1.14) + mini_mime (~> 1.1) + multi_json (~> 1.11) representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - google-apis-iamcredentials_v1 (0.17.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-playcustomapp_v1 (0.13.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.31.0) - google-apis-core (>= 0.11.0, < 2.a) - google-cloud-core (1.7.0) + retriable (>= 3.1, < 5.0) + google-apis-iamcredentials_v1 (0.28.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-playcustomapp_v1 (0.18.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-storage_v1 (0.67.0) + google-apis-core (>= 0.15.0, < 2.a) + google-cloud-core (1.9.0) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.4.0) - google-cloud-storage (1.47.0) + google-cloud-env (2.3.1) + base64 (~> 0.2) + faraday (>= 1.0, < 3.a) + google-cloud-errors (1.7.0) + google-cloud-storage (1.62.0) addressable (~> 2.8) digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.31.0) + google-apis-core (>= 0.18, < 2) + google-apis-iamcredentials_v1 (~> 0.18) + google-apis-storage_v1 (>= 0.42) google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) + googleauth (~> 1.9) mini_mime (~> 1.0) - googleauth (1.8.1) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - multi_json (~> 1.11) + google-logging-utils (0.2.0) + googleauth (1.17.4) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.2) + google-logging-utils (~> 0.1) + jwt (>= 1.4, < 4.0) os (>= 0.9, < 2.0) + pstore (~> 0.1) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.5) + http-cookie (1.1.6) domain_name (~> 0.5) - httpclient (2.8.3) + io-console (0.9.2) + irb (1.18.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jmespath (1.6.2) - json (2.7.2) - jwt (2.8.1) + json (2.21.2) + jwt (3.2.0) base64 - mini_magick (4.12.0) + logger (1.7.0) + mini_magick (4.13.2) mini_mime (1.1.5) - multi_json (1.15.0) + multi_json (1.21.1) multipart-post (2.4.1) - nanaimo (0.3.0) - naturally (2.2.1) - nkf (0.2.0) - optparse (0.5.0) + mutex_m (0.3.0) + nanaimo (0.4.0) + naturally (2.3.0) + net-http (0.9.1) + uri (>= 0.11.1) + nkf (0.3.0) + optparse (0.8.1) os (1.1.4) - plist (3.7.1) - public_suffix (5.0.5) - rake (13.2.1) + ostruct (0.6.3) + plist (3.7.2) + pp (0.6.4) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + pstore (0.2.1) + public_suffix (7.0.5) + rake (13.4.2) + rbs (4.2.0) + logger + prism (>= 1.6.0) + tsort + rdoc (8.0.0) + erb + prism (>= 1.6.0) + rbs (>= 4.0.0) + tsort + reline (0.7.0) + io-console (~> 0.5) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) - retriable (3.1.2) - rexml (3.2.8) - strscan (>= 3.0.9) - rouge (2.0.7) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) + retriable (4.2.0) + rexml (3.4.4) + rouge (3.28.0) + rubyzip (2.4.1) security (0.1.5) - signet (0.19.0) + signet (0.22.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) + jwt (>= 1.5, < 4.0) simctl (1.6.10) CFPropertyList naturally - strscan (3.1.0) terminal-notifier (2.0.0) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) trailblazer-option (0.1.2) + tsort (0.2.0) tty-cursor (0.7.1) tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) - unicode-display_width (2.5.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uri (1.1.1) word_wrap (1.0.0) - xcodeproj (1.24.0) + xcodeproj (1.28.1) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) + base64 claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - xcpretty (0.3.0) - rouge (~> 2.0.7) + nanaimo (~> 0.4.0) + nkf + rexml (>= 3.3.6, < 4.0) + xcpretty (0.4.1) + rouge (~> 3.28.0) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) PLATFORMS - arm64-darwin-21 + arm64-darwin-24 ruby DEPENDENCIES fastlane (>= 2.207.0) +CHECKSUMS + CFPropertyList (3.0.8) sha256=2c99d0d980536d3d7ab252f7bd59ac8be50fbdd1ff487c98c949bb66bb114261 + abbrev (0.1.2) sha256=ad1b4eaaaed4cb722d5684d63949e4bde1d34f2a95e20db93aecfe7cbac74242 + addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af + artifactory (3.0.17) sha256=3023d5c964c31674090d655a516f38ca75665c15084140c08b7f2841131af263 + atomos (0.1.3) sha256=7d43b22f2454a36bace5532d30785b06de3711399cb1c6bf932573eda536789f + aws-eventstream (1.4.0) sha256=116bf85c436200d1060811e6f5d2d40c88f65448f2125bc77ffce5121e6e183b + aws-partitions (1.1283.0) sha256=125ba9cb65eb7ec2b0a2041a47d204d403b3f6d9aa62bffa53a6b95b04b1f1de + aws-sdk-core (3.254.1) sha256=518089e32134c3478cd4ec63d07fb966546a45e9e4cbf5f80d2cf16d5699d29b + aws-sdk-kms (1.130.0) sha256=a2e83662ca31b77a2a19c9aa2f40a98165a67270c18c718fe1c70d0cbd7cd749 + aws-sdk-s3 (1.229.0) sha256=7dd11a111875b3505d2ec0a0a383a6aab6c1badb3d4e94e7fbb958a24451f596 + aws-sigv4 (1.12.1) sha256=6973ff95cb0fd0dc58ba26e90e9510a2219525d07620c8babeb70ef831826c00 + babosa (1.0.4) sha256=18dea450f595462ed7cb80595abd76b2e535db8c91b350f6c4b3d73986c5bc99 + base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b + benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + claide (1.1.0) sha256=6d3c5c089dde904d96aa30e73306d0d4bd444b1accb9b3125ce14a3c0183f82e + colored (1.2) sha256=9d82b47ac589ce7f6cab64b1f194a2009e9fd00c326a5357321f44afab2c1d2c + colored2 (3.1.2) sha256=b13c2bd7eeae2cf7356a62501d398e72fde78780bd26aec6a979578293c28b4a + commander (4.6.0) sha256=7d1ddc3fccae60cc906b4131b916107e2ef0108858f485fdda30610c0f2913d9 + csv (3.3.6) sha256=aba61e7e507a66f03d45cb1f3c4b6359861c3504038b422962875dce099e4456 + declarative (0.0.20) sha256=8021dd6cb17ab2b61233c56903d3f5a259c5cf43c80ff332d447d395b17d9ff9 + digest-crc (0.7.0) sha256=64adc23a26a241044cbe6732477ca1b3c281d79e2240bcff275a37a5a0d78c07 + domain_name (0.6.20260902) sha256=4fac7f8e0a77dc85ec02f6534fdeff38e143d434ab8a86528fe68ca5bc45a042 + dotenv (2.8.1) sha256=c5944793349ae03c432e1780a2ca929d60b88c7d14d52d630db0508c3a8a17d8 + emoji_regex (3.2.3) sha256=ecd8be856b7691406c6bf3bb3a5e55d6ed683ffab98b4aa531bb90e1ddcc564b + erb (6.0.7) sha256=c5ca6dc25b0ef974a44dc8f59fe847577122483b1968a38dec305c60bf91ee92 + excon (1.7.1) sha256=dd2d870eece1b5ce4e4f9efd938e67a69ccd8c003c3825b638b937e1082eaac2 + faraday (2.14.3) sha256=1882247e6766615c8220b4392bf1d27f6ebb63d8e28267587cef1fb0bf37f278 + faraday-cookie_jar (0.0.8) sha256=0140605823f8cc63c7028fccee486aaed8e54835c360cffc1f7c8c07c4299dbb + faraday-follow_redirects (0.5.0) sha256=5cde93c894b30943a5d2b93c2fe9284216a6b756f7af406a1e55f211d97d10ad + faraday-multipart (1.2.0) sha256=7d89a949693714176f612323ca13746a2ded204031a6ba528adee788694ef757 + faraday-net_http (3.4.4) sha256=0e78af151747ed1b00f33e25973b4bc220d7f16c00c39676817c8b12331eb588 + faraday-retry (2.4.0) sha256=7b79c48fb7e56526faf247b12d94a680071ff40c9fda7cf1ec1549439ad11ebe + fastimage (2.4.1) sha256=c64bebd46b6fd8943ab70c1e6e85ff728f970f2e48f92ecd249b6bc3a540ad20 + fastlane (2.239.0) sha256=6d99c0ea639f44fd4ebb53d442e5557e9a64159e6ca60ba1f38517cfe02c5689 + fastlane-sirp (1.1.0) sha256=10bc94f9682efd8e1badfb31452a76dd8981f1f3a33717c765fde6d75b54d847 + gh_inspector (1.1.3) sha256=04cca7171b87164e053aa43147971d3b7f500fcb58177698886b48a9fc4a1939 + google-apis-androidpublisher_v3 (0.99.0) sha256=a0452fdd99cb7672cc95cac07429305f8aaee54c22e4875224cf675b1ab59729 + google-apis-core (1.2.5) sha256=e21562b5627a0fc6a0c3165e429c3afed0f6a628eaa514e83f7204dda1adff69 + google-apis-iamcredentials_v1 (0.28.0) sha256=0a92ffe6cc39c569554af2a77a25dfc61519ed8bbb64ab04cffdd352dc5ef106 + google-apis-playcustomapp_v1 (0.18.0) sha256=44b277b9dee4a59ac5e9d98be1485edc5e382d2f9d73c79ae8908a455786a254 + google-apis-storage_v1 (0.67.0) sha256=13befc89bf03512783f535d214590f15993b0c56411155fd8090ca607e1b8d20 + google-cloud-core (1.9.0) sha256=ab55409f51488e8deefb6edcc1ce4771dfb5da2fe7b3bc075709a030c2b682a4 + google-cloud-env (2.3.1) sha256=0faac01eb27be78c2591d64433663b1a114f8f7af55a4f819755426cac9178e7 + google-cloud-errors (1.7.0) sha256=6e682f42d89aae08689f36f28495de629d756da076bafff0003bac7f8042ebb3 + google-cloud-storage (1.62.0) sha256=e2c3c08bf8fd40d50be92304084942203314d4fc0ee52028e99f9359c3ad1330 + google-logging-utils (0.2.0) sha256=675462b4ea5affa825a3442694ca2d75d0069455a1d0956127207498fca3df7b + googleauth (1.17.4) sha256=acc2cac2a6011048f149c922cbc6c9675719e165aa5000c7fa3876c480fe9ae3 + highline (2.0.3) sha256=2ddd5c127d4692721486f91737307236fe005352d12a4202e26c48614f719479 + http-cookie (1.1.6) sha256=ba4b82be64de61dc281243dac70e3c382c45142f20268ed9276a3670c93feaa9 + io-console (0.9.2) sha256=efa74f891dd03c0939a931dfc6e74c2813d904763d456ea9762b0525e748db08 + irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3 + jmespath (1.6.2) sha256=238d774a58723d6c090494c8879b5e9918c19485f7e840f2c1c7532cf84ebcb1 + json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a + jwt (3.2.0) sha256=5419b1fe37b1da0982bd07051f573a8b8789ab724c2aa7e785e4784a3ed217d7 + logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 + mini_magick (4.13.2) sha256=71d6258e0e8a3d04a9a0a09784d5d857b403a198a51dd4f882510435eb95ddd9 + mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef + multi_json (1.21.1) sha256=e6126a31808e3b4d19f483c775ceac34df190dffa62adfb63a165ee14ba68080 + multipart-post (2.4.1) sha256=9872d03a8e552020ca096adadbf5e3cb1cd1cdd6acd3c161136b8a5737cdb4a8 + mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751 + nanaimo (0.4.0) sha256=faf069551bab17f15169c1f74a1c73c220657e71b6e900919897a10d991d0723 + naturally (2.3.0) sha256=459923cf76c2e6613048301742363200c3c7e4904c324097d54a67401e179e01 + net-http (0.9.1) sha256=25ba0b67c63e89df626ed8fac771d0ad24ad151a858af2cc8e6a716ca4336996 + nkf (0.3.0) sha256=357a8dbeba38b727b75930f665146546076a394a1c243faf634ff176e3588895 + optparse (0.8.1) sha256=42bea10d53907ccff4f080a69991441d611fbf8733b60ed1ce9ee365ce03bd1a + os (1.1.4) sha256=57816d6a334e7bd6aed048f4b0308226c5fb027433b67d90a9ab435f35108d3f + ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912 + plist (3.7.2) sha256=d37a4527cc1116064393df4b40e1dbbc94c65fa9ca2eec52edf9a13616718a42 + pp (0.6.4) sha256=dfcb0fce700c41456265922884f9fe195d7fbb0674a3578e6c0f69588e82b570 + prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193 + prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 + pstore (0.2.1) sha256=03904d0f2c66579e96d1e6704cdabc0c88df7ea8ed8782d9f3569f6f6c702c1a + public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 + rbs (4.2.0) sha256=51f7b886dcc05bc09e10b901daa6a81829f6adc03101d6ca9ea4aac6103e0674 + rdoc (8.0.0) sha256=03bf8c08a9639658855a0cfd77c0abca8325c227693f7f33f82957811348c469 + reline (0.7.0) sha256=5b012d8e55dbf9d450f12bde2cf7d15ff546ae80b3f8f3b30e570d431815583d + representable (3.2.0) sha256=cc29bf7eebc31653586849371a43ffe36c60b54b0a6365b5f7d95ec34d1ebace + retriable (4.2.0) sha256=90c3b257472a1c02f2a3dfa64dd35a420f7a624cef1a5981e20fdac5730f8cdc + rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 + rouge (3.28.0) sha256=0d6de482c7624000d92697772ab14e48dca35629f8ddf3f4b21c99183fd70e20 + rubyzip (2.4.1) sha256=8577c88edc1fde8935eb91064c5cb1aef9ad5494b940cf19c775ee833e075615 + security (0.1.5) sha256=3a977a0eca7706e804c96db0dd9619e0a94969fe3aac9680fcfc2bf9b8a833b7 + signet (0.22.0) sha256=b76d495ccb07ad35dbc89f3e920665a9d8ed717141955034005d7843dcfe4780 + simctl (1.6.10) sha256=b99077f4d13ad81eace9f86bf5ba4df1b0b893a4d1b368bd3ed59b5b27f9236b + terminal-notifier (2.0.0) sha256=7a0d2b2212ab9835c07f4b2e22a94cff64149dba1eed203c04835f7991078cea + terminal-table (4.0.0) sha256=f504793203f8251b2ea7c7068333053f0beeea26093ec9962e62ea79f94301d2 + trailblazer-option (0.1.2) sha256=20e4f12ea4e1f718c8007e7944ca21a329eee4eed9e0fa5dde6e8ad8ac4344a3 + tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f + tty-cursor (0.7.1) sha256=79534185e6a777888d88628b14b6a1fdf5154a603f285f80b1753e1908e0bf48 + tty-screen (0.8.2) sha256=c090652115beae764336c28802d633f204fb84da93c6a968aa5d8e319e819b50 + tty-spinner (0.9.3) sha256=0e036f047b4ffb61f2aa45f5a770ec00b4d04130531558a94bfc5b192b570542 + uber (0.1.0) sha256=5beeb407ff807b5db994f82fa9ee07cfceaa561dad8af20be880bc67eba935dc + unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 + unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f + uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6 + word_wrap (1.0.0) sha256=f556d4224c812e371000f12a6ee8102e0daa724a314c3f246afaad76d82accc7 + xcodeproj (1.28.1) sha256=6f12670f00739d9817ca27ac89d6ef01cc86050e22a0bc08a3131487e5b5cddc + xcpretty (0.4.1) sha256=b14c50e721f6589ee3d6f5353e2c2cfcd8541fa1ea16d6c602807dd7327f3892 + xcpretty-travis-formatter (1.0.1) sha256=aacc332f17cb7b2cba222994e2adc74223db88724fe76341483ad3098e232f93 + BUNDLED WITH - 2.3.7 + 4.0.4 diff --git a/pom.xml b/pom.xml index a3d1f7e..222af43 100644 --- a/pom.xml +++ b/pom.xml @@ -6,5 +6,5 @@ 4.0.0 io.ionic.libs ionfilesystem-android - 1.1.0 + 1.1.1 \ No newline at end of file diff --git a/src/main/kotlin/io/ionic/libs/ionfilesystemlib/helper/IONFILEUriHelper.kt b/src/main/kotlin/io/ionic/libs/ionfilesystemlib/helper/IONFILEUriHelper.kt index 56f8389..30d7e61 100644 --- a/src/main/kotlin/io/ionic/libs/ionfilesystemlib/helper/IONFILEUriHelper.kt +++ b/src/main/kotlin/io/ionic/libs/ionfilesystemlib/helper/IONFILEUriHelper.kt @@ -137,8 +137,34 @@ internal class IONFILEUriHelper(context: Context) { * @param localPath the local path to the file (minus the parent folder path) * @return a [File] object pointing to the local file */ - private fun getLocalFileObject(parentFolderFileObject: File?, localPath: String): File = - parentFolderFileObject?.let { File(it, localPath) } ?: File(localPath) + private fun getLocalFileObject(parentFolderFileObject: File?, localPath: String): File { + val joined = parentFolderFileObject?.let { File(it, localPath) } ?: File(localPath) + if (parentFolderFileObject != null) { + assertContainedWithin(joined, parentFolderFileObject) + } + return joined + } + + /** + * Verifies that [file]'s canonical (symlink-resolved, "."/".."-resolved) path is the + * same as, or a descendant of, [directory]'s canonical path. + * + * Compares with a trailing separator so a sibling directory sharing a name prefix + * (e.g. "/data/data" vs "/data/dataOther") is never mistaken for being contained. + */ + private fun assertContainedWithin(file: File, directory: File) { + val canonicalFile = file.canonicalFile + val canonicalDirectory = directory.canonicalFile + val directoryPathWithSeparator = canonicalDirectory.path + File.separator + val isContained = canonicalFile == canonicalDirectory || + canonicalFile.path.startsWith(directoryPathWithSeparator) + if (!isContained) { + throw IONFILEExceptions.PathEscapesDirectory( + path = canonicalFile.path, + directory = canonicalDirectory.path, + ) + } + } /** * Gets the type of local file uri diff --git a/src/main/kotlin/io/ionic/libs/ionfilesystemlib/model/IONFILEExceptions.kt b/src/main/kotlin/io/ionic/libs/ionfilesystemlib/model/IONFILEExceptions.kt index 11071b4..749c241 100644 --- a/src/main/kotlin/io/ionic/libs/ionfilesystemlib/model/IONFILEExceptions.kt +++ b/src/main/kotlin/io/ionic/libs/ionfilesystemlib/model/IONFILEExceptions.kt @@ -12,6 +12,9 @@ sealed class IONFILEExceptions(message: String, cause: Throwable? = null) : class UnknownError(override val cause: Throwable? = null) : IONFILEExceptions("An unknown error occurred.") + class PathEscapesDirectory(val path: String, val directory: String) : + IONFILEExceptions("The resolved path '$path' is outside of the requested directory '$directory'") + class NotSupportedForContentScheme : IONFILEExceptions("The requested operation is not supported on a content:// uri") diff --git a/src/test/java/io/ionic/libs/ionfilesystemlib/helper/IONFILEControllerTests.kt b/src/test/java/io/ionic/libs/ionfilesystemlib/helper/IONFILEControllerTests.kt index 4f17ca8..18c296e 100644 --- a/src/test/java/io/ionic/libs/ionfilesystemlib/helper/IONFILEControllerTests.kt +++ b/src/test/java/io/ionic/libs/ionfilesystemlib/helper/IONFILEControllerTests.kt @@ -552,6 +552,78 @@ class IONFILEControllerTests { } // endregion uri resolve errors + // region directory containment (IONIC-102) + @Test + fun `given valid source and traversing destination, when copying, PathEscapesDirectory error is returned`() = + runTest { + val sourceUri = IONFILEUri.Unresolved(IONFILEFolderType.EXTERNAL_FILES, "oldFile.txt") + val destinationUri = + IONFILEUri.Unresolved(IONFILEFolderType.EXTERNAL_CACHE, "../escaped.txt") + sut.saveFile( + sourceUri, + options = IONFILESaveOptions( + "lorem ipsum", + IONFILEEncoding.DefaultCharset, + IONFILESaveMode.WRITE, + true + ) + ).let { assertTrue(it.isSuccess) } + + val result = sut.copy(sourceUri, destinationUri) + + assertTrue(result.isFailure) + assertTrue(result.exceptionOrNull() is IONFILEExceptions.PathEscapesDirectory) + } + + @Test + fun `given traversing source and valid destination, when copying, PathEscapesDirectory error is returned`() = + runTest { + val sourceUri = + IONFILEUri.Unresolved(IONFILEFolderType.EXTERNAL_FILES, "../escaped.txt") + val destinationUri = IONFILEUri.Unresolved(IONFILEFolderType.EXTERNAL_CACHE, "newFile.txt") + + val result = sut.copy(sourceUri, destinationUri) + + assertTrue(result.isFailure) + assertTrue(result.exceptionOrNull() is IONFILEExceptions.PathEscapesDirectory) + } + + @Test + fun `given valid source and traversing destination, when moving, PathEscapesDirectory error is returned`() = + runTest { + val sourceUri = IONFILEUri.Unresolved(IONFILEFolderType.EXTERNAL_FILES, "oldFile.txt") + val destinationUri = + IONFILEUri.Unresolved(IONFILEFolderType.DOCUMENTS, "../escaped.txt") + sut.saveFile( + sourceUri, + options = IONFILESaveOptions( + "lorem ipsum", + IONFILEEncoding.DefaultCharset, + IONFILESaveMode.WRITE, + true + ) + ).let { assertTrue(it.isSuccess) } + + val result = sut.move(sourceUri, destinationUri) + + assertTrue(result.isFailure) + assertTrue(result.exceptionOrNull() is IONFILEExceptions.PathEscapesDirectory) + } + + @Test + fun `given traversing source and valid destination, when moving, PathEscapesDirectory error is returned`() = + runTest { + val sourceUri = + IONFILEUri.Unresolved(IONFILEFolderType.EXTERNAL_FILES, "../escaped.txt") + val destinationUri = IONFILEUri.Unresolved(IONFILEFolderType.DOCUMENTS, "newFile.txt") + + val result = sut.move(sourceUri, destinationUri) + + assertTrue(result.isFailure) + assertTrue(result.exceptionOrNull() is IONFILEExceptions.PathEscapesDirectory) + } + // endregion directory containment (IONIC-102) + // region read file input errors @Test fun `given negative offset, when calling readFile, IllegalArgumentException is returned`() = runTest { diff --git a/src/test/java/io/ionic/libs/ionfilesystemlib/helper/IONFILEUriHelperTest.kt b/src/test/java/io/ionic/libs/ionfilesystemlib/helper/IONFILEUriHelperTest.kt index b77eee2..e5d7e10 100644 --- a/src/test/java/io/ionic/libs/ionfilesystemlib/helper/IONFILEUriHelperTest.kt +++ b/src/test/java/io/ionic/libs/ionfilesystemlib/helper/IONFILEUriHelperTest.kt @@ -18,6 +18,7 @@ import org.robolectric.RobolectricTestRunner import org.robolectric.RuntimeEnvironment import org.robolectric.shadows.ShadowEnvironment import java.io.File +import java.nio.file.Files @RunWith(RobolectricTestRunner::class) class IONFILEUriHelperTest { @@ -250,4 +251,92 @@ class IONFILEUriHelperTest { assertTrue(result.isFailure) assertTrue(result.exceptionOrNull() is IONFILEExceptions.UnresolvableUri) } + + // region directory containment (IONIC-102) + + @Test + fun `given a path with a single level traversal escaping the directory, when resolving the uri, a PathEscapesDirectory exception is returned`() = + runTest { + val unresolvedUri = IONFILEUri.Unresolved( + parentFolder = IONFILEFolderType.INTERNAL_FILES, + uriPath = "../escaped.txt" + ) + + val result = sut.resolveUri(unresolvedUri) + + assertTrue(result.isFailure) + assertTrue(result.exceptionOrNull() is IONFILEExceptions.PathEscapesDirectory) + } + + @Test + fun `given a path with nested traversal escaping the directory, when resolving the uri, a PathEscapesDirectory exception is returned`() = + runTest { + val unresolvedUri = IONFILEUri.Unresolved( + parentFolder = IONFILEFolderType.INTERNAL_FILES, + uriPath = "subdir/../../../escaped.txt" + ) + + val result = sut.resolveUri(unresolvedUri) + + assertTrue(result.isFailure) + assertTrue(result.exceptionOrNull() is IONFILEExceptions.PathEscapesDirectory) + } + + @Test + fun `given a path with mixed dot-dot segments escaping the directory, when resolving the uri, a PathEscapesDirectory exception is returned`() = + runTest { + val unresolvedUri = IONFILEUri.Unresolved( + parentFolder = IONFILEFolderType.INTERNAL_FILES, + uriPath = "./../../escaped.txt" + ) + + val result = sut.resolveUri(unresolvedUri) + + assertTrue(result.isFailure) + assertTrue(result.exceptionOrNull() is IONFILEExceptions.PathEscapesDirectory) + } + + @Test + fun `given a path with traversal that stays within the directory, when resolving the uri, a Resolved#Local is returned`() = + runTest { + File(context.filesDir, "a").mkdirs() + val unresolvedUri = IONFILEUri.Unresolved( + parentFolder = IONFILEFolderType.INTERNAL_FILES, + uriPath = "a/../b.txt" + ) + + val result = sut.resolveUri(unresolvedUri) + + assertTrue(result.isSuccess) + assertEquals( + IONFILEUri.Resolved.Local( + "${context.filesDir}/a/../b.txt", + Uri.parse("file://${context.filesDir}/a/../b.txt"), + LocalUriType.UNKNOWN, + inExternalStorage = false + ), + result.getOrNull() + ) + } + + @Test + fun `given a symlink inside the directory pointing outside it, when resolving a path through the symlink, a PathEscapesDirectory exception is returned`() = + runTest { + val outsideDir = Files.createTempDirectory("outside").toFile() + val secretFile = File(outsideDir, "secret.txt").apply { writeText("secret") } + val symlink = File(context.filesDir, "escape-link") + Files.createSymbolicLink(symlink.toPath(), outsideDir.toPath()) + // no ".." anywhere in this path - the escape happens purely via the symlink + val unresolvedUri = IONFILEUri.Unresolved( + parentFolder = IONFILEFolderType.INTERNAL_FILES, + uriPath = "escape-link/${secretFile.name}" + ) + + val result = sut.resolveUri(unresolvedUri) + + assertTrue(result.isFailure) + assertTrue(result.exceptionOrNull() is IONFILEExceptions.PathEscapesDirectory) + } + + // endregion directory containment (IONIC-102) } \ No newline at end of file