Skip to content

Commit

Permalink
Patched improper input validation
Browse files Browse the repository at this point in the history
FLAGS:
   - skip build apk
  • Loading branch information
Hamza417 committed Oct 12, 2023
1 parent 0705cdf commit 52b8c0b
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package app.simple.inure.activities.association

import android.annotation.SuppressLint
import android.os.Bundle
import app.simple.inure.R
import app.simple.inure.extensions.activities.BaseActivity
import app.simple.inure.ui.association.Text
import app.simple.inure.util.ConditionUtils.invert
import app.simple.inure.util.NullSafety.isNotNull
import app.simple.inure.util.NullSafety.isNull

class TextViewerActivity : BaseActivity() {
Expand All @@ -26,14 +24,7 @@ class TextViewerActivity : BaseActivity() {
}
}

@SuppressLint("SdCardPath")
private fun hasAppPath(): Boolean {
if (intent.data.isNotNull()) {
val appDataPath = "/data/data/$packageName/"
val normalizedIntentPath = intent.data?.path?.replace("//+".toRegex(), "/")
return normalizedIntentPath?.contains(appDataPath) == true
}

return false
return intent.data?.path?.contains(packageName)!!
}
}

0 comments on commit 52b8c0b

Please sign in to comment.