Skip to content

Commit

Permalink
Merge pull request #34 from MateusRodCosta/dev
Browse files Browse the repository at this point in the history
Version 1.3.1
  • Loading branch information
MateusRodCosta authored Aug 25, 2024
2 parents 5685418 + 72ffe86 commit 2a8ca14
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 44 deletions.
50 changes: 25 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ GEM
base64
nkf
rexml
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.939.0)
aws-sdk-core (3.196.1)
aws-partitions (1.968.0)
aws-sdk-core (3.201.5)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.82.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)
aws-sdk-kms (1.88.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.159.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.9.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
Expand All @@ -38,7 +38,7 @@ GEM
domain_name (0.6.20240107)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.110.0)
excon (0.111.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand All @@ -60,15 +60,15 @@ GEM
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http (1.0.2)
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)
fastlane (2.222.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -126,7 +126,7 @@ GEM
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)
google-cloud-core (1.7.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
Expand All @@ -147,14 +147,14 @@ GEM
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.6)
http-cookie (1.0.7)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.7.2)
jwt (2.8.1)
jwt (2.8.2)
base64
mini_magick (4.12.0)
mini_magick (4.13.2)
mini_mime (1.1.5)
multi_json (1.15.0)
multipart-post (2.4.1)
Expand All @@ -164,15 +164,15 @@ GEM
optparse (0.5.0)
os (1.1.4)
plist (3.7.1)
public_suffix (5.0.5)
public_suffix (6.0.1)
rake (13.2.1)
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)
rexml (3.3.6)
strscan
rouge (2.0.7)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand All @@ -197,13 +197,13 @@ GEM
uber (0.1.0)
unicode-display_width (2.5.0)
word_wrap (1.0.0)
xcodeproj (1.24.0)
xcodeproj (1.25.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
rexml (>= 3.3.2, < 4.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
Expand All @@ -217,4 +217,4 @@ DEPENDENCIES
fastlane

BUNDLED WITH
2.5.9
2.5.11
9 changes: 5 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import java.io.FileInputStream
import java.util.Properties

plugins {
Expand All @@ -8,7 +7,9 @@ plugins {

val keystorePropertiesFile = rootProject.file("key.properties")
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(keystorePropertiesFile.inputStream())
}

kotlin {
jvmToolchain(17)
Expand All @@ -22,8 +23,8 @@ android {
applicationId = "com.mateusrodcosta.apps.share2storage"
minSdk = 26
targetSdk = 34
versionCode = 21
versionName = "1.3.0"
versionCode = 22
versionName = "1.3.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import android.util.Log
import com.mateusrodcosta.apps.share2storage.model.UriData
import java.io.*

object Utils {
const val BUFFER_SIZE: Int = 1024
}

fun getUriData(contentResolver: ContentResolver, uri: Uri?, getPreview: Boolean): UriData? {
if (uri == null) return null
val type = contentResolver.getType(uri)
Expand Down Expand Up @@ -116,15 +120,15 @@ fun saveFile(
}
val output = context.contentResolver.openOutputStream(targeturi)

val bufferSize = 1024
bis = BufferedInputStream(input)
bos = BufferedOutputStream(output)
val buf = ByteArray(bufferSize)
bis.read(buf)
do {
bos.write(buf)
} while (bis.read(buf) != -1)

val buf = ByteArray(Utils.BUFFER_SIZE)
var numBytes = bis.read(buf)
while (numBytes != -1) {
bos.write(buf, 0, numBytes)
numBytes = bis.read(buf)
}
} catch (e: Exception) {
e.printStackTrace()
hasError = true
Expand Down
5 changes: 5 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/22.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<strong>IMPORTANT</strong>:
Version 1.2.3 changed the way the file copy works to use a 1 kb buffer and accidentally introduced a bug in doing so: the app would save files adding zeroes at the end to make the file size be a multiple of 1kb.
If the files you are saving don't absolutely need to match 1-to-1 the original, you should be fine, otherwise the added zeroes mean the new file isn't a exact copy and could cause issues (for example, diverging checksums).

Version 1.3.1 focus on fixing that bug. Sorry for any inconveniences!
5 changes: 5 additions & 0 deletions fastlane/metadata/android/pt-BR/changelogs/22.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<strong>IMPORTANTE</strong>:
A version 1.2.3 mudou a forma como a cópia de arquivo fucniona para usar um buffer de 1 kb e acidentalmente introduziu um bug no processo: o app salvaria arquivos adicionando zeros no final de forma a fazer o tamanho do arquivo ser um múltiplo de 1kb.
Se os arquivos que você salvou não precisam ser uma cópia idêntica ao original, não há com o que se preocupar, do contrário os zeros adicionados significam que o arquivo não é uma cópia exata e pode causar problemas (por exemplo, as hashes divergirem).

A versão 1.3.1 foca em resolver esse bug. Sinto muito por qualquer inconveniência!
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[versions]
agp = "8.5.0"
agp = "8.5.2"
kotlin = "1.9.24"
androidxComposeCompiler = "1.5.14"
ktx = "1.13.1"
preference-ktx = "1.2.1"
lifecycle-runtime-ktx = "2.8.2"
lifecycle-runtime-ktx = "2.8.4"
splashscreen = "1.0.1"
composeBom = "2024.06.00"
activityCompose = "1.9.0"
composeBom = "2024.08.00"
activityCompose = "1.9.1"
navigationCompose = "2.7.7"
junit = "4.13.2"
androidxTestRunner = "1.5.2"
androidxTestRules = "1.5.0"
androidxTestRunner = "1.6.2"
androidxTestRules = "1.6.1"
coroutines = "1.7.3"

[libraries]
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionSha256Sum=5b9c5eb3f9fc2c94abaea57d90bd78747ca117ddbbf96c859d3741181a12bf2a
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down

0 comments on commit 2a8ca14

Please sign in to comment.