diff --git a/app/build.gradle b/app/build.gradle index 947a09de..bf1446ca 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,20 +1,24 @@ plugins { id "org.sonarqube" version "3.3" + id 'com.android.application' } -apply plugin: 'com.android.application' final SONAR_PROJECT_VERSION = '1.52' android { - compileSdkVersion 31 - buildToolsVersion "30.0.2" + namespace 'com.example.myapplication' + compileSdk 34 + defaultConfig { applicationId "fr.ralala.hexviewer" - minSdkVersion 23 - targetSdkVersion 31 + minSdk 23 + targetSdk 34 // F-Droid seems not to appreciate the use of variables versionCode 152 versionName '1.52' + vectorDrawables { + useSupportLibrary true + } } compileOptions { @@ -33,6 +37,9 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-debug.pro' } } + buildFeatures { + compose true + } // This is important, it will run lint checks but won't abort build lintOptions { abortOnError false @@ -47,17 +54,18 @@ android { property 'sonar.coverage.exclusions', "**/**" } } + namespace 'fr.ralala.hexviewer' } dependencies { implementation 'org.apache.commons:commons-collections4:4.0' - implementation "androidx.appcompat:appcompat:1.4.2" - implementation "androidx.preference:preference:1.2.0" + implementation "androidx.appcompat:appcompat:1.6.1" + implementation "androidx.preference:preference:1.2.1" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" implementation "androidx.emoji:emoji:1.1.0" implementation "com.android.support:support-emoji-bundled:$version" - implementation "com.google.android.material:material:1.6.1" - testImplementation "junit:junit:4.12" + implementation "com.google.android.material:material:1.11.0" + testImplementation "junit:junit:4.13.2" } // versionCode <-> versionName ///////////////////////////////////////////////////////////////////// // I got the idea (code) below from the repository https://github.com/sal0max/currencie diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index f1b42451..481bb434 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -18,4 +18,4 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1c089e0d..19b07274 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,9 +1,9 @@ + xmlns:tools="http://schemas.android.com/tools"> - + + android:theme="@style/AppTheme" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + tools:targetApi="s"> + + + \ No newline at end of file diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 00000000..aa80246e --- /dev/null +++ b/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index c3fb3892..efc826d4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,31 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' - - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - gradlePluginPortal() - google() - mavenCentral() - } - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} +plugins { + id 'com.android.application' version '8.1.2' apply false +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 52f5917c..729a082f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,8 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false +org.gradle.warning.mode=all \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e5897..96997e96 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Mon Mar 25 15:04:22 CET 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index fbd7c515..087457ee 100644 --- a/gradlew +++ b/gradlew @@ -27,20 +27,20 @@ PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done +ls=`ls -ld "$PRG"` +link=`expr "$ls" : '.*-> \(.*\)$'` +if expr "$link" : '/.*' > /dev/null; then + PRG="$link" +else +PRG=`dirname "$PRG"`"/$link" +fi + done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" + APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null -APP_NAME="Gradle" + APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @@ -67,110 +67,110 @@ darwin=false nonstop=false case "`uname`" in CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +cygwin=true +;; +Darwin* ) +darwin=true +;; +MINGW* ) +msys=true +;; +NONSTOP* ) +nonstop=true +;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" +else +JAVACMD="$JAVA_HOME/bin/java" +fi +if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi + location of your Java installation." +fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD="java" +which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." + location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi + MAX_FD_LIMIT=`ulimit -H -n` +if [ $? -eq 0 ] ; then +if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" +fi + ulimit -n $MAX_FD +if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" +fi +else +warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi + fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin or MSYS, switch paths to Windows format before running java if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac + APP_HOME=`cygpath --path --mixed "$APP_HOME"` +CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + +JAVACMD=`cygpath --unix "$JAVACMD"` + +# We build the pattern for arguments to be converted via cygpath +ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` +SEP="" +for dir in $ROOTDIRSRAW ; do +ROOTDIRS="$ROOTDIRS$SEP$dir" +SEP="|" +done + OURCYGPATTERN="(^($ROOTDIRS))" +# Add a user-defined pattern to the cygpath arguments +if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi +# Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 +for arg in "$@" ; do +CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` +CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + +if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` +else +eval `echo args$i`="\"$arg\"" +fi + i=`expr $i + 1` +done +case $i in +0) set -- ;; +1) set -- "$args0" ;; +2) set -- "$args0" "$args1" ;; +3) set -- "$args0" "$args1" "$args2" ;; +4) set -- "$args0" "$args1" "$args2" "$args3" ;; +5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; +6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; +7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; +8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; +9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +esac + fi # Escape application args save () { diff --git a/gradlew.bat b/gradlew.bat index 5093609d..107acd32 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index 5ca5855d..ee4743c4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,17 @@ -include ':app' -rootProject.name = "HexViewer" \ No newline at end of file +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "HexViewer" +include ':app' \ No newline at end of file