Android hostname uses ro.product.model as fallback

This commit is contained in:
badaix 2019-12-08 21:25:43 +01:00
parent aa3ce3d5ab
commit 73e42f69cb
2 changed files with 4 additions and 1 deletions

View file

@ -13,7 +13,7 @@ fi
if [ -n "$NDK_DIR_ARM" ]; then
export NDK_DIR="$NDK_DIR_ARM"
export ARCH=arm
make clean; make TARGET=ANDROID -j 4; $NDK_DIR/bin/arm-linux-android-strip ./snapclient; mv ./snapclient "$ASSETS_DIR/bin/armeabi/"
make clean; make TARGET=ANDROID -j 4; $NDK_DIR/bin/arm-linux-androideabi-strip ./snapclient; mv ./snapclient "$ASSETS_DIR/bin/armeabi/"
fi
if [ -n "$NDK_DIR_X86" ]; then

View file

@ -124,6 +124,9 @@ static std::string getHostName()
std::string result = getProp("net.hostname");
if (!result.empty())
return result;
result = getProp("ro.product.model");
if (!result.empty())
return result;
#endif
char hostname[1024];
hostname[1023] = '\0';