diff --git a/project/jni/application/xserver/AndroidAppSettings.cfg b/project/jni/application/xserver/AndroidAppSettings.cfg index 6e615955c..034bb6a00 100644 --- a/project/jni/application/xserver/AndroidAppSettings.cfg +++ b/project/jni/application/xserver/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="XServer XSDL" AppFullName=x.org.server # Application version code (integer) -AppVersionCode=11134 +AppVersionCode=11135 # Application user-visible version name (string) -AppVersionName="1.11.34" +AppVersionName="1.11.35" # Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...' # If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu diff --git a/project/jni/application/xserver/AndroidBuild.sh b/project/jni/application/xserver/AndroidBuild.sh index fe42c67c2..60f4797ca 100755 --- a/project/jni/application/xserver/AndroidBuild.sh +++ b/project/jni/application/xserver/AndroidBuild.sh @@ -4,6 +4,14 @@ CURDIR=`pwd` PACKAGE_NAME=`grep AppFullName AndroidAppSettings.cfg | sed 's/.*=//'` +[ -e pulseaudio/android-build.sh ] && { + [ -e pulseaudio/$1/install/bin/pulseaudio ] || { + cd pulseaudio + ./android-build.sh || exit 1 + cd .. + } || exit 1 +} || exit 1 + ../setEnvironment-$1.sh sh -c '\ $CC $CFLAGS -c main.c -o main-'"$1.o" || exit 1 ../setEnvironment-$1.sh sh -c '\ @@ -70,21 +78,34 @@ hw/kdrive/linux/.libs/liblinux.a \ rm -rf $CURDIR/tmp-$1 mkdir -p $CURDIR/tmp-$1 cd $CURDIR/tmp-$1 -cp $CURDIR/xserver/data/busybox-$1 ./busybox -#cp $CURDIR/pulseaudio/pulseaudio-$1 ./pulseaudio -cp $CURDIR/ssh ./ -cp $CURDIR/sshpass ./ +cp -f $CURDIR/xserver/data/busybox-$1 ./busybox +cp -f $CURDIR/ssh ./ +cp -f $CURDIR/sshpass ./ mkdir -p usr/bin # Executables linked with NDK, which crash on Lollipop. -for f in xhost xkbcomp xli xsel; do cp $CURDIR/xserver/android/$1/$f ./usr/bin/$f ; done +for f in xhost xkbcomp xli xsel; do cp -f $CURDIR/xserver/android/$1/$f ./usr/bin/$f ; done # Statically-linked prebuilt executables, generated using Debian chroot. # There are no executables for old ARMv5, so we'll use NDK executables instead for that arch. #for f in xhost xkbcomp xli xsel; do cp $CURDIR/xserver/data/$f-$1 ./usr/bin/$f ; done rm -f ../AndroidData/binaries-$1.zip zip -r ../AndroidData/binaries-$1.zip . # Executables linked with NDK with -pie, which crash on pre-Lollipop. -for f in xhost xkbcomp xli xsel; do rm ./usr/bin/$f ; cp $CURDIR/xserver/android/$1/pie/$f ./usr/bin/$f ; done +for f in xhost xkbcomp xli xsel; do rm ./usr/bin/$f ; cp -f $CURDIR/xserver/android/$1/pie/$f ./usr/bin/$f ; done cp $CURDIR/xserver/data/busybox-$1-pie ./busybox + +# PulseAudio - PIE only +mkdir -p pulse +cp -f $CURDIR/pulseaudio/$1/install/bin/pulseaudio pulse/ +cp -f $CURDIR/pulseaudio/$1/install/lib/libpulse.so.0.18.2 pulse/libpulse.so.0 +#ln -sf libpulse.so.0.18.2 pulse/libpulse.so.0 +#ln -sf libpulse.so.0.18.2 pulse/libpulse.so +cp -f $CURDIR/pulseaudio/$1/install/lib/libpulsecore-7.0.so pulse/ +cp -f $CURDIR/pulseaudio/$1/install/lib/pulseaudio/libpulsecommon-7.0.so pulse/ +for F in $CURDIR/pulseaudio/$1/install/lib/pulse-7.0/modules/*.so; do + cp -f $F pulse/ +done +cp -f $CURDIR/pulseaudio/android-pulseaudio.conf pulse/pulseaudio.conf + rm -f ../AndroidData/binaries-$1-pie.zip zip -r ../AndroidData/binaries-$1-pie.zip . diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c index e68c544bb..5ea68ee90 100644 --- a/project/jni/application/xserver/gfx.c +++ b/project/jni/application/xserver/gfx.c @@ -684,11 +684,11 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, int resolutionH) { int sd, addr, ifc_num, i; - struct ifconf ifc; - struct ifreq ifr[20]; - SDL_Surface * surf; - int y = resolutionH * 1 / 3; - char msg[128]; + struct ifconf ifc; + struct ifreq ifr[20]; + SDL_Surface * surf; + int y = resolutionH * 1 / 3; + char msg[128]; if (resolutionH > resolutionW) resolutionH = resolutionW; @@ -708,50 +708,53 @@ void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, i renderStringScaled("Launch these commands on your Linux PC:", 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); y += resolutionH * 30 / VID_Y; - sd = socket(PF_INET, SOCK_DGRAM, 0); - if (sd > 0) - { - ifc.ifc_len = sizeof(ifr); - ifc.ifc_ifcu.ifcu_buf = (caddr_t)ifr; + sd = socket(PF_INET, SOCK_DGRAM, 0); + if (sd > 0) + { + ifc.ifc_len = sizeof(ifr); + ifc.ifc_ifcu.ifcu_buf = (caddr_t)ifr; - if (ioctl(sd, SIOCGIFCONF, &ifc) == 0) - { - ifc_num = ifc.ifc_len / sizeof(struct ifreq); - __android_log_print(ANDROID_LOG_INFO, "XSDL", "%d network interfaces found", ifc_num); + if (ioctl(sd, SIOCGIFCONF, &ifc) == 0) + { + ifc_num = ifc.ifc_len / sizeof(struct ifreq); + __android_log_print(ANDROID_LOG_INFO, "XSDL", "%d network interfaces found", ifc_num); - for (i = 0; i < ifc_num; ++i) - { - int addr = 0; - char saddr[32]; - if (ifr[i].ifr_addr.sa_family != AF_INET) - continue; + for (i = 0; i < ifc_num; ++i) + { + int addr = 0; + char saddr[32]; + if (ifr[i].ifr_addr.sa_family != AF_INET) + continue; - if (ioctl(sd, SIOCGIFADDR, &ifr[i]) == 0) - addr = ((struct sockaddr_in *)(&ifr[i].ifr_addr))->sin_addr.s_addr; - if (addr == 0) - continue; - sprintf (saddr, "%d.%d.%d.%d", (addr & 0xFF), (addr >> 8 & 0xFF), (addr >> 16 & 0xFF), (addr >> 24 & 0xFF)); - __android_log_print(ANDROID_LOG_INFO, "XSDL", "interface: %s address: %s\n", ifr[i].ifr_name, saddr); - if (strcmp(saddr, "127.0.0.1") == 0) - continue; - sprintf (msg, "env DISPLAY=%s%s metacity &", saddr, port); - renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); - y += resolutionH * 15 / VID_Y; - sprintf (msg, "env DISPLAY=%s%s gimp", saddr, port); - renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); - y += resolutionH * 20 / VID_Y; - } - } + if (ioctl(sd, SIOCGIFADDR, &ifr[i]) == 0) + addr = ((struct sockaddr_in *)(&ifr[i].ifr_addr))->sin_addr.s_addr; + if (addr == 0) + continue; + sprintf (saddr, "%d.%d.%d.%d", (addr & 0xFF), (addr >> 8 & 0xFF), (addr >> 16 & 0xFF), (addr >> 24 & 0xFF)); + __android_log_print(ANDROID_LOG_INFO, "XSDL", "interface: %s address: %s\n", ifr[i].ifr_name, saddr); + if (strcmp(saddr, "127.0.0.1") == 0) + continue; + sprintf (msg, "export DISPLAY=%s%s", saddr, port); + renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); + y += resolutionH * 15 / VID_Y; + sprintf (msg, "export PULSE_SERVER=tcp:%s:4712", saddr); + renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); + y += resolutionH * 15 / VID_Y; + sprintf (msg, "metacity & gimp"); + renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); + y += resolutionH * 20 / VID_Y; + } + } - close(sd); - } + close(sd); + } - y += resolutionH * 10 / VID_Y; - sprintf (msg, "To tunnel X over SSH, forward port %d", atoi(port+1) + 6000); - renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); - y += resolutionH * 15 / VID_Y; - sprintf (msg, "in your SSH client"); - renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); + y += resolutionH * 10 / VID_Y; + sprintf (msg, "To tunnel X over SSH, forward port %d", atoi(port+1) + 6000); + renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); + y += resolutionH * 15 / VID_Y; + sprintf (msg, "in your SSH client"); + renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); SDL_SaveBMP(surf, "background.bmp"); SDL_FreeSurface(surf); diff --git a/project/jni/application/xserver/main.c b/project/jni/application/xserver/main.c index a463b1cdd..a687b783d 100644 --- a/project/jni/application/xserver/main.c +++ b/project/jni/application/xserver/main.c @@ -100,11 +100,14 @@ int main( int argc, char* argv[] ) if (getenv("SDL_RESTART_PARAMS") && getenv("SDL_RESTART_PARAMS")[0]) strcpy(port, getenv("SDL_RESTART_PARAMS")); - sprintf(fontpath, "%s/img/usr/share/fonts/X11/misc," + snprintf(fontpath, sizeof(fontpath), + "%s/img/usr/share/fonts/X11/misc," "%s/img/usr/share/fonts/X11/Type1," "%s/img/usr/share/fonts/X11/100dpi," "%s/img/usr/share/fonts/X11/75dpi," "%s/img/usr/share/fonts/X11/cyrillic", + "%s/usr/share/fonts", + getenv("SECURE_STORAGE_DIR"), getenv("SECURE_STORAGE_DIR"), getenv("SECURE_STORAGE_DIR"), getenv("SECURE_STORAGE_DIR"), diff --git a/project/jni/application/xserver/pulseaudio b/project/jni/application/xserver/pulseaudio index 483ebf28f..f865b8066 160000 --- a/project/jni/application/xserver/pulseaudio +++ b/project/jni/application/xserver/pulseaudio @@ -1 +1 @@ -Subproject commit 483ebf28f872219a3ba29d9cbc4d38728da459b0 +Subproject commit f865b8066561eac3b38b3685688bef3c2b1e6277 diff --git a/project/jni/application/xserver/xserver b/project/jni/application/xserver/xserver index a03ba7954..ddef4689b 160000 --- a/project/jni/application/xserver/xserver +++ b/project/jni/application/xserver/xserver @@ -1 +1 @@ -Subproject commit a03ba7954b3eb7c0eccc84e18f856d71dd3e6503 +Subproject commit ddef4689b5514e246f85aaafc38a5730f8279f3f