diff --git a/changeAppSettings.sh b/changeAppSettings.sh
index 06019034a..8298bee5d 100755
--- a/changeAppSettings.sh
+++ b/changeAppSettings.sh
@@ -716,28 +716,6 @@ else
cat $F | sed "s/^package .*;/package $AppFullName;/" >> project/src/Advertisement.java
fi
-if [ "$GooglePlayGameServicesId" = "n" -o -z "$GooglePlayGameServicesId" ] ; then
- $SEDI "/==GOOGLEPLAYGAMESERVICES==/ d" project/AndroidManifest.xml
- GooglePlayGameServicesId=""
-else
- for F in $JAVA_SRC_PATH/googleplaygameservices/*.java; do
- OUT=`echo $F | sed 's@.*/@@'` # basename tool is not available everywhere
- echo Patching $F
- echo '// DO NOT EDIT THIS FILE - it is automatically generated, edit file under $JAVA_SRC_PATH dir' > project/src/$OUT
- cat $F | sed "s/^package .*;/package $AppFullName;/" >> project/src/$OUT
- done
- $SEDI "s/==GOOGLEPLAYGAMESERVICES_APP_ID==/$GooglePlayGameServicesId/g" project/AndroidManifest.xml
- SDK_DIR=`grep '^sdk.dir' project/local.properties | sed 's/.*=//'`
- grep 'android.library.reference.1' project/local.properties > /dev/null || {
- # Ant is way too smart, and adds current project path in front of the ${sdk.dir}
- echo 'android.library.reference.1=../../../../../../../../../../../../../../${sdk.dir}/extras/google/google_play_services/libproject/google-play-services_lib' >> project/local.properties
- echo 'proguard.config=proguard.cfg' >> project/local.properties
- ln -s -f $SDK_DIR/extras/android/compatibility/v4/android-support-v4.jar project/libs
- }
- [ -e $SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib/build.xml ] || \
- android update project -p $SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib
-fi
-
echo "-keep class $AppFullName.** { *; }" > project/proguard-local.cfg
if [ "$AppRecordsAudio" = "n" -o -z "$AppRecordsAudio" ] ; then
@@ -873,6 +851,28 @@ for F in */strings.xml; do
done
cd ../../..
+if [ "$GooglePlayGameServicesId" = "n" -o -z "$GooglePlayGameServicesId" ] ; then
+ $SEDI "/==GOOGLEPLAYGAMESERVICES==/ d" project/AndroidManifest.xml
+ GooglePlayGameServicesId=""
+else
+ for F in $JAVA_SRC_PATH/googleplaygameservices/*.java; do
+ OUT=`echo $F | sed 's@.*/@@'` # basename tool is not available everywhere
+ echo Patching $F
+ echo '// DO NOT EDIT THIS FILE - it is automatically generated, edit file under $JAVA_SRC_PATH dir' > project/src/$OUT
+ cat $F | sed "s/^package .*;/package $AppFullName;/" >> project/src/$OUT
+ done
+ $SEDI "s/==GOOGLEPLAYGAMESERVICES_APP_ID==/$GooglePlayGameServicesId/g" project/res/values/strings.xml
+ SDK_DIR=`grep '^sdk.dir' project/local.properties | sed 's/.*=//'`
+ grep 'android.library.reference.1' project/local.properties > /dev/null || {
+ # Ant is way too smart, and adds current project path in front of the ${sdk.dir}
+ echo 'android.library.reference.1=../../../../../../../../../../../../../../${sdk.dir}/extras/google/google_play_services/libproject/google-play-services_lib' >> project/local.properties
+ echo 'proguard.config=proguard.cfg' >> project/local.properties
+ ln -s -f $SDK_DIR/extras/android/compatibility/v4/android-support-v4.jar project/libs
+ }
+ [ -e $SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib/build.xml ] || \
+ android update project -p $SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib
+fi
+
echo Cleaning up dependencies
rm -rf project/libs/*/* project/gen
for OUT in obj; do
diff --git a/project/AndroidManifestTemplate.xml b/project/AndroidManifestTemplate.xml
index 0205912af..7506b297e 100644
--- a/project/AndroidManifestTemplate.xml
+++ b/project/AndroidManifestTemplate.xml
@@ -26,8 +26,8 @@
-
-
+
+
diff --git a/project/java/googleplaygameservices/CloudSave.java b/project/java/googleplaygameservices/CloudSave.java
index 6e8a0d72e..bc5c421e3 100644
--- a/project/java/googleplaygameservices/CloudSave.java
+++ b/project/java/googleplaygameservices/CloudSave.java
@@ -22,56 +22,23 @@ import android.util.Log;
import com.google.android.gms.common.api.GoogleApiClient;
-/**
- * Example base class for games. This implementation takes care of setting up
- * the API client object and managing its lifecycle. Subclasses only need to
- * override the @link{#onSignInSucceeded} and @link{#onSignInFailed} abstract
- * methods. To initiate the sign-in flow when the user clicks the sign-in
- * button, subclasses should call @link{#beginUserInitiatedSignIn}. By default,
- * this class only instantiates the GoogleApiClient object. If the PlusClient or
- * AppStateClient objects are also wanted, call the BaseGameActivity(int)
- * constructor and specify the requested clients. For example, to request
- * PlusClient and GamesClient, use BaseGameActivity(CLIENT_GAMES | CLIENT_PLUS).
- * To request all available clients, use BaseGameActivity(CLIENT_ALL).
- * Alternatively, you can also specify the requested clients via
- * @link{#setRequestedClients}, but you must do so before @link{#onCreate}
- * gets called, otherwise the call will have no effect.
- *
- * @author Bruno Oliveira (Google)
- */
public class CloudSave implements GameHelper.GameHelperListener {
// The game helper object. This class is mainly a wrapper around this object.
protected GameHelper mHelper;
- // We expose these constants here because we don't want users of this class
- // to have to know about GameHelper at all.
- public static final int CLIENT_GAMES = GameHelper.CLIENT_GAMES;
- public static final int CLIENT_APPSTATE = GameHelper.CLIENT_APPSTATE;
- public static final int CLIENT_PLUS = GameHelper.CLIENT_PLUS;
- public static final int CLIENT_ALL = GameHelper.CLIENT_ALL;
-
// Requested clients. By default, that's just the games client.
- public int mRequestedClients = CLIENT_GAMES;
-
- private final static String TAG = "BaseGameActivity";
- public boolean mDebugLog = false;
+ public int mRequestedClients = GameHelper.CLIENT_SNAPSHOT;
MainActivity parent;
/** Constructs a BaseGameActivity with default client (GamesClient). */
public CloudSave(MainActivity p)
{
+ Log.i("SDL", "CloudSave: initializing");
parent = p;
- setRequestedClients(CLIENT_GAMES);
+ setRequestedClients(GameHelper.CLIENT_SNAPSHOT);
getGameHelper().setup(this);
- /*
- // Add the Drive API and scope to the builder:
- GoogleApiClient.Builder builder = helper.getApiClientBuilder();
- GoogleApiClient.Builder builder = new GoogleApiClient.Builder(parent, this, this);
- builder.addScope(Drive.SCOPE_APPFOLDER);
- builder.addApi(Drive.API);
- */
}
/**
@@ -91,7 +58,6 @@ public class CloudSave implements GameHelper.GameHelperListener {
public GameHelper getGameHelper() {
if (mHelper == null) {
mHelper = new GameHelper(parent, mRequestedClients);
- mHelper.enableDebugLog(mDebugLog);
}
return mHelper;
}
@@ -109,11 +75,11 @@ public class CloudSave implements GameHelper.GameHelperListener {
}
public void onSignInSucceeded() {
- // TODO
+ Log.i("SDL", "CloudSave: onSignInSucceeded()");
}
public void onSignInFailed() {
- // TODO
+ Log.i("SDL", "CloudSave: onSignInFailed()");
}
public GoogleApiClient getApiClient() {
@@ -141,14 +107,7 @@ public class CloudSave implements GameHelper.GameHelperListener {
}
public void enableDebugLog(boolean enabled) {
- mDebugLog = true;
- if (mHelper != null) {
- mHelper.enableDebugLog(enabled);
- }
- }
-
- public void enableDebugLog(boolean enabled, String tag) {
- enableDebugLog(enabled);
+ mHelper.enableDebugLog(enabled);
}
public String getInvitationId() {
diff --git a/project/java/translations/values/strings.xml b/project/java/translations/values/strings.xml
index 9e1aae3d9..6d03455e6 100644
--- a/project/java/translations/values/strings.xml
+++ b/project/java/translations/values/strings.xml
@@ -192,5 +192,6 @@
The application is incorrectly configured. Check that the package name and signing certificate match the client ID created in Developer Console. Also, if the application is not yet published, check that the account you are trying to sign in with is listed as a tester account. See logs for more information.
License check failed.
Unknown error.
+ ==GOOGLEPLAYGAMESERVICES_APP_ID==