Skip to content

Commit

Permalink
Merge pull request #43 from Sav22999/beta
Browse files Browse the repository at this point in the history
1.13.2
  • Loading branch information
Sav22999 authored Oct 12, 2023
2 parents fe409ab + f99ba0b commit f9bf444
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId 'com.saverio.pdfviewer'
minSdk 21
targetSdk 33
versionCode 51
versionName '1.13.1'
versionCode 53
versionName '1.13.2'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
26 changes: 25 additions & 1 deletion app/src/main/java/com/saverio/pdfviewer/PDFViewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import com.saverio.pdfviewer.db.BookmarksModel
import com.saverio.pdfviewer.db.DatabaseHandler
import com.saverio.pdfviewer.db.FilesModel
import com.saverio.pdfviewer.ui.BookmarksItemAdapter
import java.net.URLDecoder
import java.security.MessageDigest
import java.text.SimpleDateFormat
import java.util.*
Expand Down Expand Up @@ -99,9 +100,32 @@ class PDFViewer : AppCompatActivity() {
uriOpened = intent.data
}

fileOpened = RealPathUtil.getRealPath(this, intent.data!!)
println(intent.data)

try {
fileOpened = RealPathUtil.getRealPath(this, intent.data!!)
//println("File opened\t" + fileOpened)
} catch (e: Exception) {
println("Exception Z2\n" + e.message)
try {
val tempUrl = URLDecoder.decode(intent.data.toString(), "UTF-8").split("/")
fileOpened = ""
var storageFound = false
tempUrl.forEach {
if (storageFound || it == "storage") {
storageFound = true
fileOpened += "/" + it
}
}

} catch (e: Exception) {
fileOpened = intent.data.toString()
println("Exception Z3\n" + e.message)
}
}
isSupportedShareFeature = true
} catch (e: Exception) {
println("Exception Z1\n" + e.message)
uriToUse = ""
}
if (uriToUse == null || uriToUse == "") {
Expand Down

0 comments on commit f9bf444

Please sign in to comment.