This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Copy folder from app package (requires root) | |
# | |
# ./adb-copy-folder.sh [app-package-name] [log-folder] | |
# Ex: ./adb-copy-folder.sh lt.markmerkk.blindless.app.debug databases | |
INPUT_PACKAGE=$1 | |
INPUT_FOLDER=$2 | |
if [[ -z ${INPUT_PACKAGE} && -z ${INPUT_FOLDER} ]] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.os.Environment | |
import androidx.lifecycle.LifecycleCoroutineScope | |
import com.spotos.core.LogUtils.withLogInstance | |
import com.spotos.core.LogUtils.withLogKlass | |
import com.spotos.core.Tags | |
import com.spotos.data.SentryInteractor | |
import com.spotos.data.ViewProvider | |
import kotlinx.coroutines.CoroutineDispatcher | |
import kotlinx.coroutines.Dispatchers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.os.Environment | |
import android.util.Log | |
import ch.qos.logback.classic.Level | |
import ch.qos.logback.classic.LoggerContext | |
import ch.qos.logback.classic.encoder.PatternLayoutEncoder | |
import ch.qos.logback.classic.html.HTMLLayout | |
import ch.qos.logback.classic.spi.ILoggingEvent | |
import ch.qos.logback.core.encoder.LayoutWrappingEncoder | |
import ch.qos.logback.core.rolling.RollingFileAppender |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Decrypts input file (+base64) contents with AES-256-CBC and a password | |
#set -x | |
FILE_IN=$1 | |
if [[ -f $FILE_IN ]]; then | |
echo "Converting..." | |
else | |
echo "File not found!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Encrypts input file (+base64) contents with AES-256-CBC and a password | |
#set -x | |
FILE_IN=$1 | |
if [[ -f $FILE_IN ]]; then | |
echo "Converting..." | |
else | |
echo "File not found!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
OUT_NAME=qrencode-$(uuidgen) | |
OUT_FILEEXT=png | |
OUT_FILENAME=${OUT_NAME}.${OUT_FILEEXT} | |
OUT_FILENAME_TXT=${OUT_NAME}-txt.${OUT_FILEEXT} | |
OUT=/tmp/${OUT_FILENAME} | |
OUT_TXT=/tmp/${OUT_FILENAME_TXT} | |
INPUT=$1 | |
if [[ $# -eq 0 ]] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Dynamically applies padding | |
*/ | |
fun View?.applyPadding( | |
paddingStart: Int? = null, | |
paddingEnd: Int? = null, | |
paddingTop: Int? = null, | |
paddingBottom: Int? = null, | |
) { | |
this?.setPadding( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Dynamically applies margin | |
*/ | |
fun View?.applyMargin( | |
marginStart: Int? = null, | |
marginEnd: Int? = null, | |
marginTop: Int? = null, | |
marginBottom: Int? = null, | |
) { | |
if (this !is ViewGroup) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DividerItemWithoutLastDecoration( | |
val divider: Drawable, | |
val dividerOffset: ItemDecoratorOffset = ItemDecoratorOffset.asEmpty(), | |
) : RecyclerView.ItemDecoration() { | |
override fun onDrawOver(canvas: Canvas, parent: RecyclerView, state: RecyclerView.State) { | |
val dividerLeft = parent.paddingLeft + dividerOffset.start | |
val dividerRight = parent.width - parent.paddingRight - dividerOffset.end | |
val childCount = parent.childCount | |
for (i in 0..childCount - 2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class ItemDecoratorOffset private constructor( | |
val top: Int, | |
val bottom: Int, | |
val start: Int, | |
val end: Int, | |
) { | |
companion object { | |
fun asEmpty(): ItemDecoratorOffset { | |
return ItemDecoratorOffset( | |
top = 0, |
NewerOlder