android: icono adaptativo con el logo de Oasis y nueva extraccion del backend en cada APK distinta
El icono es la isla de la app oficial; antes el lanzador la encogia dentro de un circulo blanco (la oficial solo trae el PNG cuadrado) y el wrapper Gradle usaba un hexagono amarillo. Ahora capa de fondo y capa delante, en Gradle y en sobre_oficial.sh. La app oficial solo vuelve a extraer nodejs-project.zip si cambia versionName.versionCode. Con el mismo commit, o con cambios sin commitear, la APK nueva arrancaba con el backend anterior. El versionName lleva ahora una huella del codigo.
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- fondo del icono adaptativo: el marron casi negro del logo de Oasis -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="#1A1300"/>
|
||||
</shape>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Hexagono, el mismo motivo que la rejilla de navegacion de la interfaz -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp" android:height="108dp"
|
||||
android:viewportWidth="108" android:viewportHeight="108">
|
||||
<path
|
||||
android:pathData="M54,28 L74,40 L74,64 L54,76 L34,64 L34,40 Z"
|
||||
android:strokeColor="#FFB400" android:strokeWidth="5" android:fillColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M54,44 L63,49 L63,59 L54,64 L45,59 L45,49 Z"
|
||||
android:fillColor="#FFB400"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- el logo de Oasis (la isla), el mismo que la app oficial; el fondo llena la forma
|
||||
que ponga el lanzador (circulo, gota...) en vez de dejar un cuadrado dentro -->
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- el logo de Oasis (la isla), el mismo que la app oficial; el fondo llena la forma
|
||||
que ponga el lanzador (circulo, gota...) en vez de dejar un cuadrado dentro -->
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
|
|
|||
BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 81 KiB |
BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 134 KiB |
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#121212</color>
|
||||
</resources>
|
||||
|
|
@ -95,6 +95,18 @@ sed -i \
|
|||
"$DEC/AndroidManifest.xml"
|
||||
grep -rl "\"$PKG_DEV\.[A-Z_]*\"" "$DEC"/smali* | xargs -r sed -i -E "s|\"$PKG_DEV\.([A-Z_]+)\"|\"$PKG.\1\"|g"
|
||||
|
||||
# icono: el logo de la oficial, pero adaptativo. La oficial solo trae el PNG cuadrado
|
||||
# y en Android 8+ el lanzador lo encoge dentro de un circulo blanco; con la capa de
|
||||
# fondo y la de delante (app/src/main/res) la isla llena la forma del lanzador
|
||||
say "icono adaptativo"
|
||||
RES="$HERE/app/src/main/res"
|
||||
mkdir -p "$DEC/res/mipmap-anydpi-v26" "$DEC/res/drawable"
|
||||
cp "$RES/mipmap-anydpi-v26/ic_launcher.xml" "$DEC/res/mipmap-anydpi-v26/"
|
||||
cp "$RES/drawable/ic_launcher_background.xml" "$DEC/res/drawable/"
|
||||
for d in mdpi hdpi xhdpi xxhdpi xxxhdpi; do
|
||||
cp "$RES/mipmap-$d/ic_launcher_foreground.png" "$DEC/res/mipmap-$d/"
|
||||
done
|
||||
|
||||
# las de prueba (firmadas con la clave de depuracion) se marcan depurables: asi se
|
||||
# puede inspeccionar la WebView desde chrome://inspect. Las de publicar, nunca
|
||||
if [ -z "${OASIS_KEYSTORE:-}" ]; then
|
||||
|
|
@ -104,8 +116,13 @@ fi
|
|||
# version: la del dev por mil mas los commits de la rama, para que suba siempre
|
||||
CODE_DEV="$(sed -n 's/^ versionCode: //p' "$DEC/apktool.yml")"
|
||||
CODE="$(( CODE_DEV * 1000 + $(git -C "$REPO" rev-list --count HEAD) % 1000 ))"
|
||||
sed -i -e "s/^ versionCode: .*/ versionCode: $CODE/" -e "s/^ versionName: .*/ versionName: $VERSION-hacklab/" "$DEC/apktool.yml"
|
||||
say "version $VERSION-hacklab (codigo $CODE)"
|
||||
# la app oficial solo vuelve a extraer nodejs-project.zip si cambia versionName.versionCode;
|
||||
# con el mismo commit (o cambios sin commitear) se quedaba con el backend anterior. La
|
||||
# huella del codigo en el nombre hace que cada APK distinta se extraiga de nuevo
|
||||
HUELLA="$(cd "$REPO" && find src main.js package.json -type f -not -path '*/node_modules/*' -print0 | sort -z | xargs -0 sha1sum | sha1sum | cut -c1-8)"
|
||||
NAME="$VERSION-hacklab.$HUELLA"
|
||||
sed -i -e "s/^ versionCode: .*/ versionCode: $CODE/" -e "s/^ versionName: .*/ versionName: $NAME/" "$DEC/apktool.yml"
|
||||
say "version $NAME (codigo $CODE)"
|
||||
|
||||
# --- montar, alinear y firmar --------------------------------------------------
|
||||
say "montando"
|
||||
|
|
|
|||