diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml
deleted file mode 100644
index 1913b6f2..00000000
--- a/.github/workflows/debug.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: Debug APK Builder
-
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - master
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v1
- - name: JDK 8 Setup
- uses: actions/setup-java@v1
- with:
- java-version: 11.0.8
-
- - name: Install NDK
- run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.0.6113669"
-
- - name: Grant rights
- run: chmod +x ./gradlew
-
- - name: Build project
- run: ./gradlew build
-
- - name: Build APK
- run: ./gradlew assembleDebug
-
- - name: Upload to Artifacts
- uses: actions/upload-artifact@v2
- with:
- name: 'MicroG'
- path: play-services-core/build/outputs/apk/debug/play-services-core-debug.apk
\ No newline at end of file
diff --git a/README.md b/README.md
index a9b81f9a..29f47891 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,14 @@
# Vanced+ MicroG
-This fork tweaks MicroG to be usable by applications that require Google authentication such as [YouTube Vanced+](https://gitlab.com/cuynu/ytvancedx) or [ReVanced](https://github.com/revanced), [ReVanced Extended](https://github.com/inotia00) / [ReX](https://github.com/YT-Advanced).
-
-## Donate this project (Not required)
-
-
+This fork tweaks MicroG to be usable by applications that require Google authentication such as [YouTube Vanced+](https://gitlab.com/cuynu/vancedx).
## Warning!
-Vanced+ microG probably not work in ReVanced/RVX in future as recent changes from ReVanced/RVX to use with they specific MicroG called ReVanced MicroG with different package name !
+Vanced+ microG are currently **DOES NOT WORK** with ReVanced/RVX as they now uses their own ReVanced microG with specific package name! However, there are workaround : [Issues #15](https://gitlab.com/cuynu/VancedxMicroG/-/issues/15#note_1837372638)
## Notable changes
- No longer a system app
-- Package name changed from `com.google.android.gms` to `com.mgoogle.android.gms` to support installation alongside the official MicroG
+- Package name changed from `com.google.android.gms` to `com.mgoogle.android.gms` to support installation alongside the official MicroG or device with Google Play Services pre-installed
- Removed unnecessary features:
- Ads
- Analytics
diff --git a/build.gradle b/build.gradle
index 7106e279..bcf0bcbe 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,26 +4,31 @@
*/
buildscript {
- ext.kotlinVersion = '1.8.20'
+ ext.applicationNamespace = "com.google.android.gms"
+ ext.basePackageName = "com.mgoogle"
+
+ ext.safeParcelVersion = '1.7.1'
+
+ ext.kotlinVersion = '1.7.21'
ext.coroutineVersion = '1.6.4'
- ext.annotationVersion = '1.6.0'
+ ext.annotationVersion = '1.5.0'
ext.appcompatVersion = '1.6.1'
ext.coreVersion = '1.9.0'
ext.collectionVersion = '1.3.0-dev01'
ext.fragmentVersion = '1.5.5'
ext.lifecycleVersion = '2.5.1'
- ext.materialVersion = '1.8.0'
+ ext.materialVersion = '1.7.0'
ext.navigationVersion = '2.5.3'
ext.preferenceVersion = '1.2.0'
- ext.webkitVersion = '1.6.0'
+ ext.webkitVersion = '1.5.0'
ext.circleimageviewVersion = '3.1.0'
ext.volleyVersion = '1.2.1'
- ext.wireVersion = '4.5.5'
+ ext.wireVersion = '4.8.0'
- ext.androidBuildGradleVersion = '8.0.0'
+ ext.androidBuildGradleVersion = '8.0.2'
ext.androidBuildVersionTools = '33.0.2'
ext.androidMinSdk = 23
@@ -36,20 +41,19 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:8.0.2'
+ classpath "com.android.tools.build:gradle:$androidBuildGradleVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion"
}
}
-def gmsVersion = "23.42.12"
+def gmsVersion = "25.09.34"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
-def ourVersionBase = "0.2.29"
-def ourVersionMinor = 73
+def ourVersionBase = "0.3.0"
-def ourVersionCode = gmsVersionCode * 1000 + ourVersionMinor
+def ourVersionCode = gmsVersionCode * 1000
def ourVersionName = "$ourVersionBase.$gmsVersionCode"
allprojects {
@@ -66,4 +70,13 @@ subprojects {
mavenCentral()
google()
}
-}
+ afterEvaluate {
+ // Temporary hack for Android Studio
+ if (project.plugins.hasPlugin('com.android.base')) {
+ dependencies {
+ compileOnly "org.microg:safe-parcel:$safeParcelVersion"
+ testCompileOnly "org.microg:safe-parcel:$safeParcelVersion"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/fake-signature/build.gradle b/fake-signature/build.gradle
new file mode 100644
index 00000000..e04d9893
--- /dev/null
+++ b/fake-signature/build.gradle
@@ -0,0 +1,26 @@
+/*
+ * SPDX-FileCopyrightText: 2023 microG Project Team
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+apply plugin: 'com.android.library'
+
+android {
+ namespace "org.microg.signature.fake"
+
+ compileSdkVersion androidCompileSdk
+ buildToolsVersion androidBuildVersionTools
+
+ defaultConfig {
+ minSdkVersion androidMinSdk
+ targetSdkVersion androidTargetSdk
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+}
+
+dependencies {
+}
diff --git a/fake-signature/src/main/AndroidManifest.xml b/fake-signature/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..1b3ae15d
--- /dev/null
+++ b/fake-signature/src/main/AndroidManifest.xml
@@ -0,0 +1,1159 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/fake-signature/src/main/res/values/arrays.xml b/fake-signature/src/main/res/values/arrays.xml
new file mode 100644
index 00000000..315cce58
--- /dev/null
+++ b/fake-signature/src/main/res/values/arrays.xml
@@ -0,0 +1,15 @@
+
+
+
+
+ - com.google.android.gms
+ - com.android.vending
+ - com.spotify.music
+
+
+ - com.truecaller
+
+
\ No newline at end of file
diff --git a/play-services-core/src/main/res/values/signature.xml b/fake-signature/src/main/res/values/signature.xml
old mode 100755
new mode 100644
similarity index 56%
rename from play-services-core/src/main/res/values/signature.xml
rename to fake-signature/src/main/res/values/signature.xml
index df53f65c..282e0dc1
--- a/play-services-core/src/main/res/values/signature.xml
+++ b/fake-signature/src/main/res/values/signature.xml
@@ -1,21 +1,14 @@
-
-
+
308204433082032ba003020102020900c2e08746644a308d300d06092a864886f70d01010405003074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f6964301e170d3038303832313233313333345a170d3336303130373233313333345a3074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f696430820120300d06092a864886f70d01010105000382010d00308201080282010100ab562e00d83ba208ae0a966f124e29da11f2ab56d08f58e2cca91303e9b754d372f640a71b1dcb130967624e4656a7776a92193db2e5bfb724a91e77188b0e6a47a43b33d9609b77183145ccdf7b2e586674c9e1565b1f4c6a5955bff251a63dabf9c55c27222252e875e4f8154a645f897168c0b1bfc612eabf785769bb34aa7984dc7e2ea2764cae8307d8c17154d7ee5f64a51a44a602c249054157dc02cd5f5c0e55fbef8519fbe327f0b1511692c5a06f19d18385f5c4dbc2d6b93f68cc2979c70e18ab93866b3bd5db8999552a0e3b4c99df58fb918bedc182ba35e003c1b4b10dd244a8ee24fffd333872ab5221985edab0fc0d0b145b6aa192858e79020103a381d93081d6301d0603551d0e04160414c77d8cc2211756259a7fd382df6be398e4d786a53081a60603551d2304819e30819b8014c77d8cc2211756259a7fd382df6be398e4d786a5a178a4763074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f6964820900c2e08746644a308d300c0603551d13040530030101ff300d06092a864886f70d010104050003820101006dd252ceef85302c360aaace939bcff2cca904bb5d7a1661f8ae46b2994204d0ff4a68c7ed1a531ec4595a623ce60763b167297a7ae35712c407f208f0cb109429124d7b106219c084ca3eb3f9ad5fb871ef92269a8be28bf16d44c8d9a08e6cb2f005bb3fe2cb96447e868e731076ad45b33f6009ea19c161e62641aa99271dfd5228c5c587875ddb7f452758d661f6cc0cccb7352e424cc4365c523532f7325137593c4ae341f4db41edda0d0b1071a7c440f0fe9ea01cb627ca674369d084bd2fd911ff06cdbf2cfa10dc0f893ae35762919048c7efc64c7144178342f70581c9de573af55b390dd7fdb9418631895d5f759f30112687ff621410c069308a
+
+ 308202ed308201d5a003020102020426ffa009300d06092a864886f70d01010b05003027310b300906035504061302444531183016060355040a130f4e4f47415050532050726f6a656374301e170d3132313030363132303533325a170d3337303933303132303533325a3027310b300906035504061302444531183016060355040a130f4e4f47415050532050726f6a65637430820122300d06092a864886f70d01010105000382010f003082010a02820101009a8d2a5336b0eaaad89ce447828c7753b157459b79e3215dc962ca48f58c2cd7650df67d2dd7bda0880c682791f32b35c504e43e77b43c3e4e541f86e35a8293a54fb46e6b16af54d3a4eda458f1a7c8bc1b7479861ca7043337180e40079d9cdccb7e051ada9b6c88c9ec635541e2ebf0842521c3024c826f6fd6db6fd117c74e859d5af4db04448965ab5469b71ce719939a06ef30580f50febf96c474a7d265bb63f86a822ff7b643de6b76e966a18553c2858416cf3309dd24278374bdd82b4404ef6f7f122cec93859351fc6e5ea947e3ceb9d67374fe970e593e5cd05c905e1d24f5a5484f4aadef766e498adf64f7cf04bddd602ae8137b6eea40722d0203010001a321301f301d0603551d0e04160414110b7aa9ebc840b20399f69a431f4dba6ac42a64300d06092a864886f70d01010b0500038201010007c32ad893349cf86952fb5a49cfdc9b13f5e3c800aece77b2e7e0e9c83e34052f140f357ec7e6f4b432dc1ed542218a14835acd2df2deea7efd3fd5e8f1c34e1fb39ec6a427c6e6f4178b609b369040ac1f8844b789f3694dc640de06e44b247afed11637173f36f5886170fafd74954049858c6096308fc93c1bc4dd5685fa7a1f982a422f2a3b36baa8c9500474cf2af91c39cbec1bc898d10194d368aa5e91f1137ec115087c31962d8f76cd120d28c249cf76f4c70f5baa08c70a7234ce4123be080cee789477401965cfe537b924ef36747e8caca62dfefdd1a6288dcb1c4fd2aaa6131a7ad254e9742022cfd597d2ca5c660ce9e41ff537e5a4041e37
+
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 86630672..126b7d28 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,5 +1,5 @@
android.useAndroidX=true
-org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC
+org.gradle.jvmargs=-Xmx2048m -XX:+UseParallelGC
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
-android.nonFinalResIds=false
\ No newline at end of file
+android.nonFinalResIds=false
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 62d4c053..d64cd491 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e736c04d..0e1ae8ce 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
-#Thu Jun 29 16:45:22 ICT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-rc-3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 60cf9e8c..1aa94a42 100755
--- a/gradlew
+++ b/gradlew
@@ -1,6 +1,5 @@
#!/bin/sh
-# SPDX-License-Identifier: Apache-2.0
#
# Copyright © 2015-2021 the original authors.
#
@@ -56,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -81,13 +80,11 @@ do
esac
done
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
+# This is normally unused
+# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -128,26 +125,35 @@ if [ -n "$JAVA_HOME" ] ; then
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
+ fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -192,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
@@ -204,6 +214,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
@@ -230,4 +246,4 @@ eval "set -- $(
tr '\n' ' '
)" '"$@"'
-exec "$JAVACMD" "$@"
\ No newline at end of file
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 5093609d..93e3f59f 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
-@if "%DEBUG%" == "" @echo off
+@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
+if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +55,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-if exist "%JAVA_EXE%" goto init
+if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,21 +65,6 @@ echo location of your Java installation.
goto fail
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
:execute
@rem Setup the command line
@@ -86,17 +72,19 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
+if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle
index f78981e9..20d8bea5 100644
--- a/play-services-api/build.gradle
+++ b/play-services-api/build.gradle
@@ -17,8 +17,8 @@
apply plugin: 'com.android.library'
android {
- compileSdk androidCompileSdk
- buildToolsVersion '33.0.2'
+ compileSdkVersion androidCompileSdk
+ buildToolsVersion androidBuildVersionTools
defaultConfig {
minSdkVersion androidMinSdk
@@ -26,13 +26,13 @@ android {
}
compileOptions {
- sourceCompatibility = 1.8
- targetCompatibility = "1.8"
+ sourceCompatibility = 17
+ targetCompatibility = 17
}
- namespace 'org.microg.gms.api'
buildFeatures {
aidl true
}
+ namespace 'org.microg.gms.api'
}
dependencies {
diff --git a/play-services-api/src/main/AndroidManifest.xml b/play-services-api/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..359a9b71
--- /dev/null
+++ b/play-services-api/src/main/AndroidManifest.xml
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl
index ae33a334..d6afdf80 100644
--- a/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl
+++ b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl
@@ -7,7 +7,7 @@ import com.google.android.gms.auth.AccountChangeEventsResponse;
import com.google.android.gms.auth.AccountChangeEventsRequest;
import com.google.android.gms.auth.GetHubTokenRequest;
import com.google.android.gms.auth.GetHubTokenInternalResponse;
-import com.google.android.gms.auth.HasCababilitiesRequest;
+import com.google.android.gms.auth.HasCapabilitiesRequest;
interface IAuthManagerService {
Bundle getToken(String accountName, String scope, in Bundle extras) = 0;
@@ -18,6 +18,6 @@ interface IAuthManagerService {
Bundle getAccounts(in Bundle extras) = 5;
Bundle removeAccount(in Account account) = 6;
Bundle requestGoogleAccountsAccess(String packageName) = 7;
- int hasCapabilities(in HasCababilitiesRequest request) = 8;
+ int hasCapabilities(in HasCapabilitiesRequest request) = 8;
GetHubTokenInternalResponse getHubToken(in GetHubTokenRequest request, in Bundle extras) = 9;
}
diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/HasCababilitiesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/HasCapabilitiesRequest.aidl
similarity index 52%
rename from play-services-api/src/main/aidl/com/google/android/gms/auth/HasCababilitiesRequest.aidl
rename to play-services-api/src/main/aidl/com/google/android/gms/auth/HasCapabilitiesRequest.aidl
index c0c080cd..b6cb6b9d 100644
--- a/play-services-api/src/main/aidl/com/google/android/gms/auth/HasCababilitiesRequest.aidl
+++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/HasCapabilitiesRequest.aidl
@@ -1,3 +1,3 @@
package com.google.android.gms.auth;
-parcelable HasCababilitiesRequest;
+parcelable HasCapabilitiesRequest;
diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GoogleCertificatesQuery.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GoogleCertificatesQuery.aidl
deleted file mode 100644
index ae02e068..00000000
--- a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GoogleCertificatesQuery.aidl
+++ /dev/null
@@ -1,3 +0,0 @@
-package com.google.android.gms.common.internal;
-
-parcelable GoogleCertificatesQuery;
\ No newline at end of file
diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl
deleted file mode 100644
index da539f32..00000000
--- a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.google.android.gms.common.internal;
-
-import com.google.android.gms.common.internal.GoogleCertificatesQuery;
-import com.google.android.gms.dynamic.IObjectWrapper;
-
-interface IGoogleCertificatesApi {
- IObjectWrapper getGoogleCertficates();
- IObjectWrapper getGoogleReleaseCertificates();
- boolean isGoogleReleaseSigned(String packageName, IObjectWrapper certData);
- boolean isGoogleSigned(String packageName, IObjectWrapper certData);
- boolean isGoogleOrPlatformSigned(in GoogleCertificatesQuery query, IObjectWrapper packageManager);
-}
\ No newline at end of file
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java
index d9a19568..0485f3a2 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java
@@ -19,5 +19,5 @@ package com.google.android.gms.auth;
import org.microg.safeparcel.AutoSafeParcelable;
public class AccountChangeEvent extends AutoSafeParcelable {
- public static Creator CREATOR = new AutoCreator<>(AccountChangeEvent.class);
+ public static Creator CREATOR = new AutoCreator(AccountChangeEvent.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java
index cf8561df..1d404288 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java
@@ -21,18 +21,18 @@ import static org.microg.gms.auth.AuthConstants.DEFAULT_ACCOUNT_TYPE;
import android.accounts.Account;
import org.microg.safeparcel.AutoSafeParcelable;
+import org.microg.safeparcel.SafeParceled;
public class AccountChangeEventsRequest extends AutoSafeParcelable {
+ @Field(1)
+ private final int versionCode = 1;
+ @Field(2)
+ private int since;
@Field(3)
@Deprecated
- private final String accountName;
+ private String accountName;
@Field(4)
- private final Account account;
-
- public AccountChangeEventsRequest(String accountName, Account account) {
- this.accountName = accountName;
- this.account = account;
- }
+ private Account account;
public Account getAccount() {
if (account != null) return account;
@@ -40,6 +40,6 @@ public class AccountChangeEventsRequest extends AutoSafeParcelable {
return null;
}
- public static Creator CREATOR = new AutoCreator<>(AccountChangeEventsRequest.class);
+ public static Creator CREATOR = new AutoCreator(AccountChangeEventsRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java
index 10491379..763e5d42 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java
@@ -17,11 +17,20 @@
package com.google.android.gms.auth;
import org.microg.safeparcel.AutoSafeParcelable;
+import org.microg.safeparcel.SafeParceled;
+
+import java.util.ArrayList;
+import java.util.List;
public class AccountChangeEventsResponse extends AutoSafeParcelable {
+ @SafeParceled(1)
+ private final int versionCode = 1;
+ @SafeParceled(value = 2, subClass = AccountChangeEvent.class)
+ private final List events;
public AccountChangeEventsResponse() {
+ events = new ArrayList();
}
- public static Creator CREATOR = new AutoCreator<>(AccountChangeEventsResponse.class);
+ public static Creator CREATOR = new AutoCreator(AccountChangeEventsResponse.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenInternalResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenInternalResponse.java
index 4845ed41..ccecf291 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenInternalResponse.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenInternalResponse.java
@@ -5,10 +5,17 @@
package com.google.android.gms.auth;
+import android.accounts.Account;
+import android.content.Intent;
+
import org.microg.safeparcel.AutoSafeParcelable;
public class GetHubTokenInternalResponse extends AutoSafeParcelable {
+ @Field(1)
+ public TokenData tokenData;
@Field(2)
public String status;
+ @Field(3)
+ public Intent recoveryIntent;
public static final Creator CREATOR = new AutoCreator<>(GetHubTokenInternalResponse.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenRequest.java
index 2c4e973c..cdaffb51 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenRequest.java
@@ -14,5 +14,7 @@ public class GetHubTokenRequest extends AutoSafeParcelable {
public String service;
@Field(3)
public String packageName;
+ @Field(4)
+ public int callerUid;
public static final Creator CREATOR = new AutoCreator<>(GetHubTokenRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/HasCababilitiesRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/HasCapabilitiesRequest.java
similarity index 53%
rename from play-services-api/src/main/java/com/google/android/gms/auth/HasCababilitiesRequest.java
rename to play-services-api/src/main/java/com/google/android/gms/auth/HasCapabilitiesRequest.java
index c9907fa8..e35ca6d7 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/HasCababilitiesRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/HasCapabilitiesRequest.java
@@ -9,8 +9,10 @@ import android.accounts.Account;
import org.microg.safeparcel.AutoSafeParcelable;
-public class HasCababilitiesRequest extends AutoSafeParcelable {
+public class HasCapabilitiesRequest extends AutoSafeParcelable {
@Field(1)
public Account account;
- public static final Creator CREATOR = new AutoCreator<>(HasCababilitiesRequest.class);
+ @Field(2)
+ public String[] capabilities;
+ public static final Creator CREATOR = new AutoCreator<>(HasCapabilitiesRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java b/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java
index df3768c8..c6fbe9e5 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java
@@ -24,6 +24,8 @@ import org.microg.safeparcel.SafeParceled;
import java.util.List;
public class TokenData extends AutoSafeParcelable {
+ @SafeParceled(1)
+ private final int versionCode = 1;
@SafeParceled(2)
public final String token;
@@ -58,5 +60,5 @@ public class TokenData extends AutoSafeParcelable {
this.scopes = null;
}
- public static final Creator CREATOR = new AutoCreator<>(TokenData.class);
+ public static final Creator CREATOR = new AutoCreator(TokenData.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java
index 9ade5cc0..5a92ddc5 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java
@@ -9,17 +9,21 @@
package com.google.android.gms.auth.api.credentials;
import android.net.Uri;
+import android.text.TextUtils;
import org.microg.gms.common.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import java.util.Arrays;
import java.util.List;
-import java.util.Objects;
+import java.util.Locale;
@PublicApi
public class Credential extends AutoSafeParcelable {
+ @Field(1000)
+ private final int versionCode = 1;
+
@Field(1)
private String id;
@Field(2)
@@ -51,6 +55,13 @@ public class Credential extends AutoSafeParcelable {
return accountType;
}
+ /**
+ * Returns the generated password for an account hint.
+ */
+ public String getGeneratedPassword() {
+ return generatedPassword;
+ }
+
/**
* Returns the credential identifier, typically an email address or user name, though it may
* also be some encoded unique identifier for a federated identity account.
@@ -59,6 +70,23 @@ public class Credential extends AutoSafeParcelable {
return id;
}
+ /**
+ * Returns the ID tokens that assert the identity of the user, if available. ID tokens provide
+ * a secure mechanism to verify that the user owns the identity asserted by the credential.
+ *
+ * This is useful for account hints, where the ID token can replace the need to separately
+ * verify that the user owns their claimed email address - with a valid ID token, it is not
+ * necessary to send an account activation link to the address, simplifying the account
+ * creation process for the user.
+ *
+ * A signed ID token is returned automatically for credential hints when the credential ID is a
+ * Google account that is authenticated on the device. This ID token can be sent along with
+ * your application's account creation operation, where the signature can be verified.
+ */
+ public List getIdTokens() {
+ return tokens;
+ }
+
/**
* Returns the display name of the credential, if available. Typically, the display name will
* be the name of the user, or some other string which the user can easily recognize and
@@ -68,22 +96,47 @@ public class Credential extends AutoSafeParcelable {
return name;
}
+ /**
+ * Returns the password used to sign in the user.
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Returns the URL to an image of the user, if available.
+ */
+ public Uri getProfilePictureUri() {
+ return profilePictureUri;
+ }
+
+ @PublicApi(exclude = true)
+ public String getAsString() {
+ if (TextUtils.isEmpty(accountType)) {
+ return id.toLowerCase(Locale.US) + "|";
+ } else {
+ Uri uri = Uri.parse(accountType);
+ return id.toLowerCase(Locale.US) + "|" + (TextUtils.isEmpty(uri.getScheme()) ? "" : uri.getScheme().toLowerCase(Locale.US)) + "://" +
+ (TextUtils.isEmpty(uri.getHost()) ? "unknown" : uri.getHost().toLowerCase(Locale.US)) + ":" + uri.getPort();
+ }
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
- if (!(o instanceof Credential)) return false;
+ if (o == null || !(o instanceof Credential)) return false;
Credential that = (Credential) o;
- if (!Objects.equals(id, that.id)) return false;
- if (!Objects.equals(name, that.name)) return false;
- if (!Objects.equals(profilePictureUri, that.profilePictureUri))
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (name != null ? !name.equals(that.name) : that.name != null) return false;
+ if (profilePictureUri != null ? !profilePictureUri.equals(that.profilePictureUri) : that.profilePictureUri != null)
return false;
- if (!Objects.equals(password, that.password))
+ if (password != null ? !password.equals(that.password) : that.password != null)
return false;
- if (!Objects.equals(accountType, that.accountType))
+ if (accountType != null ? !accountType.equals(that.accountType) : that.accountType != null)
return false;
- return Objects.equals(generatedPassword, that.generatedPassword);
+ return generatedPassword != null ? generatedPassword.equals(that.generatedPassword) : that.generatedPassword == null;
}
@@ -95,14 +148,18 @@ public class Credential extends AutoSafeParcelable {
public static class Builder {
private final String id;
private String name;
- private final Uri profilePictureUri;
- private final String password;
+ private Uri profilePictureUri;
+ private String password;
private String accountType;
@PublicApi(exclude = true)
public List tokens;
@PublicApi(exclude = true)
- private final String generatedPassword;
+ private String generatedPassword;
+
+ public Builder(String id) {
+ this.id = id;
+ }
/**
* Copies the information stored in an existing credential, in order to allow that information to be modified.
@@ -154,7 +211,24 @@ public class Credential extends AutoSafeParcelable {
return this;
}
+ /**
+ * Sets the password for the credential. Either the password or the account type must be
+ * set for a credential, but not both.
+ */
+ public Builder setPassword(String password) {
+ this.password = password;
+ return this;
+ }
+
+ /**
+ * Sets a profile picture associated with the credential, typically a picture the user has
+ * selected to represent the account.
+ */
+ public Builder setProfilePictureUri(Uri profilePictureUri) {
+ this.profilePictureUri = profilePictureUri;
+ return this;
+ }
}
- public static final Creator CREATOR = new AutoCreator<>(Credential.class);
+ public static final Creator CREATOR = new AutoCreator(Credential.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java
index 41ca2191..4cb1bbc9 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java
@@ -8,20 +8,24 @@
package com.google.android.gms.auth.api.credentials;
-import androidx.annotation.NonNull;
-
import org.microg.gms.common.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
@PublicApi
public class CredentialPickerConfig extends AutoSafeParcelable {
+ @Field(1000)
+ private final int versionCode = 1;
+
@Field(1)
- private final boolean showAddAccountButton;
+ private boolean showAddAccountButton;
@Field(2)
- private final boolean showCancelButton;
+ private boolean showCancelButton;
@Field(3)
- private final boolean forNewAccount;
+ private boolean forNewAccount;
+
+ private CredentialPickerConfig() {
+ }
public CredentialPickerConfig(boolean showAddAccountButton, boolean showCancelButton, boolean forNewAccount) {
this.showAddAccountButton = showAddAccountButton;
@@ -37,7 +41,14 @@ public class CredentialPickerConfig extends AutoSafeParcelable {
return forNewAccount;
}
- @NonNull
+ public boolean shouldShowAddAccountButton() {
+ return showAddAccountButton;
+ }
+
+ public boolean shouldShowCancelButton() {
+ return showCancelButton;
+ }
+
@Override
public String toString() {
return "CredentialPickerConfig{" +
@@ -46,22 +57,39 @@ public class CredentialPickerConfig extends AutoSafeParcelable {
'}';
}
- public static class Builder {
- private final boolean showAddAccountButton;
- private final boolean showCancelButton;
- private final boolean forNewAccount;
-
- public Builder(boolean showAddAccountButton, boolean showCancelButton, boolean forNewAccount) {
- this.showAddAccountButton = showAddAccountButton;
- this.showCancelButton = showCancelButton;
- this.forNewAccount = forNewAccount;
- }
+ public class Builder {
+ private boolean showAddAccountButton;
+ private boolean showCancelButton;
+ private boolean forNewAccount;
public CredentialPickerConfig build() {
return new CredentialPickerConfig(showAddAccountButton, showCancelButton, forNewAccount);
}
+ /**
+ * Sets whether the hint request is for a new account sign-up flow.
+ */
+ public Builder setForNewAccount(boolean forNewAccount) {
+ this.forNewAccount = forNewAccount;
+ return this;
+ }
+
+ /**
+ * Sets whether the add account button should be shown in credential picker dialog.
+ */
+ public Builder setShowAddAccountButton(boolean showAddAccountButton) {
+ this.showAddAccountButton = showAddAccountButton;
+ return this;
+ }
+
+ /**
+ * Sets whether the cancel button should be shown in credential picker dialog.
+ */
+ public Builder setShowCancelButton(boolean showCancelButton) {
+ this.showCancelButton = showCancelButton;
+ return this;
+ }
}
- public static final Creator CREATOR = new AutoCreator<>(CredentialPickerConfig.class);
+ public static final Creator CREATOR = new AutoCreator(CredentialPickerConfig.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java
index c4961d14..6255fbf9 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java
@@ -10,13 +10,43 @@ package com.google.android.gms.auth.api.credentials;
import org.microg.safeparcel.AutoSafeParcelable;
+/**
+ * Parameters for requesting a Credential, via Auth.CredentialsApi.request(). Instances can be
+ * created using CredentialRequest.Builder.
+ */
public class CredentialRequest extends AutoSafeParcelable {
- @Field(1)
- private final boolean passwordLoginSupported;
+ @Field(1000)
+ private final int versionCode = 1;
- public CredentialRequest(boolean passwordLoginSupported) {
+ @Field(1)
+ private boolean passwordLoginSupported;
+ @Field(2)
+ private String[] accountTypes;
+ @Field(3)
+ private CredentialPickerConfig credentialPickerConfig;
+ @Field(4)
+ private CredentialPickerConfig credentialHintPickerConfig;
+
+ private CredentialRequest() { }
+
+ public CredentialRequest(boolean passwordLoginSupported, String[] accountTypes, CredentialPickerConfig credentialPickerConfig, CredentialPickerConfig credentialHintPickerConfig) {
this.passwordLoginSupported = passwordLoginSupported;
+ this.accountTypes = accountTypes;
+ this.credentialPickerConfig = credentialPickerConfig;
+ this.credentialHintPickerConfig = credentialHintPickerConfig;
+ }
+
+ public String[] getAccountTypes() {
+ return accountTypes;
+ }
+
+ public CredentialPickerConfig getCredentialHintPickerConfig() {
+ return credentialHintPickerConfig;
+ }
+
+ public CredentialPickerConfig getCredentialPickerConfig() {
+ return credentialPickerConfig;
}
/**
@@ -34,12 +64,13 @@ public class CredentialRequest extends AutoSafeParcelable {
public static final Creator CREATOR = new AutoCreator(CredentialRequest.class);
public static class Builder {
-
- public Builder() {
- }
+ private boolean passwordLoginSupported;
+ private String[] accountTypes;
+ private CredentialPickerConfig credentialPickerConfig;
+ private CredentialPickerConfig credentialHintPickerConfig;
public void setAccountTypes(String... accountTypes) {
- accountTypes.clone();
+ this.accountTypes = accountTypes.clone();
}
}
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/HintRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/HintRequest.java
index 3f9336f4..1f1cae80 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/HintRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/HintRequest.java
@@ -8,8 +8,6 @@
package com.google.android.gms.auth.api.credentials;
-import androidx.annotation.NonNull;
-
import org.microg.gms.common.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
@@ -21,21 +19,26 @@ import java.util.Arrays;
*/
@PublicApi
public class HintRequest extends AutoSafeParcelable {
+ @Field(1000)
+ private final int versionCode = 2;
@Field(1)
- private final CredentialPickerConfig hintPickerConfig;
+ private CredentialPickerConfig hintPickerConfig;
@Field(2)
- private final boolean emailAddressIdentifierSupported;
+ private boolean emailAddressIdentifierSupported;
@Field(3)
- private final boolean phoneNumberIdentifierSupported;
+ private boolean phoneNumberIdentifierSupported;
@Field(4)
- private final String[] accountTypes;
+ private String[] accountTypes;
@Field(5)
- private final boolean idTokenRequested;
+ private boolean idTokenRequested = true;
@Field(6)
- private final String serverClientId;
+ private String serverClientId;
@Field(7)
- private final String idTokenNonce;
+ private String idTokenNonce;
+
+ private HintRequest() {
+ }
public HintRequest(CredentialPickerConfig hintPickerConfig, boolean emailAddressIdentifierSupported, boolean phoneNumberIdentifierSupported, String[] accountTypes, boolean idTokenRequested, String serverClientId, String idTokenNonce) {
this.hintPickerConfig = hintPickerConfig;
@@ -47,9 +50,36 @@ public class HintRequest extends AutoSafeParcelable {
this.idTokenNonce = idTokenNonce;
}
+ public String[] getAccountTypes() {
+ return accountTypes;
+ }
+
+ public CredentialPickerConfig getHintPickerConfig() {
+ return hintPickerConfig;
+ }
+
+ public String getIdTokenNonce() {
+ return idTokenNonce;
+ }
+
+ public String getServerClientId() {
+ return serverClientId;
+ }
+
+ public boolean isEmailAddressIdentifierSupported() {
+ return emailAddressIdentifierSupported;
+ }
+
+ public boolean isPhoneNumberIdentifierSupported() {
+ return phoneNumberIdentifierSupported;
+ }
+
+ public boolean isIdTokenRequested() {
+ return idTokenRequested;
+ }
+
public static final Creator CREATOR = new AutoCreator<>(HintRequest.class);
- @NonNull
@Override
public String toString() {
return "HintRequest{" +
@@ -64,29 +94,77 @@ public class HintRequest extends AutoSafeParcelable {
}
public static class Builder {
- private final CredentialPickerConfig hintPickerConfig;
- private final boolean emailAddressIdentifierSupported;
- private final boolean phoneNumberIdentifierSupported;
- private final String[] accountTypes;
- private final String serverClientId;
- private final String idTokenNonce;
-
- public Builder(CredentialPickerConfig hintPickerConfig, boolean emailAddressIdentifierSupported, boolean phoneNumberIdentifierSupported, String[] accountTypes, String serverClientId, String idTokenNonce) {
- this.hintPickerConfig = hintPickerConfig;
- this.emailAddressIdentifierSupported = emailAddressIdentifierSupported;
- this.phoneNumberIdentifierSupported = phoneNumberIdentifierSupported;
- this.accountTypes = accountTypes;
- this.serverClientId = serverClientId;
- this.idTokenNonce = idTokenNonce;
- }
+ private CredentialPickerConfig hintPickerConfig;
+ private boolean emailAddressIdentifierSupported;
+ private boolean phoneNumberIdentifierSupported;
+ private String[] accountTypes;
+ private boolean idTokenRequested = true;
+ private String serverClientId;
+ private String idTokenNonce;
/**
* Builds a {@link HintRequest}.
*/
public HintRequest build() {
- boolean idTokenRequested = true;
return new HintRequest(hintPickerConfig, emailAddressIdentifierSupported, phoneNumberIdentifierSupported, accountTypes, idTokenRequested, serverClientId, idTokenNonce);
}
+ /**
+ * Sets the account types (identity providers) that are accepted by this application.
+ * It is strongly recommended that the strings listed in {@link IdentityProviders} be used for the most common
+ * identity providers, and strings representing the login domain of the identity provider be used for any
+ * others which are not listed.
+ *
+ * @param accountTypes The list of account types (identity providers) supported by the app.
+ * typically in the form of the associated login domain for each identity provider.
+ */
+ public void setAccountTypes(String... accountTypes) {
+ this.accountTypes = accountTypes.clone();
+ }
+
+ /**
+ * Enables returning {@link Credential} hints where the identifier is an email address, intended for use with a password chosen by the user.
+ */
+ public void setEmailAddressIdentifierSupported(boolean emailAddressIdentifierSupported) {
+ this.emailAddressIdentifierSupported = emailAddressIdentifierSupported;
+ }
+
+ /**
+ * Sets the configuration for the hint picker dialog.
+ */
+ public void setHintPickerConfig(CredentialPickerConfig hintPickerConfig) {
+ this.hintPickerConfig = hintPickerConfig;
+ }
+
+ /**
+ * Specify a nonce value that should be included in any generated ID token for this request.
+ */
+ public void setIdTokenNonce(String idTokenNonce) {
+ this.idTokenNonce = idTokenNonce;
+ }
+
+ /**
+ * Specify whether an ID token should be acquired for hints, if available for the selected credential identifier.
+ * This is enabled by default; disable this if your app does not use ID tokens as part of authentication to decrease latency in retrieving credentials and credential hints.
+ */
+ public void setIdTokenRequested(boolean idTokenRequested) {
+ this.idTokenRequested = idTokenRequested;
+ }
+
+ /**
+ * Enables returning {@link Credential} hints where the identifier is a phone number, intended for use with a password chosen by the user or SMS verification.
+ */
+ public void setPhoneNumberIdentifierSupported(boolean phoneNumberIdentifierSupported) {
+ this.phoneNumberIdentifierSupported = phoneNumberIdentifierSupported;
+ }
+
+ /**
+ * Specify the server client ID for the backend associated with this app.
+ * If a Google ID token can be generated for a retrieved credential or hint, and the specified server client ID is correctly configured to be associated with the app, then it will be used as the audience of the generated token.
+ * If a null value is specified, the default audience will be used for the generated ID token.
+ */
+ public void setServerClientId(String serverClientId) {
+ this.serverClientId = serverClientId;
+ }
}
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java
index 5d84423e..aa6d19d4 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java
@@ -14,11 +14,17 @@ import org.microg.safeparcel.AutoSafeParcelable;
@PublicApi
public class IdToken extends AutoSafeParcelable {
+ @Field(1000)
+ private final int versionCode = 1;
+
@Field(1)
- private final String accountType;
+ private String accountType;
@Field(2)
- private final String id;
+ private String id;
+
+ private IdToken() {
+ }
public IdToken(String accountType, String id) {
this.accountType = accountType;
@@ -32,5 +38,12 @@ public class IdToken extends AutoSafeParcelable {
return accountType;
}
- public static final Creator CREATOR = new AutoCreator<>(IdToken.class);
+ /**
+ * Returns the ID token, formatted according to the rules defined by the account type.
+ */
+ public String getIdToken() {
+ return id;
+ }
+
+ public static final Creator CREATOR = new AutoCreator(IdToken.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdentityProviders.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdentityProviders.java
index 1d974993..8cd24eed 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdentityProviders.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdentityProviders.java
@@ -8,8 +8,27 @@
package com.google.android.gms.auth.api.credentials;
+import android.accounts.Account;
+
/**
* Identity provider constants for use with {@link CredentialRequest.Builder#setAccountTypes(String...)}
*/
public final class IdentityProviders {
+ public static final String FACEBOOK = "//www.facebook.com";
+ public static final String GOOGLE = "//accounts.google.com";
+ public static final String LINKEDIN = "//www.linkedin.com";
+ public static final String MICROSOFT = "//login.live.com";
+ public static final String PAYPAL = "//www.paypal.com";
+ public static final String TWITTER = "//twitter.com";
+ public static final String YAHOO = "//login.yahoo.com";
+
+ /**
+ * Attempts to translate the account type in the provided account into the string that should be used in the credentials API.
+ *
+ * @param account an account on the device.
+ * @return The identity provider string for use with the Credentials API, or {@code null} if the account type is unknown.
+ */
+ public static String getIdentityProviderForAccount(Account account) {
+ return null;
+ }
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java
index e560ddc5..bd7ae6f2 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java
@@ -19,5 +19,5 @@ package com.google.android.gms.auth.api.credentials.internal;
import org.microg.safeparcel.AutoSafeParcelable;
public class DeleteRequest extends AutoSafeParcelable {
- public static final Creator CREATOR = new AutoCreator<>(DeleteRequest.class);
+ public static final Creator CREATOR = new AutoCreator(DeleteRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java
index 5fd6fcb7..3da7a72a 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java
@@ -19,5 +19,5 @@ package com.google.android.gms.auth.api.credentials.internal;
import org.microg.safeparcel.AutoSafeParcelable;
public class GeneratePasswordRequest extends AutoSafeParcelable {
- public static final Creator CREATOR = new AutoCreator<>(GeneratePasswordRequest.class);
+ public static final Creator CREATOR = new AutoCreator(GeneratePasswordRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java
index 24a9d92f..5ec25998 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java
@@ -19,5 +19,5 @@ package com.google.android.gms.auth.api.credentials.internal;
import org.microg.safeparcel.AutoSafeParcelable;
public class SaveRequest extends AutoSafeParcelable {
- public static final Creator CREATOR = new AutoCreator<>(SaveRequest.class);
+ public static final Creator CREATOR = new AutoCreator(SaveRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyRequest.java
index dc1fbd39..acca03a4 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyRequest.java
@@ -5,16 +5,33 @@
package com.google.android.gms.auth.api.proxy;
-import androidx.annotation.NonNull;
+import android.os.Bundle;
import org.microg.safeparcel.AutoSafeParcelable;
public class ProxyRequest extends AutoSafeParcelable {
+ public static final int HTTP_METHOD_GET = 0;
+ public static final int HTTP_METHOD_POST = 1;
+ public static final int HTTP_METHOD_PUT = 2;
+ public static final int HTTP_METHOD_DELETE = 3;
+ public static final int HTTP_METHOD_HEAD = 4;
+ public static final int HTTP_METHOD_OPTIONS = 5;
+ public static final int HTTP_METHOD_TRACE = 6;
+ public static final int HTTP_METHOD_PATCH = 7;
+ @Field(1000)
+ private final int versionCode = 2;
@Field(1)
public String url;
+ @Field(2)
+ public int httpMethod;
+ @Field(3)
+ public long timeoutMillis;
+ @Field(4)
+ public byte[] body;
+ @Field(5)
+ public Bundle headers;
- @NonNull
@Override
public String toString() {
return url;
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyResponse.java
index 263d2e20..b18d21be 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyResponse.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyResponse.java
@@ -5,11 +5,26 @@
package com.google.android.gms.auth.api.proxy;
+import android.app.PendingIntent;
+import android.os.Bundle;
+
import org.microg.safeparcel.AutoSafeParcelable;
public class ProxyResponse extends AutoSafeParcelable {
+ public static final int STATUS_CODE_NO_CONNECTION = -1;
+
+ @Field(1000)
+ private final int versionCode = 1;
@Field(1)
public int gmsStatusCode;
+ @Field(2)
+ public PendingIntent recoveryAction;
+ @Field(3)
+ public int httpStatusCode;
+ @Field(4)
+ public Bundle headers;
+ @Field(5)
+ public byte[] body;
public static final Creator CREATOR = new AutoCreator<>(ProxyResponse.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java
index 1c267ed1..d5f1d054 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java
@@ -24,6 +24,8 @@ import org.microg.safeparcel.SafeParceled;
public class AccountRecoveryGuidanceRequest extends AutoSafeParcelable {
+ @SafeParceled(1)
+ private final int versionCode = 1;
@SafeParceled(2)
@Deprecated
public final String accountName;
@@ -40,5 +42,5 @@ public class AccountRecoveryGuidanceRequest extends AutoSafeParcelable {
this.account = account;
}
- public static final Creator CREATOR = new AutoCreator<>(AccountRecoveryGuidanceRequest.class);
+ public static final Creator CREATOR = new AutoCreator(AccountRecoveryGuidanceRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java
index dc90a7d0..439825c2 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java
@@ -24,6 +24,8 @@ import org.microg.safeparcel.SafeParceled;
public class AccountRemovalRequest extends AutoSafeParcelable {
+ @SafeParceled(1)
+ private final int versionCode = 1;
@SafeParceled(2)
@Deprecated
public final String accountName;
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java
index 9edad8b2..16142d6a 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java
@@ -16,9 +16,19 @@
package com.google.android.gms.auth.firstparty.dataservice;
+import com.google.android.gms.auth.firstparty.shared.AccountCredentials;
+import com.google.android.gms.auth.firstparty.shared.CaptchaSolution;
+
import org.microg.safeparcel.AutoSafeParcelable;
+import org.microg.safeparcel.SafeParceled;
public class ConfirmCredentialsRequest extends AutoSafeParcelable {
+ @SafeParceled(1)
+ private final int versionCode = 1;
+ @SafeParceled(2)
+ public AccountCredentials accountCredentials;
+ @SafeParceled(3)
+ public CaptchaSolution captchaSolution;
- public static final Creator CREATOR = new AutoCreator<>(ConfirmCredentialsRequest.class);
+ public static final Creator CREATOR = new AutoCreator(ConfirmCredentialsRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java
index 73062668..099e56f4 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java
@@ -25,6 +25,8 @@ import org.microg.safeparcel.SafeParceled;
// TODO
public class TokenRequest extends AutoSafeParcelable{
+ @SafeParceled(1)
+ private final int versionCode = 4;
@SafeParceled(3)
public String accountName;
@SafeParceled(4)
@@ -38,5 +40,5 @@ public class TokenRequest extends AutoSafeParcelable{
return new Account(accountName, accountType);
}
- public static final Creator CREATOR = new AutoCreator<>(TokenRequest.class);
+ public static final Creator CREATOR = new AutoCreator(TokenRequest.class);
}
diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiClient.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java
similarity index 78%
rename from play-services-base/src/main/java/org/microg/gms/common/api/ApiClient.java
rename to play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java
index 602e150e..999e9a96 100644
--- a/play-services-base/src/main/java/org/microg/gms/common/api/ApiClient.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java
@@ -14,14 +14,7 @@
* limitations under the License.
*/
-package org.microg.gms.common.api;
+package com.google.android.gms.auth.firstparty.dataservice;
-public interface ApiClient {
- void connect();
-
- void disconnect();
-
- boolean isConnected();
-
- boolean isConnecting();
+public class TokenResponse {
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java
index b8e5ed63..d4308ef7 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java
@@ -17,18 +17,27 @@
package com.google.android.gms.auth.firstparty.delegate;
import android.accounts.Account;
+import android.accounts.AccountAuthenticatorResponse;
import android.os.Bundle;
+import com.google.android.gms.auth.firstparty.shared.AppDescription;
+
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
public class ConfirmCredentialsWorkflowRequest extends AutoSafeParcelable {
+ @SafeParceled(1)
+ private final int versionCode = 3;
@SafeParceled(2)
public String accountName;
+ @SafeParceled(3)
+ public AppDescription appDescription;
@SafeParceled(4)
public Bundle extras;
@SafeParceled(5)
public Account account;
+ @SafeParceled(6)
+ public AccountAuthenticatorResponse accountAuthenticatorResponse;
- public static final Creator CREATOR = new AutoCreator<>(ConfirmCredentialsWorkflowRequest.class);
+ public static final Creator CREATOR = new AutoCreator(ConfirmCredentialsWorkflowRequest.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java
new file mode 100644
index 00000000..139bf29b
--- /dev/null
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013-2017 microG Project Team
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.android.gms.auth.firstparty.proximity.data;
+
+public class Permit {
+}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java
index 67e7c7db..33995a9a 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java
@@ -23,6 +23,8 @@ import org.microg.safeparcel.SafeParceled;
// TODO
public class AccountCredentials extends AutoSafeParcelable {
+ @SafeParceled(1)
+ private final int versionCode = 2;
@SafeParceled(3)
public String accountName;
@SafeParceled(9)
@@ -32,5 +34,5 @@ public class AccountCredentials extends AutoSafeParcelable {
return new Account(accountName, accountType);
}
- public static final Creator CREATOR = new AutoCreator<>(AccountCredentials.class);
+ public static final Creator CREATOR = new AutoCreator(AccountCredentials.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java
index 1ccdf4f6..efa4b2bc 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java
@@ -17,8 +17,19 @@
package com.google.android.gms.auth.firstparty.shared;
import org.microg.safeparcel.AutoSafeParcelable;
+import org.microg.safeparcel.SafeParceled;
public class AppDescription extends AutoSafeParcelable {
+ @SafeParceled(1)
+ private final int versionCode = 1;
+ @SafeParceled(2)
+ public int callingUid;
+ @SafeParceled(3)
+ public String sessiondId;
+ @SafeParceled(4)
+ public String sessiondSig;
+ @SafeParceled(5)
+ public String callingPkg;
- public static final Creator CREATOR = new AutoCreator<>(AppDescription.class);
+ public static final Creator CREATOR = new AutoCreator(AppDescription.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java
index ce1d3f61..c0cb9326 100644
--- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java
+++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java
@@ -17,9 +17,13 @@
package com.google.android.gms.auth.firstparty.shared;
import org.microg.safeparcel.AutoSafeParcelable;
+import org.microg.safeparcel.SafeParceled;
// TODO
public class CaptchaSolution extends AutoSafeParcelable {
- public static final Creator CREATOR = new AutoCreator<>(CaptchaSolution.class);
+ @SafeParceled(1)
+ private final int versionCode = 1;
+
+ public static final Creator CREATOR = new AutoCreator(CaptchaSolution.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java
index d32e668b..6f10959a 100644
--- a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java
+++ b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java
@@ -20,5 +20,5 @@ import org.microg.safeparcel.AutoSafeParcelable;
public class FavaDiagnosticsEntity extends AutoSafeParcelable {
- public static final Creator CREATOR = new AutoCreator<>(FavaDiagnosticsEntity.class);
+ public static final Creator CREATOR = new AutoCreator(FavaDiagnosticsEntity.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java b/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java
new file mode 100644
index 00000000..d909cbf3
--- /dev/null
+++ b/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013-2017 microG Project Team
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.android.gms.identity.accounts.api;
+
+public class AccountData {
+}
diff --git a/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java
new file mode 100644
index 00000000..b9770e36
--- /dev/null
+++ b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013-2017 microG Project Team
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.android.gms.identity.intents.model;
+
+public class CountrySpecification {
+}
diff --git a/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java
new file mode 100644
index 00000000..aa3959f2
--- /dev/null
+++ b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2013-2017 microG Project Team
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.android.gms.identity.intents.model;
+
+public class UserAddress {
+}
diff --git a/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java b/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java
index 64322959..d0a7a742 100644
--- a/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java
+++ b/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java
@@ -17,8 +17,20 @@
package com.google.android.gms.people.internal;
import org.microg.safeparcel.AutoSafeParcelable;
+import org.microg.safeparcel.SafeParceled;
public class ParcelableLoadImageOptions extends AutoSafeParcelable {
+ @SafeParceled(1000)
+ private final int versionCode = 1;
- public static final Creator CREATOR = new AutoCreator<>(ParcelableLoadImageOptions.class);
+ @SafeParceled(1)
+ public int imageSize;
+
+ @SafeParceled(2)
+ public int avatarOptions;
+
+ @SafeParceled(3)
+ public boolean useLargePictureForCp2Images;
+
+ public static final Creator CREATOR = new AutoCreator(ParcelableLoadImageOptions.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java
index dfb64544..53038bbc 100644
--- a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java
+++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java
@@ -17,8 +17,24 @@
package com.google.android.gms.people.model;
import org.microg.safeparcel.AutoSafeParcelable;
+import org.microg.safeparcel.SafeParceled;
public class AccountMetadata extends AutoSafeParcelable {
- public static Creator CREATOR = new AutoCreator<>(AccountMetadata.class);
+ @SafeParceled(1)
+ private final int versionCode = 2;
+
+ @SafeParceled(2)
+ public boolean hasGooglePlus = true;
+
+ @SafeParceled(3)
+ public boolean hasFeature2 = true;
+
+ @SafeParceled(4)
+ public boolean hasFeature3 = true;
+
+ @SafeParceled(5)
+ public boolean hasFeature4 = true;
+
+ public static Creator CREATOR = new AutoCreator(AccountMetadata.class);
}
diff --git a/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java
index 6e3da8e2..b03af386 100644
--- a/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java
+++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java
@@ -17,11 +17,18 @@
package com.google.android.gms.people.model;
import org.microg.safeparcel.AutoSafeParcelable;
+import org.microg.safeparcel.SafeParceled;
public class AvatarReference extends AutoSafeParcelable {
- public static final Creator CREATOR = new AutoCreator<>(AvatarReference.class);
+ @SafeParceled(1000)
+ private int versionCode;
- public AvatarReference() {
- }
+ @SafeParceled(1)
+ public int source;
+
+ @SafeParceled(2)
+ public String location;
+
+ public static final Creator CREATOR = new AutoCreator(AvatarReference.class);
}
diff --git a/play-services-base-api/build.gradle b/play-services-base-api/build.gradle
index 59dc1be7..23b6b07c 100644
--- a/play-services-base-api/build.gradle
+++ b/play-services-base-api/build.gradle
@@ -34,11 +34,11 @@ android {
}
compileOptions {
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
+ sourceCompatibility = 17
+ targetCompatibility = 17
}
- namespace 'org.microg.gms.base.api'
buildFeatures {
aidl true
}
+ namespace 'org.microg.gms.base.api'
}
\ No newline at end of file
diff --git a/play-services-base-api/src/main/AndroidManifest.xml b/play-services-base-api/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..055d07d5
--- /dev/null
+++ b/play-services-base-api/src/main/AndroidManifest.xml
@@ -0,0 +1,6 @@
+
+
+
diff --git a/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java
index 77acbb1b..4af2bcf1 100644
--- a/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java
+++ b/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java
@@ -17,13 +17,16 @@
package com.google.android.gms.common.data;
import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.database.AbstractWindowedCursor;
+import android.database.CharArrayBuffer;
import android.database.Cursor;
import android.database.CursorWindow;
+import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
-import androidx.annotation.NonNull;
-
import org.microg.gms.common.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
@@ -42,6 +45,9 @@ import java.util.Map;
*/
@PublicApi(until = "1")
public class DataHolder extends AutoSafeParcelable implements Closeable {
+ @SafeParceled(1000)
+ private final int versionCode = 1;
+
@SafeParceled(1)
private final String[] columns;
@@ -63,6 +69,13 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
protected static final int FIELD_TYPE_STRING = 3;
protected static final int FIELD_TYPE_BLOB = 4;
+ private DataHolder() {
+ columns = null;
+ windows = null;
+ statusCode = 0;
+ metadata = null;
+ }
+
/**
* Creates a data holder with the specified data.
*
@@ -79,6 +92,17 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
validateContents();
}
+ /**
+ * Creates a data holder wrapping the provided cursor, with provided status code and metadata.
+ *
+ * @param cursor The cursor containing the data.
+ * @param statusCode The status code of this {@link DataHolder}.
+ * @param metadata The metadata associated with this {@link DataHolder} (may be null).
+ */
+ public DataHolder(AbstractWindowedCursor cursor, int statusCode, Bundle metadata) {
+ this(cursor.getColumnNames(), createCursorWindows(cursor), statusCode, metadata);
+ }
+
/**
* Creates a data holder wrapping the provided cursor, with provided status code and metadata.
*
@@ -94,10 +118,38 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
* Get a {@link DataHolder.Builder} to create a new {@link DataHolder} manually.
*
* @param columns The array of column names that the object supports.
+ * @param uniqueColumn The non-null column name that must contain unique values. New rows added to the builder with the same value in this column will replace any older rows.
+ * @return {@link DataHolder.Builder} object to work with.
+ */
+ public static Builder builder(String[] columns, String uniqueColumn) {
+ return new Builder(columns, uniqueColumn);
+ }
+
+ /**
+ * Get a {@link DataHolder.Builder} to create a new {@link DataHolder} manually.
+ *
+ * @param columns The array of column names that the object supports.
* @return {@link DataHolder.Builder} object to work with.
*/
public static Builder builder(String[] columns) {
- return new Builder(columns);
+ return builder(columns, null);
+ }
+
+ /**
+ * @param statusCode The status code of this {@link DataHolder}.
+ * @param metadata The metadata associated with this {@link DataHolder} (may be null).
+ * @return An empty {@link DataHolder} object with the given status and metadata.
+ */
+ public static DataHolder empty(int statusCode, Bundle metadata) {
+ return new DataHolder(new String[0], new CursorWindow[0], statusCode, metadata);
+ }
+
+ /**
+ * @param statusCode The status code of this {@link DataHolder}.
+ * @return An empty {@link DataHolder} object with the given status and null metadata.
+ */
+ public static DataHolder empty(int statusCode) {
+ return empty(statusCode, null);
}
@SuppressLint({"NewApi", "ObsoleteSdkInt"})
@@ -120,6 +172,20 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
}
}
+ /**
+ * Copies the String content in the given column at the provided position into a {@link CharArrayBuffer}.
+ * This will throw an {@link IllegalArgumentException} if the column does not exist, the
+ * position is invalid, or the data holder has been closed.
+ *
+ * @param column The column to retrieve.
+ * @param row The row to retrieve the data from.
+ * @param windowIndex Index of the cursor window to extract the data from.
+ * @param dataOut The {@link CharArrayBuffer} to copy into.
+ */
+ public void copyToBuffer(String column, int row, int windowIndex, CharArrayBuffer dataOut) {
+ throw new RuntimeException("Not yet available");
+ }
+
@SuppressWarnings("deprecation")
private static CursorWindow[] createCursorWindows(Builder builder) {
if (builder.columns.length == 0) return new CursorWindow[0];
@@ -212,6 +278,34 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
return windows.toArray(new CursorWindow[0]);
}
+ /**
+ * Retrieves the boolean value for a given column at the provided position.
+ * This will throw an {@link IllegalArgumentException} if the column does not exist, the
+ * position is invalid, or the data holder has been closed.
+ *
+ * @param column The column to retrieve.
+ * @param row The row to retrieve the data from.
+ * @param windowIndex Index of the cursor window to extract the data from.
+ * @return The boolean value in that column.
+ */
+ public boolean getBoolean(String column, int row, int windowIndex) {
+ return windows[windowIndex].getLong(row, columnIndices.get(column)) == 1;
+ }
+
+ /**
+ * Retrieves the byte array value for a given column at the provided position.
+ * This will throw an {@link IllegalArgumentException} if the column does not exist, the
+ * position is invalid, or the data holder has been closed.
+ *
+ * @param column The column to retrieve.
+ * @param row The row to retrieve the data from.
+ * @param windowIndex Index of the cursor window to extract the data from.
+ * @return The byte array value in that column.
+ */
+ public byte[] getByteArray(String column, int row, int windowIndex) {
+ return windows[windowIndex].getBlob(row, columnIndices.get(column));
+ }
+
/**
* Gets the number of rows in the data holder.
*
@@ -227,6 +321,38 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
return c;
}
+ /**
+ * Retrieves the integer value for a given column at the provided position.
+ * This will throw an {@link IllegalArgumentException} if the column does not exist, the
+ * position is invalid, or the data holder has been closed.
+ *
+ * @param column The column to retrieve.
+ * @param row The row to retrieve the data from.
+ * @param windowIndex Index of the cursor window to extract the data from.
+ * @return The integer value in that column.
+ */
+ public int getInteger(String column, int row, int windowIndex) {
+ return windows[windowIndex].getInt(row, columnIndices.get(column));
+ }
+
+ /**
+ * Retrieves the long value for a given column at the provided position.
+ * This will throw an {@link IllegalArgumentException} if the column does not exist, the
+ * position is invalid, or the data holder has been closed.
+ *
+ * @param column The column to retrieve.
+ * @param row The row to retrieve the data from.
+ * @param windowIndex Index of the cursor window to extract the data from.
+ * @return The long value in that column.
+ */
+ public long getLong(String column, int row, int windowIndex) {
+ return windows[windowIndex].getLong(row, columnIndices.get(column));
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
/**
* Retrieves the string value for a given column at the provided position.
* This will throw an {@link IllegalArgumentException} if the column does not exist, the
@@ -241,7 +367,42 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
return windows[windowIndex].getString(row, columnIndices.get(column));
}
- @NonNull
+ /**
+ * Returns whether the given column at the provided position contains null.
+ * This will throw an {@link IllegalArgumentException} if the column does not exist, the
+ * position is invalid, or the data holder has been closed.
+ *
+ * @param column The column to retrieve.
+ * @param row The row to retrieve the data from.
+ * @param windowIndex Index of the cursor window to extract the data from.
+ * @return Whether the column value is null at this position.
+ */
+ public boolean isNull(String column, int row, int windowIndex) {
+ return windows[windowIndex].isNull(row, columnIndices.get(column));
+ }
+
+ public boolean isClosed() {
+ synchronized (this) {
+ return closed;
+ }
+ }
+
+ /**
+ * Retrieves the column data at the provided position as a URI if possible, checking for null values.
+ * This will throw an {@link IllegalArgumentException} if the column does not exist, the
+ * position is invalid, or the data holder has been closed.
+ *
+ * @param column The column to retrieve.
+ * @param row The row to retrieve the data from.
+ * @param windowIndex Index of the cursor window to extract the data from.
+ * @return The column data as a URI, or null if not present.
+ */
+ public Uri parseUri(String column, int row, int windowIndex) {
+ String string = getString(column, row, windowIndex);
+ if (string != null) return Uri.parse(string);
+ return null;
+ }
+
@Override
public String toString() {
return "DataHolder{" +
@@ -267,10 +428,14 @@ public class DataHolder extends AutoSafeParcelable implements Closeable {
public static class Builder {
private final String[] columns;
private final ArrayList