From 9a66ea0fb6819c1a76be44d25e0b0c518e15da03 Mon Sep 17 00:00:00 2001 From: M M Arif Date: Fri, 13 Dec 2019 13:55:58 +0500 Subject: [PATCH] backport fix #235 --- .../mian/gitnex/activities/FileViewActivity.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java b/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java index 36985eff..a602e4c0 100644 --- a/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/FileViewActivity.java @@ -26,6 +26,8 @@ import org.mian.gitnex.helpers.Toasty; import org.mian.gitnex.models.Files; import org.mian.gitnex.util.AppUtil; import org.mian.gitnex.util.TinyDB; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; import retrofit2.Call; import retrofit2.Callback; @@ -76,6 +78,19 @@ public class FileViewActivity extends AppCompatActivity { initCloseListener(); closeActivity.setOnClickListener(onClickListener); + try { + + singleFileName = URLDecoder.decode(singleFileName, "UTF-8"); + singleFileName = singleFileName.replaceAll("//", "/"); + + } + catch (UnsupportedEncodingException e) { + + assert singleFileName != null; + Log.i("singleFileName", singleFileName); + + } + getSingleFileContents(instanceUrl, instanceToken, repoOwner, repoName, singleFileName); }