|
@@ -174,19 +174,19 @@ class ReaderViewModel(private val readerModelManager: ReaderModelManager, val ur
|
|
|
}
|
|
|
|
|
|
@JvmOverloads
|
|
|
- fun openPdfFile(context: Context, uri: Uri, password: String, onRequestPassword: Runnable, type: String? = null): OpenFileResult {
|
|
|
+ fun openPdfFile(context: Context, password: String, onRequestPassword: Runnable, type: String? = null): OpenFileResult {
|
|
|
if (!isVerified) {
|
|
|
if (!verifyLicense(context)) {
|
|
|
return OpenFileResult.FAILED
|
|
|
}
|
|
|
isVerified = true
|
|
|
}
|
|
|
- return openPdfFileImp(context, uri, password, onRequestPassword, type).apply{
|
|
|
+ return openPdfFileImp(context, password, onRequestPassword, type).apply{
|
|
|
isOpenedFileLiveData.postValue(this == OpenFileResult.SUCCESS)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private fun openPdfFileImp(context: Context, uri: Uri, password: String, requestPassword: Runnable, type: String?): OpenFileResult {
|
|
|
+ private fun openPdfFileImp(context: Context, password: String, requestPassword: Runnable, type: String?): OpenFileResult {
|
|
|
file = File(uri.path)
|
|
|
val factory = KMPDFFactory.open(context, uri, type) ?: return OpenFileResult.FAILED
|
|
|
readerModel.initKMPDFFactory(factory, uri.path, password)
|