[SDL] Fixed ProGuard not supporting latest Android SDK

This commit is contained in:
Sergii Pylypenko
2017-01-12 21:43:42 +02:00
parent 0064caed1f
commit 13f7249b19
3 changed files with 18 additions and 18 deletions

View File

@@ -70,7 +70,7 @@ def convert_project(project_name, output_dir):
os.rename(os.path.join(your_file_dest_path, 'classes.jar'), os.path.join(your_file_dest_path, project_name + '.jar')) os.rename(os.path.join(your_file_dest_path, 'classes.jar'), os.path.join(your_file_dest_path, project_name + '.jar'))
shutil.move(os.path.join(your_file_dest_path, project_name + '.jar'), os.path.join(your_file_dest_path, 'libs/' + project_name + '.jar')) shutil.move(os.path.join(your_file_dest_path, project_name + '.jar'), os.path.join(your_file_dest_path, 'libs/' + project_name + '.jar'))
# Call android update. So we have to install android first, then add it into PATH # Call android update. So we have to install android first, then add it into PATH
command = "android update lib-project -p " + os.path.join(output_dir, project_name) + " -t 10" command = "android update lib-project -p " + os.path.join(output_dir, project_name) + " -t android-25"
os.system(command) os.system(command)
# Update project.properties file # Update project.properties file
with open(os.path.join(output_dir, project_name, 'project.properties'), "a") as myfile: with open(os.path.join(output_dir, project_name, 'project.properties'), "a") as myfile:

View File

@@ -1007,7 +1007,18 @@ else
cd $CURDIR cd $CURDIR
$SEDI "s/==GOOGLEPLAYGAMESERVICES_APP_ID==/$GooglePlayGameServicesId/g" project/res/values/strings.xml $SEDI "s/==GOOGLEPLAYGAMESERVICES_APP_ID==/$GooglePlayGameServicesId/g" project/res/values/strings.xml
grep 'google-play-services' project/local.properties > /dev/null || { grep 'play-services' project/local.properties > /dev/null || {
PROGUARD=`which android`
PROGUARD=`dirname $PROGUARD`/proguard/lib/proguard.jar
java -jar $PROGUARD | grep 'ProGuard, version 5.3.2' || {
echo "Error: ProGuard is too old"
echo "You need to update ProGuard. Download it here:"
echo "https://sourceforge.net/projects/proguard/files/proguard/5.3/proguard5.3.2.tar.gz"
echo "Unpack it, then place file proguard.jar to $PROGUARD"
exit 1
}
# Ant is way too smart, and adds current project path in front of the ${sdk.dir} # Ant is way too smart, and adds current project path in front of the ${sdk.dir}
echo "android.library.reference.1=play-services/games/play-services-games-$PLAY_SERVICES_VER" >> project/local.properties echo "android.library.reference.1=play-services/games/play-services-games-$PLAY_SERVICES_VER" >> project/local.properties
echo "android.library.reference.2=play-services/drive/play-services-drive-$PLAY_SERVICES_VER" >> project/local.properties echo "android.library.reference.2=play-services/drive/play-services-drive-$PLAY_SERVICES_VER" >> project/local.properties
@@ -1020,19 +1031,6 @@ else
echo 'proguard.config=proguard.cfg;proguard-local.cfg' >> project/local.properties echo 'proguard.config=proguard.cfg;proguard-local.cfg' >> project/local.properties
ln -s -f $SDK_DIR/extras/android/compatibility/v4/android-support-v4.jar project/libs ln -s -f $SDK_DIR/extras/android/compatibility/v4/android-support-v4.jar project/libs
} }
if false; then
[ -e $SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib/build.xml ] || \
android update project -t android-23 -p $SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib
[ -e $SDK_DIR/extras/android/compatibility/v7/mediarouter/build.xml ] || { \
android update project -t android-23 -p $SDK_DIR/extras/android/compatibility/v7/mediarouter
echo 'android.library.reference.1=../../../../../../../../../../../../../../${sdk.dir}/extras/android/compatibility/v7/appcompat' >> $SDK_DIR/extras/android/compatibility/v7/mediarouter/local.properties
}
[ -e $SDK_DIR/extras/android/compatibility/v7/appcompat/build.xml ] || \
android update project -t android-23 -p $SDK_DIR/extras/android/compatibility/v7/appcompat
[ -e $SDK_DIR/extras/android/compatibility/v7/palette/build.xml ] || \
android update project -t android-23 -p $SDK_DIR/extras/android/compatibility/v7/palette && \
mkdir -p $SDK_DIR/extras/android/compatibility/v7/palette/src
fi
fi fi
if [ -e project/jni/application/src/project.patch ]; then patch -p1 --dry-run -f -R < project/jni/application/src/project.patch > /dev/null 2>&1 || patch -p1 --no-backup-if-mismatch < project/jni/application/src/project.patch || exit 1 ; fi if [ -e project/jni/application/src/project.patch ]; then patch -p1 --dry-run -f -R < project/jni/application/src/project.patch > /dev/null 2>&1 || patch -p1 --no-backup-if-mismatch < project/jni/application/src/project.patch || exit 1 ; fi

View File

@@ -11,9 +11,11 @@ Installation
============ ============
Install latest Android SDK and NDK from http://developer.android.com/index.html Install latest Android SDK and NDK from http://developer.android.com/index.html
You'll need to install Java Ant too. Since for building apk files some java classes are needed as well, Add both to your PATH env variable 0 you sohuld be albe to run commands 'ndk-build' and 'android'.
it is recommended to install OpenJDK and its development files. (On RPM based distros You will need to install Java Ant too.
usually called java-x.x.x-openjdk and java-x.x.x-openjdk-devel) it is recommended to install OpenJDK and its development files.
On RPM based distros they are usually called java-x.x.x-openjdk and java-x.x.x-openjdk-devel.
On Debian or Ubuntu you install them like this: sudo apt-get install openjdk-8-jdk ant
The application will run on Android 2.3 and above, but will use features from Android 6.0 if available. The application will run on Android 2.3 and above, but will use features from Android 6.0 if available.
The most supported environment for this port is Linux, MacOs should be okay too. The most supported environment for this port is Linux, MacOs should be okay too.
If you're developing under Windows you'd better install Portable Ubuntu, to get proper Linux environment If you're developing under Windows you'd better install Portable Ubuntu, to get proper Linux environment