temporary detele everything
This commit is contained in:
parent
6d8fe11006
commit
48f3d4a212
888 changed files with 0 additions and 68518 deletions
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "gradle-build-kotlin-error-matcher",
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^e:\\sfile:\/\/([^:]+):(\\d+):(\\d+)\\s(.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
SPDX-FileCopyrightText: none
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
16
.github/matchers/gradle-build-matcher.json
vendored
16
.github/matchers/gradle-build-matcher.json
vendored
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "gradle-build-matcher",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\s*([^:]+):(\\d+):\\s(error|Error):\\s(.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"severity": 3,
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
SPDX-FileCopyrightText: none
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
47
.github/workflows/build.yml
vendored
47
.github/workflows/build.yml
vendored
|
|
@ -1,47 +0,0 @@
|
|||
name: "Gradle build"
|
||||
permissions: {}
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
- workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "Gradle build"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: "Checkout sources"
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: "Setup Java"
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: "17"
|
||||
- name: "Gradle Wrapper validation"
|
||||
uses: gradle/wrapper-validation-action@v2
|
||||
- name: "Setup Gradle"
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
- name: "Setup matchers"
|
||||
run: |
|
||||
# Setting up matchers...
|
||||
|
||||
matchers_dir='${{ github.workspace }}/.github/matchers'
|
||||
matcher_list()
|
||||
{
|
||||
echo 'gradle-build-matcher.json'
|
||||
echo 'gradle-build-kotlin-error-matcher.json'
|
||||
}
|
||||
|
||||
matcher_list | while IFS='' read -r NAME; do
|
||||
if test -f "${matchers_dir:?}/${NAME:?}"; then
|
||||
echo "::add-matcher::${matchers_dir:?}/${NAME:?}"
|
||||
echo "Matcher configured: ${NAME:?}"
|
||||
fi
|
||||
done
|
||||
- name: "Execute Gradle assemble"
|
||||
run: "./gradlew --no-daemon assemble"
|
||||
- name: "Execute Gradle check"
|
||||
run: "./gradlew --no-daemon check"
|
||||
37
.github/workflows/debug.yml
vendored
37
.github/workflows/debug.yml
vendored
|
|
@ -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
|
||||
14
.gitignore
vendored
14
.gitignore
vendored
|
|
@ -1,14 +0,0 @@
|
|||
*.iml
|
||||
gen/
|
||||
bin/
|
||||
build/
|
||||
.gradle/
|
||||
.idea/
|
||||
user.gradle
|
||||
local.properties
|
||||
.directory
|
||||
play-services-core/release
|
||||
|
||||
.settings
|
||||
.classpath
|
||||
.project
|
||||
41
Android.mk
41
Android.mk
|
|
@ -1,41 +0,0 @@
|
|||
# Copyright (c) 2015 μg 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.
|
||||
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := GmsCore
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_PACKAGE_NAME := GmsCore
|
||||
|
||||
gmscore_root := $(LOCAL_PATH)
|
||||
gmscore_dir := play-services-core
|
||||
gmscore_out := $(TARGET_COMMON_OUT_ROOT)/obj/APPS/$(LOCAL_MODULE)_intermediates
|
||||
gmscore_build := $(gmscore_dir)/build
|
||||
gmscore_apk := $(gmscore_build)/outputs/apk/release/play-services-core-release-unsigned.apk
|
||||
|
||||
$(gmscore_root)/$(gmscore_apk):
|
||||
rm -Rf $(gmscore_root)/$(gmscore_build)
|
||||
mkdir -p $(ANDROID_BUILD_TOP)/$(gmscore_out)
|
||||
ln -s $(ANDROID_BUILD_TOP)/$(gmscore_out) $(ANDROID_BUILD_TOP)/$(gmscore_root)/$(gmscore_build)
|
||||
echo "sdk.dir=$(ANDROID_HOME)" > $(gmscore_root)/local.properties
|
||||
cd $(gmscore_root) && git submodule update --recursive --init
|
||||
cd $(gmscore_root)/$(gmscore_dir) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ../gradlew assembleRelease
|
||||
|
||||
LOCAL_CERTIFICATE := platform
|
||||
LOCAL_SRC_FILES := $(gmscore_apk)
|
||||
LOCAL_MODULE_CLASS := APPS
|
||||
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
|
||||
|
||||
include $(BUILD_PREBUILT)
|
||||
177
LICENSE
177
LICENSE
|
|
@ -1,177 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
|
@ -1,208 +0,0 @@
|
|||
Apache License
|
||||
|
||||
Version 2.0, January 2004
|
||||
|
||||
http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION,
|
||||
AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution
|
||||
as defined by Sections 1 through 9 of this document.
|
||||
|
||||
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
||||
owner that is granting the License.
|
||||
|
||||
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities
|
||||
that control, are controlled by, or are under common control with that entity.
|
||||
For the purposes of this definition, "control" means (i) the power, direct
|
||||
or indirect, to cause the direction or management of such entity, whether
|
||||
by contract or otherwise, or (ii) ownership of fifty percent (50%) or more
|
||||
of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions
|
||||
granted by this License.
|
||||
|
||||
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including
|
||||
but not limited to software source code, documentation source, and configuration
|
||||
files.
|
||||
|
||||
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation
|
||||
or translation of a Source form, including but not limited to compiled object
|
||||
code, generated documentation, and conversions to other media types.
|
||||
|
||||
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form,
|
||||
made available under the License, as indicated by a copyright notice that
|
||||
is included in or attached to the work (an example is provided in the Appendix
|
||||
below).
|
||||
|
||||
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form,
|
||||
that is based on (or derived from) the Work and for which the editorial revisions,
|
||||
annotations, elaborations, or other modifications represent, as a whole, an
|
||||
original work of authorship. For the purposes of this License, Derivative
|
||||
Works shall not include works that remain separable from, or merely link (or
|
||||
bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version
|
||||
of the Work and any modifications or additions to that Work or Derivative
|
||||
Works thereof, that is intentionally submitted to Licensor for inclusion in
|
||||
the Work by the copyright owner or by an individual or Legal Entity authorized
|
||||
to submit on behalf of the copyright owner. For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written communication
|
||||
sent to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems, and
|
||||
issue tracking systems that are managed by, or on behalf of, the Licensor
|
||||
for the purpose of discussing and improving the Work, but excluding communication
|
||||
that is conspicuously marked or otherwise designated in writing by the copyright
|
||||
owner as "Not a Contribution."
|
||||
|
||||
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
||||
of whom a Contribution has been received by Licensor and subsequently incorporated
|
||||
within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this
|
||||
License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
||||
no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
|
||||
Derivative Works of, publicly display, publicly perform, sublicense, and distribute
|
||||
the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
||||
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
||||
no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
||||
license to make, have made, use, offer to sell, sell, import, and otherwise
|
||||
transfer the Work, where such license applies only to those patent claims
|
||||
licensable by such Contributor that are necessarily infringed by their Contribution(s)
|
||||
alone or by combination of their Contribution(s) with the Work to which such
|
||||
Contribution(s) was submitted. If You institute patent litigation against
|
||||
any entity (including a cross-claim or counterclaim in a lawsuit) alleging
|
||||
that the Work or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses granted to You
|
||||
under this License for that Work shall terminate as of the date such litigation
|
||||
is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or
|
||||
Derivative Works thereof in any medium, with or without modifications, and
|
||||
in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or Derivative Works a copy
|
||||
of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices stating that
|
||||
You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works that You distribute,
|
||||
all copyright, patent, trademark, and attribution notices from the Source
|
||||
form of the Work, excluding those notices that do not pertain to any part
|
||||
of the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its distribution,
|
||||
then any Derivative Works that You distribute must include a readable copy
|
||||
of the attribution notices contained within such NOTICE file, excluding those
|
||||
notices that do not pertain to any part of the Derivative Works, in at least
|
||||
one of the following places: within a NOTICE text file distributed as part
|
||||
of the Derivative Works; within the Source form or documentation, if provided
|
||||
along with the Derivative Works; or, within a display generated by the Derivative
|
||||
Works, if and wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and do not modify the
|
||||
License. You may add Your own attribution notices within Derivative Works
|
||||
that You distribute, alongside or as an addendum to the NOTICE text from the
|
||||
Work, provided that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide
|
||||
additional or different license terms and conditions for use, reproduction,
|
||||
or distribution of Your modifications, or for any such Derivative Works as
|
||||
a whole, provided Your use, reproduction, and distribution of the Work otherwise
|
||||
complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
||||
Contribution intentionally submitted for inclusion in the Work by You to the
|
||||
Licensor shall be under the terms and conditions of this License, without
|
||||
any additional terms or conditions. Notwithstanding the above, nothing herein
|
||||
shall supersede or modify the terms of any separate license agreement you
|
||||
may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names,
|
||||
trademarks, service marks, or product names of the Licensor, except as required
|
||||
for reasonable and customary use in describing the origin of the Work and
|
||||
reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to
|
||||
in writing, Licensor provides the Work (and each Contributor provides its
|
||||
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied, including, without limitation, any warranties
|
||||
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness
|
||||
of using or redistributing the Work and assume any risks associated with Your
|
||||
exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether
|
||||
in tort (including negligence), contract, or otherwise, unless required by
|
||||
applicable law (such as deliberate and grossly negligent acts) or agreed to
|
||||
in writing, shall any Contributor be liable to You for damages, including
|
||||
any direct, indirect, special, incidental, or consequential damages of any
|
||||
character arising as a result of this License or out of the use or inability
|
||||
to use the Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all other commercial
|
||||
damages or losses), even if such Contributor has been advised of the possibility
|
||||
of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work
|
||||
or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
||||
acceptance of support, warranty, indemnity, or other liability obligations
|
||||
and/or rights consistent with this License. However, in accepting such obligations,
|
||||
You may act only on Your own behalf and on Your sole responsibility, not on
|
||||
behalf of any other Contributor, and only if You agree to indemnify, defend,
|
||||
and hold each Contributor harmless for any liability incurred by, or claims
|
||||
asserted against, such Contributor by reason of your accepting any such warranty
|
||||
or additional liability. END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate
|
||||
notice, with the fields enclosed by brackets "[]" replaced with your own identifying
|
||||
information. (Don't include the brackets!) The text should be enclosed in
|
||||
the appropriate comment syntax for the file format. We also recommend that
|
||||
a file or class name and description of purpose be included on the same "printed
|
||||
page" as the copyright notice for easier identification within third-party
|
||||
archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
|
|
@ -1,324 +0,0 @@
|
|||
Creative Commons Attribution 4.0 International Creative Commons Corporation
|
||||
("Creative Commons") is not a law firm and does not provide legal services
|
||||
or legal advice. Distribution of Creative Commons public licenses does not
|
||||
create a lawyer-client or other relationship. Creative Commons makes its licenses
|
||||
and related information available on an "as-is" basis. Creative Commons gives
|
||||
no warranties regarding its licenses, any material licensed under their terms
|
||||
and conditions, or any related information. Creative Commons disclaims all
|
||||
liability for damages resulting from their use to the fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and conditions
|
||||
that creators and other rights holders may use to share original works of
|
||||
authorship and other material subject to copyright and certain other rights
|
||||
specified in the public license below. The following considerations are for
|
||||
informational purposes only, are not exhaustive, and do not form part of our
|
||||
licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are intended for use by
|
||||
those authorized to give the public permission to use material in ways otherwise
|
||||
restricted by copyright and certain other rights. Our licenses are irrevocable.
|
||||
Licensors should read and understand the terms and conditions of the license
|
||||
they choose before applying it. Licensors should also secure all rights necessary
|
||||
before applying our licenses so that the public can reuse the material as
|
||||
expected. Licensors should clearly mark any material not subject to the license.
|
||||
This includes other CC-licensed material, or material used under an exception
|
||||
or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public licenses, a licensor
|
||||
grants the public permission to use the licensed material under specified
|
||||
terms and conditions. If the licensor's permission is not necessary for any
|
||||
reason–for example, because of any applicable exception or limitation to copyright–then
|
||||
that use is not regulated by the license. Our licenses grant only permissions
|
||||
under copyright and certain other rights that a licensor has authority to
|
||||
grant. Use of the licensed material may still be restricted for other reasons,
|
||||
including because others have copyright or other rights in the material. A
|
||||
licensor may make special requests, such as asking that all changes be marked
|
||||
or described. Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations for the public
|
||||
: wiki.creativecommons.org/Considerations_for_licensees Creative Commons Attribution
|
||||
4.0 International Public License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree to
|
||||
be bound by the terms and conditions of this Creative Commons Attribution
|
||||
4.0 International Public License ("Public License"). To the extent this Public
|
||||
License may be interpreted as a contract, You are granted the Licensed Rights
|
||||
in consideration of Your acceptance of these terms and conditions, and the
|
||||
Licensor grants You such rights in consideration of benefits the Licensor
|
||||
receives from making the Licensed Material available under these terms and
|
||||
conditions.
|
||||
|
||||
Section 1 – Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar Rights
|
||||
that is derived from or based upon the Licensed Material and in which the
|
||||
Licensed Material is translated, altered, arranged, transformed, or otherwise
|
||||
modified in a manner requiring permission under the Copyright and Similar
|
||||
Rights held by the Licensor. For purposes of this Public License, where the
|
||||
Licensed Material is a musical work, performance, or sound recording, Adapted
|
||||
Material is always produced where the Licensed Material is synched in timed
|
||||
relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright and Similar
|
||||
Rights in Your contributions to Adapted Material in accordance with the terms
|
||||
and conditions of this Public License.
|
||||
|
||||
c. Copyright and Similar Rights means copyright and/or similar rights closely
|
||||
related to copyright including, without limitation, performance, broadcast,
|
||||
sound recording, and Sui Generis Database Rights, without regard to how the
|
||||
rights are labeled or categorized. For purposes of this Public License, the
|
||||
rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
||||
|
||||
d. Effective Technological Measures means those measures that, in the absence
|
||||
of proper authority, may not be circumvented under laws fulfilling obligations
|
||||
under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996,
|
||||
and/or similar international agreements.
|
||||
|
||||
e. Exceptions and Limitations means fair use, fair dealing, and/or any other
|
||||
exception or limitation to Copyright and Similar Rights that applies to Your
|
||||
use of the Licensed Material.
|
||||
|
||||
f. Licensed Material means the artistic or literary work, database, or other
|
||||
material to which the Licensor applied this Public License.
|
||||
|
||||
g. Licensed Rights means the rights granted to You subject to the terms and
|
||||
conditions of this Public License, which are limited to all Copyright and
|
||||
Similar Rights that apply to Your use of the Licensed Material and that the
|
||||
Licensor has authority to license.
|
||||
|
||||
h. Licensor means the individual(s) or entity(ies) granting rights under this
|
||||
Public License.
|
||||
|
||||
i. Share means to provide material to the public by any means or process that
|
||||
requires permission under the Licensed Rights, such as reproduction, public
|
||||
display, public performance, distribution, dissemination, communication, or
|
||||
importation, and to make material available to the public including in ways
|
||||
that members of the public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
j. Sui Generis Database Rights means rights other than copyright resulting
|
||||
from Directive 96/9/EC of the European Parliament and of the Council of 11
|
||||
March 1996 on the legal protection of databases, as amended and/or succeeded,
|
||||
as well as other essentially equivalent rights anywhere in the world.
|
||||
|
||||
k. You means the individual or entity exercising the Licensed Rights under
|
||||
this Public License. Your has a corresponding meaning.
|
||||
|
||||
Section 2 – Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License, the Licensor
|
||||
hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive,
|
||||
irrevocable license to exercise the Licensed Rights in the Licensed Material
|
||||
to:
|
||||
|
||||
A. reproduce and Share the Licensed Material, in whole or in part; and
|
||||
|
||||
B. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions
|
||||
and Limitations apply to Your use, this Public License does not apply, and
|
||||
You do not need to comply with its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section 6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The Licensor authorizes
|
||||
You to exercise the Licensed Rights in all media and formats whether now known
|
||||
or hereafter created, and to make technical modifications necessary to do
|
||||
so. The Licensor waives and/or agrees not to assert any right or authority
|
||||
to forbid You from making technical modifications necessary to exercise the
|
||||
Licensed Rights, including technical modifications necessary to circumvent
|
||||
Effective Technological Measures. For purposes of this Public License, simply
|
||||
making modifications authorized by this Section 2(a)(4) never produces Adapted
|
||||
Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed
|
||||
Material automatically receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this Public License.
|
||||
|
||||
B. No downstream restrictions. You may not offer or impose any additional
|
||||
or different terms or conditions on, or apply any Effective Technological
|
||||
Measures to, the Licensed Material if doing so restricts exercise of the Licensed
|
||||
Rights by any recipient of the Licensed Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or may be construed
|
||||
as permission to assert or imply that You are, or that Your use of the Licensed
|
||||
Material is, connected with, or sponsored, endorsed, or granted official status
|
||||
by, the Licensor or others designated to receive attribution as provided in
|
||||
Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not licensed under this
|
||||
Public License, nor are publicity, privacy, and/or other similar personality
|
||||
rights; however, to the extent possible, the Licensor waives and/or agrees
|
||||
not to assert any such rights held by the Licensor to the limited extent necessary
|
||||
to allow You to exercise the Licensed Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to collect royalties
|
||||
from You for the exercise of the Licensed Rights, whether directly or through
|
||||
a collecting society under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly reserves any right
|
||||
to collect such royalties.
|
||||
|
||||
Section 3 – License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the following
|
||||
conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified form), You must:
|
||||
|
||||
A. retain the following if it is supplied by the Licensor with the Licensed
|
||||
Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed Material and any others
|
||||
designated to receive attribution, in any reasonable manner requested by the
|
||||
Licensor (including by pseudonym if designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
||||
|
||||
B. indicate if You modified the Licensed Material and retain an indication
|
||||
of any previous modifications; and
|
||||
|
||||
C. indicate the Licensed Material is licensed under this Public License, and
|
||||
include the text of, or the URI or hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner
|
||||
based on the medium, means, and context in which You Share the Licensed Material.
|
||||
For example, it may be reasonable to satisfy the conditions by providing a
|
||||
URI or hyperlink to a resource that includes the required information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the information required
|
||||
by Section 3(a)(1)(A) to the extent reasonably practicable.
|
||||
|
||||
4. If You Share Adapted Material You produce, the Adapter's License You apply
|
||||
must not prevent recipients of the Adapted Material from complying with this
|
||||
Public License.
|
||||
|
||||
Section 4 – Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that apply to
|
||||
Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract,
|
||||
reuse, reproduce, and Share all or a substantial portion of the contents of
|
||||
the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database contents in
|
||||
a database in which You have Sui Generis Database Rights, then the database
|
||||
in which You have Sui Generis Database Rights (but not its individual contents)
|
||||
is Adapted Material; and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share all or
|
||||
a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not replace
|
||||
Your obligations under this Public License where the Licensed Rights include
|
||||
other Copyright and Similar Rights.
|
||||
|
||||
Section 5 – Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. Unless otherwise separately undertaken by the Licensor, to the extent possible,
|
||||
the Licensor offers the Licensed Material as-is and as-available, and makes
|
||||
no representations or warranties of any kind concerning the Licensed Material,
|
||||
whether express, implied, statutory, or other. This includes, without limitation,
|
||||
warranties of title, merchantability, fitness for a particular purpose, non-infringement,
|
||||
absence of latent or other defects, accuracy, or the presence or absence of
|
||||
errors, whether or not known or discoverable. Where disclaimers of warranties
|
||||
are not allowed in full or in part, this disclaimer may not apply to You.
|
||||
|
||||
b. To the extent possible, in no event will the Licensor be liable to You
|
||||
on any legal theory (including, without limitation, negligence) or otherwise
|
||||
for any direct, special, indirect, incidental, consequential, punitive, exemplary,
|
||||
or other losses, costs, expenses, or damages arising out of this Public License
|
||||
or use of the Licensed Material, even if the Licensor has been advised of
|
||||
the possibility of such losses, costs, expenses, or damages. Where a limitation
|
||||
of liability is not allowed in full or in part, this limitation may not apply
|
||||
to You.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided above
|
||||
shall be interpreted in a manner that, to the extent possible, most closely
|
||||
approximates an absolute disclaimer and waiver of all liability.
|
||||
|
||||
Section 6 – Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and Similar Rights
|
||||
licensed here. However, if You fail to comply with this Public License, then
|
||||
Your rights under this Public License terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under Section
|
||||
6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided it is cured
|
||||
within 30 days of Your discovery of the violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
c. For the avoidance of doubt, this Section 6(b) does not affect any right
|
||||
the Licensor may have to seek remedies for Your violations of this Public
|
||||
License.
|
||||
|
||||
d. For the avoidance of doubt, the Licensor may also offer the Licensed Material
|
||||
under separate terms or conditions or stop distributing the Licensed Material
|
||||
at any time; however, doing so will not terminate this Public License.
|
||||
|
||||
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
||||
|
||||
Section 7 – Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different terms or
|
||||
conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the Licensed
|
||||
Material not stated herein are separate from and independent of the terms
|
||||
and conditions of this Public License.
|
||||
|
||||
Section 8 – Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and shall not
|
||||
be interpreted to, reduce, limit, restrict, or impose conditions on any use
|
||||
of the Licensed Material that could lawfully be made without permission under
|
||||
this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is deemed
|
||||
unenforceable, it shall be automatically reformed to the minimum extent necessary
|
||||
to make it enforceable. If the provision cannot be reformed, it shall be severed
|
||||
from this Public License without affecting the enforceability of the remaining
|
||||
terms and conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no failure
|
||||
to comply consented to unless expressly agreed to by the Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted as a limitation
|
||||
upon, or waiver of, any privileges and immunities that apply to the Licensor
|
||||
or You, including from the legal processes of any jurisdiction or authority.
|
||||
|
||||
Creative Commons is not a party to its public licenses. Notwithstanding, Creative
|
||||
Commons may elect to apply one of its public licenses to material it publishes
|
||||
and in those instances will be considered the "Licensor." The text of the
|
||||
Creative Commons public licenses is dedicated to the public domain under the
|
||||
CC0 Public Domain Dedication. Except for the limited purpose of indicating
|
||||
that material is shared under a Creative Commons public license or as otherwise
|
||||
permitted by the Creative Commons policies published at creativecommons.org/policies,
|
||||
Creative Commons does not authorize the use of the trademark "Creative Commons"
|
||||
or any other trademark or logo of Creative Commons without its prior written
|
||||
consent including, without limitation, in connection with any unauthorized
|
||||
modifications to any of its public licenses or any other arrangements, understandings,
|
||||
or agreements concerning use of licensed material. For the avoidance of doubt,
|
||||
this paragraph does not form part of the public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
Creative Commons Legal Code
|
||||
|
||||
CC0 1.0 Universal
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||
HEREUNDER.
|
||||
|
||||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for
|
||||
the purpose of contributing to a commons of creative, cultural and
|
||||
scientific works ("Commons") that the public can reliably and without fear
|
||||
of later claims of infringement build upon, modify, incorporate in other
|
||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||
and for any purposes, including without limitation commercial purposes.
|
||||
These owners may contribute to the Commons to promote the ideal of a free
|
||||
culture and the further production of creative, cultural and scientific
|
||||
works, or to gain reputation or greater distribution for their Work in
|
||||
part through the use and efforts of others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any
|
||||
expectation of additional consideration or compensation, the person
|
||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
136
build.gradle
136
build.gradle
|
|
@ -1,136 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2013, microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
<<<<<<< HEAD
|
||||
ext.kotlinVersion = '1.8.20'
|
||||
ext.coroutineVersion = '1.6.4'
|
||||
|
||||
ext.annotationVersion = '1.6.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.navigationVersion = '2.5.3'
|
||||
ext.preferenceVersion = '1.2.0'
|
||||
ext.webkitVersion = '1.6.0'
|
||||
=======
|
||||
ext.cronetVersion = '102.5005.125'
|
||||
ext.wearableVersion = '0.1.1'
|
||||
|
||||
ext.kotlinVersion = '1.9.22'
|
||||
ext.coroutineVersion = '1.7.3'
|
||||
|
||||
ext.annotationVersion = '1.7.1'
|
||||
ext.appcompatVersion = '1.6.1'
|
||||
ext.biometricVersion = '1.1.0'
|
||||
ext.coreVersion = '1.12.0'
|
||||
ext.fragmentVersion = '1.6.2'
|
||||
ext.lifecycleVersion = '2.7.0'
|
||||
ext.loaderVersion = '1.1.0'
|
||||
ext.materialVersion = '1.11.0'
|
||||
ext.mediarouterVersion = '1.6.0'
|
||||
ext.multidexVersion = '2.0.1'
|
||||
ext.navigationVersion = '2.7.7'
|
||||
ext.preferenceVersion = '1.2.0'
|
||||
ext.recyclerviewVersion = '1.3.2'
|
||||
ext.webkitVersion = '1.10.0'
|
||||
>>>>>>> 48e0b00a (Update build tools and dependencies)
|
||||
|
||||
ext.circleimageviewVersion = '3.1.0'
|
||||
ext.volleyVersion = '1.2.1'
|
||||
ext.wireVersion = '4.5.5'
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
ext.androidBuildGradleVersion = '8.0.0'
|
||||
ext.androidBuildVersionTools = '33.0.2'
|
||||
|
||||
ext.androidMinSdk = 23
|
||||
ext.androidTargetSdk = 30
|
||||
ext.androidCompileSdk = 33
|
||||
=======
|
||||
ext.androidBuildGradleVersion = '8.2.2'
|
||||
|
||||
ext.androidBuildVersionTools = '34.0.0'
|
||||
|
||||
ext.androidMinSdk = 19
|
||||
ext.androidTargetSdk = 29
|
||||
ext.androidCompileSdk = 34
|
||||
>>>>>>> 48e0b00a (Update build tools and dependencies)
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.0.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
def gmsVersion = "24.10.17"
|
||||
=======
|
||||
def gmsVersion = "24.09.13"
|
||||
>>>>>>> ef113281 (Bump GMS version to 24.09.13 (#2191))
|
||||
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
|
||||
<<<<<<< HEAD
|
||||
|
||||
def ourVersionBase = "0.3.0"
|
||||
|
||||
def ourVersionCode = gmsVersionCode * 1000
|
||||
def ourVersionName = "$ourVersionBase.$gmsVersionCode"
|
||||
=======
|
||||
def vendingVersion = "40.2.26"
|
||||
def vendingVersionCode = Integer.parseInt(vendingVersion.replaceAll('\\.', ''))
|
||||
def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').trim().substring(1)
|
||||
def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD").trim())
|
||||
def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').trim().split(' ')[0]
|
||||
def gitDirty = false
|
||||
execResult('git', 'status', '--porcelain').lines().each { stat ->
|
||||
def status = stat.substring(0,2)
|
||||
def file = stat.substring(3)
|
||||
if (status == '??') {
|
||||
if (subprojects.any { p -> file.startsWith(p.name + '/') }) {
|
||||
logger.lifecycle('Dirty file: {} (untracked)', file)
|
||||
gitDirty = true
|
||||
} else {
|
||||
logger.info('New file outside module: {} (ignored for dirty check)', file)
|
||||
}
|
||||
} else {
|
||||
logger.lifecycle('Dirty file: {} (changed)', file)
|
||||
gitDirty = true
|
||||
}
|
||||
}
|
||||
def ourVersionBase = gitVersionBase.substring(0, gitVersionBase.lastIndexOf('.'))
|
||||
def ourVersionMinor = Integer.parseInt(ourVersionBase.substring(ourVersionBase.lastIndexOf('.') + 1))
|
||||
def ourGmsVersionCode = gmsVersionCode * 1000 + ourVersionMinor * 2 + (gitCommitCount > 0 || gitDirty ? 1 : 0)
|
||||
def ourGmsVersionName = "$ourVersionBase.$gmsVersionCode" + (gitCommitCount > 0 && !gitDirty ? "-$gitCommitCount" : "") + (gitDirty ? "-dirty" : "") + (gitCommitCount > 0 && !gitDirty ? " ($gitCommitId)" : "")
|
||||
def ourVendingVersionCode = 80000000 + vendingVersionCode * 100 + ourVersionMinor * 2 + (gitCommitCount > 0 || gitDirty ? 1 : 0)
|
||||
def ourVendingVersionName = "$ourVersionBase.$vendingVersionCode" + (gitCommitCount > 0 && !gitDirty ? "-$gitCommitCount" : "") + (gitDirty ? "-dirty" : "") + (gitCommitCount > 0 && !gitDirty ? " ($gitCommitId)" : "")
|
||||
logger.lifecycle('Starting build for GMS version {} ({})...', ourGmsVersionName, ourGmsVersionCode)
|
||||
>>>>>>> 33109df6 (Bump Companion version)
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'idea'
|
||||
|
||||
group = 'org.microg.gms'
|
||||
version = ourVersionName
|
||||
ext.appVersionCode = ourVersionCode
|
||||
ext.isReleaseVersion = false
|
||||
}
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.huawei.signature.diff;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.util.Log;
|
||||
import org.microg.signature.fake.R;
|
||||
|
||||
public class AppListDatabaseOpenHelper extends SQLiteOpenHelper {
|
||||
private static final String TAG = AppListDatabaseOpenHelper.class.getSimpleName();
|
||||
private static final String DATABASE_NAME = "app_list.db";
|
||||
public static final String TABLE_APPLIST = "applist";
|
||||
public static final String COLUMN_NAME = "name";
|
||||
public static final String COLUMN_FAKE = "fake";
|
||||
private static final int DATABASE_VERSION = 3;
|
||||
private static final String DROP_APP_LIST_TABLE = "DROP TABLE IF EXISTS " + TABLE_APPLIST;
|
||||
private static final String CREATE_APP_LIST_TABLE = "CREATE TABLE IF NOT EXISTS " + TABLE_APPLIST + "(" +
|
||||
COLUMN_NAME + " VARCHAR(255) PRIMARY KEY, " +
|
||||
COLUMN_FAKE + " INTEGER CHECK(" + COLUMN_FAKE + " >= 0 and " + COLUMN_FAKE + " <= 1)" +
|
||||
")";
|
||||
private final Context context;
|
||||
|
||||
public AppListDatabaseOpenHelper(Context context) {
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
Log.d(TAG, "onCreate");
|
||||
db.execSQL(DROP_APP_LIST_TABLE);
|
||||
db.execSQL(CREATE_APP_LIST_TABLE);
|
||||
initData(db);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen(SQLiteDatabase db) {
|
||||
super.onOpen(db);
|
||||
if (!db.isReadOnly()) {
|
||||
initData(db);
|
||||
}
|
||||
}
|
||||
|
||||
private void initData(SQLiteDatabase db) {
|
||||
String[] wantFakeApps = context.getResources().getStringArray(R.array.signature_want_fake);
|
||||
String[] neverFakeApps = context.getResources().getStringArray(R.array.signature_never_fake);
|
||||
if (wantFakeApps.length == 0 && neverFakeApps.length == 0) {
|
||||
return;
|
||||
}
|
||||
for (String app : wantFakeApps) {
|
||||
db.insertWithOnConflict(TABLE_APPLIST, null, generateValues(app, true), SQLiteDatabase.CONFLICT_REPLACE);
|
||||
}
|
||||
for (String app : neverFakeApps) {
|
||||
db.insertWithOnConflict(TABLE_APPLIST, null, generateValues(app, false), SQLiteDatabase.CONFLICT_REPLACE);
|
||||
}
|
||||
}
|
||||
|
||||
private ContentValues generateValues(String packageName, boolean fake) {
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put(COLUMN_NAME, packageName);
|
||||
contentValues.put(COLUMN_FAKE, fake ? 1 : 0);
|
||||
return contentValues;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
onCreate(db);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string-array name="signature_want_fake">
|
||||
<item>com.google.android.gms</item>
|
||||
<item>com.android.vending</item>
|
||||
<item>com.spotify.music</item>
|
||||
<item>com.getir</item>
|
||||
<item>com.pozitron.iscep</item>
|
||||
<item>com.widgetable.theme.android</item>
|
||||
<item>pro.huobi</item>
|
||||
<item>com.tarparos.phigaea</item>
|
||||
<item>com.artem.scotepio</item>
|
||||
<item>com.sabah.deprembs</item>
|
||||
<item>com.boynergrup.hopi</item>
|
||||
<item>com.belbim.istanbulkart</item>
|
||||
<item>com.a101.plus</item>
|
||||
<item>com.widgetable.theme.android</item>
|
||||
<item>net.wargaming.wot.blitz</item>
|
||||
<item>com.litatom.app</item>
|
||||
<item>com.ataexpress.tiklagelsin</item>
|
||||
<item>tr.com.petrolofisi</item>
|
||||
<item>com.mobisoft.beymen</item>
|
||||
<item>com.unilever.algida</item>
|
||||
<item>com.mobisoft.morhipo</item>
|
||||
<item>com.zzkko</item>
|
||||
<item>com.didilabs.kaavefali</item>
|
||||
<item>com.airbnb.android</item>
|
||||
<item>com.mobillium.papara</item>
|
||||
<item>co.com.fincaraiz.app</item>
|
||||
<item>com.frisby.frisby</item>
|
||||
</string-array>
|
||||
<string-array name="signature_never_fake">
|
||||
<item>com.truecaller</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
|
@ -1,649 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2020, microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.microg.gms.firebase.auth
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.Build.VERSION.SDK_INT
|
||||
import android.os.Handler
|
||||
import android.os.Parcel
|
||||
import android.provider.Telephony
|
||||
import android.telephony.SmsMessage
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.google.android.gms.common.api.CommonStatusCodes
|
||||
import com.google.android.gms.common.api.Status
|
||||
import com.google.android.gms.common.internal.GetServiceRequest
|
||||
import com.google.android.gms.common.internal.IGmsCallbacks
|
||||
import com.google.firebase.auth.ActionCodeSettings
|
||||
import com.google.firebase.auth.EmailAuthCredential
|
||||
import com.google.firebase.auth.PhoneAuthCredential
|
||||
import com.google.firebase.auth.UserProfileChangeRequest
|
||||
import com.google.firebase.auth.api.internal.*
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.microg.gms.BaseService
|
||||
import org.microg.gms.common.GmsService
|
||||
import org.microg.gms.common.PackageUtils
|
||||
import org.microg.gms.utils.digest
|
||||
import org.microg.gms.utils.getCertificates
|
||||
|
||||
private const val TAG = "GmsFirebaseAuth"
|
||||
|
||||
fun JSONObject.getStringOrNull(key: String) = if (has(key)) getString(key) else null
|
||||
fun JSONObject.getJSONArrayOrNull(key: String) = if (has(key)) getJSONArray(key) else null
|
||||
fun JSONArray?.orEmpty() = this ?: JSONArray()
|
||||
fun JSONObject.getJSONArrayLength(key: String) = getJSONArrayOrNull(key).orEmpty().length()
|
||||
|
||||
private val ActionCodeSettings.requestTypeAsString: String
|
||||
get() = when (requestType) {
|
||||
1 -> "PASSWORD_RESET"
|
||||
2 -> "OLD_EMAIL_AGREE"
|
||||
3 -> "NEW_EMAIL_ACCEPT"
|
||||
4 -> "VERIFY_EMAIL"
|
||||
5 -> "RECOVER_EMAIL"
|
||||
6 -> "EMAIL_SIGNIN"
|
||||
7 -> "VERIFY_AND_CHANGE_EMAIL"
|
||||
8 -> "REVERT_SECOND_FACTOR_ADDITION"
|
||||
else -> "OOB_REQ_TYPE_UNSPECIFIED"
|
||||
}
|
||||
|
||||
private val UserProfileChangeRequest.deleteAttributeList: List<String>
|
||||
get() {
|
||||
val list = arrayListOf<String>()
|
||||
if (shouldRemoveDisplayName) list.add("DISPLAY_NAME")
|
||||
if (shouldRemovePhotoUri) list.add("PHOTO_URL")
|
||||
return list
|
||||
}
|
||||
|
||||
private fun Intent.getSmsMessages(): Array<SmsMessage> {
|
||||
return if (SDK_INT >= 19) {
|
||||
Telephony.Sms.Intents.getMessagesFromIntent(this)
|
||||
} else {
|
||||
(getSerializableExtra("pdus") as? Array<ByteArray>)?.map { SmsMessage.createFromPdu(it) }.orEmpty().toTypedArray()
|
||||
}
|
||||
}
|
||||
|
||||
class FirebaseAuthService : BaseService(TAG, GmsService.FIREBASE_AUTH) {
|
||||
override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService?) {
|
||||
PackageUtils.getAndCheckCallingPackage(this, request.packageName)
|
||||
val apiKey = request.extras?.getString(Constants.EXTRA_API_KEY)
|
||||
val libraryVersion = request.extras?.getString(Constants.EXTRA_LIBRARY_VERSION)
|
||||
if (apiKey == null) {
|
||||
callback.onPostInitComplete(CommonStatusCodes.DEVELOPER_ERROR, null, null)
|
||||
} else {
|
||||
callback.onPostInitComplete(0, FirebaseAuthServiceImpl(this, lifecycle, request.packageName, libraryVersion, apiKey).asBinder(), null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class FirebaseAuthServiceImpl(private val context: Context, override val lifecycle: Lifecycle, private val packageName: String, private val libraryVersion: String?, private val apiKey: String) : IFirebaseAuthService.Stub(), LifecycleOwner {
|
||||
private val client by lazy { IdentityToolkitClient(context, apiKey, packageName, context.packageManager.getCertificates(packageName).firstOrNull()?.digest("SHA1")) }
|
||||
private var authorizedDomain: String? = null
|
||||
|
||||
private suspend fun getAuthorizedDomain(): String {
|
||||
authorizedDomain?.let { return it }
|
||||
val authorizedDomain = try {
|
||||
client.getProjectConfig().getJSONArray("authorizedDomains").getString(0)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, e)
|
||||
"localhost"
|
||||
}
|
||||
this.authorizedDomain = authorizedDomain
|
||||
return authorizedDomain
|
||||
}
|
||||
|
||||
private suspend fun refreshTokenResponse(cachedState: String): GetTokenResponse {
|
||||
var tokenResponse = GetTokenResponse.parseJson(cachedState)
|
||||
if (System.currentTimeMillis() + 300000L < tokenResponse.issuedAt + tokenResponse.expiresIn * 1000) {
|
||||
return tokenResponse
|
||||
}
|
||||
return client.getTokenByRefreshToken(tokenResponse.refreshToken).toGetTokenResponse()
|
||||
}
|
||||
|
||||
private fun JSONObject.toGetTokenResponse() = GetTokenResponse().apply {
|
||||
refreshToken = getStringOrNull("refresh_token")
|
||||
accessToken = getStringOrNull("access_token")
|
||||
expiresIn = getStringOrNull("expires_in")?.toLong()
|
||||
tokenType = getStringOrNull("token_type")
|
||||
}
|
||||
|
||||
private fun JSONObject.toGetAccountInfoUser(): GetAccountInfoUser = GetAccountInfoUser().apply {
|
||||
localId = getStringOrNull("localId")
|
||||
email = getStringOrNull("email")
|
||||
isEmailVerified = optBoolean("emailVerified")
|
||||
displayName = getStringOrNull("displayName")
|
||||
photoUrl = getStringOrNull("photoUrl")
|
||||
for (i in 0 until getJSONArrayLength("providerUserInfo")) {
|
||||
getJSONArray("providerUserInfo").getJSONObject(i).run {
|
||||
providerInfoList.providerUserInfos.add(ProviderUserInfo().apply {
|
||||
federatedId = getStringOrNull("federatedId")
|
||||
displayName = getStringOrNull("displayName")
|
||||
photoUrl = getStringOrNull("photoUrl")
|
||||
providerId = getStringOrNull("providerId")
|
||||
phoneNumber = getStringOrNull("phoneNumber")
|
||||
email = getStringOrNull("email")
|
||||
rawUserInfo = this@run.toString()
|
||||
})
|
||||
}
|
||||
}
|
||||
password = getStringOrNull("rawPassword")
|
||||
phoneNumber = getStringOrNull("phoneNumber")
|
||||
creationTimestamp = getStringOrNull("createdAt")?.toLong() ?: 0L
|
||||
lastSignInTimestamp = getStringOrNull("lastLoginAt")?.toLong() ?: 0L
|
||||
}
|
||||
|
||||
private fun JSONObject.toCreateAuthUriResponse(): CreateAuthUriResponse = CreateAuthUriResponse().apply {
|
||||
authUri = getStringOrNull("authUri")
|
||||
isRegistered = optBoolean("registered")
|
||||
providerId = getStringOrNull("providerId")
|
||||
isForExistingProvider = optBoolean("forExistingProvider")
|
||||
for (i in 0 until getJSONArrayLength("allProviders")) {
|
||||
stringList.values.add(getJSONArray("allProviders").getString(i))
|
||||
}
|
||||
for (i in 0 until getJSONArrayLength("signinMethods")) {
|
||||
signInMethods.add(getJSONArray("signinMethods").getString(i))
|
||||
}
|
||||
}
|
||||
|
||||
override fun applyActionCode(request: ApplyActionCodeAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: applyActionCode")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun applyActionCodeCompat(code: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: applyActionCodeCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun changeEmail(request: ChangeEmailAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: changeEmail")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun changeEmailCompat(cachedState: String?, email: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: changeEmailCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun changePassword(request: ChangePasswordAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: changePassword")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun changePasswordCompat(cachedState: String?, password: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: changePasswordCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun checkActionCode(request: CheckActionCodeAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: checkActionCode")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun checkActionCodeCompat(code: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: checkActionCodeCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun confirmPasswordReset(request: ConfirmPasswordResetAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: confirmPasswordReset")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun confirmPasswordResetCompat(code: String?, newPassword: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: confirmPasswordResetCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun createUserWithEmailAndPassword(request: CreateUserWithEmailAndPasswordAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "createUserWithEmailAndPassword")
|
||||
try {
|
||||
val tokenResult = client.signupNewUser(email = request.email, password = request.password, tenantId = request.tenantId)
|
||||
val idToken = tokenResult.getString("idToken")
|
||||
val refreshToken = tokenResult.getString("refreshToken")
|
||||
val getTokenResponse = client.getTokenByRefreshToken(refreshToken).toGetTokenResponse()
|
||||
val accountInfoResult = client.getAccountInfo(idToken = idToken).getJSONArray("users").getJSONObject(0).toGetAccountInfoUser().apply { this.isNewUser = true }
|
||||
Log.d(TAG, "callback: onGetTokenResponseAndUser")
|
||||
callbacks.onGetTokenResponseAndUser(getTokenResponse, accountInfoResult)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun createUserWithEmailAndPasswordCompat(email: String?, password: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
createUserWithEmailAndPassword(CreateUserWithEmailAndPasswordAidlRequest().apply { this.email = email; this.password = password }, callbacks)
|
||||
}
|
||||
|
||||
override fun delete(request: DeleteAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: delete")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun deleteCompat(cachedState: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: deleteCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun finalizeMfaEnrollment(request: FinalizeMfaEnrollmentAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: finalizeMfaEnrollment")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun finalizeMfaSignIn(request: FinalizeMfaSignInAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: finalizeMfaSignIn")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun getAccessToken(request: GetAccessTokenAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "getAccessToken")
|
||||
try {
|
||||
callbacks.onGetTokenResponse(client.getTokenByRefreshToken(request.refreshToken).toGetTokenResponse())
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAccessTokenCompat(refreshToken: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
getAccessToken(GetAccessTokenAidlRequest().apply { this.refreshToken = refreshToken }, callbacks)
|
||||
}
|
||||
|
||||
override fun getProvidersForEmail(request: GetProvidersForEmailAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "getProvidersForEmail")
|
||||
try {
|
||||
callbacks.onCreateAuthUriResponse(client.createAuthUri(identifier = request.email, tenantId = request.tenantId).toCreateAuthUriResponse())
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getProvidersForEmailCompat(email: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
getProvidersForEmail(GetProvidersForEmailAidlRequest().apply { this.email = email }, callbacks)
|
||||
}
|
||||
|
||||
override fun linkEmailAuthCredential(request: LinkEmailAuthCredentialAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "linkEmailAuthCredential")
|
||||
try {
|
||||
val getTokenResponse = refreshTokenResponse(request.cachedState)
|
||||
val accountInfoResult = client.getAccountInfo(idToken = getTokenResponse.accessToken).getJSONArray("users").getJSONObject(0).toGetAccountInfoUser()
|
||||
val setAccountInfo = client.setAccountInfo(idToken = getTokenResponse.accessToken, localId = accountInfoResult.localId, email = request.email, password = request.password).toGetAccountInfoUser()
|
||||
accountInfoResult.email = setAccountInfo.email
|
||||
accountInfoResult.isEmailVerified = setAccountInfo.isEmailVerified
|
||||
accountInfoResult.providerInfoList = setAccountInfo.providerInfoList
|
||||
callbacks.onGetTokenResponseAndUser(getTokenResponse, accountInfoResult)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun linkEmailAuthCredentialCompat(email: String?, password: String?, cachedState: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
linkEmailAuthCredential(LinkEmailAuthCredentialAidlRequest().apply { this.email = email; this.password = password; this.cachedState = cachedState }, callbacks)
|
||||
}
|
||||
|
||||
override fun linkFederatedCredential(request: LinkFederatedCredentialAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: linkFederatedCredential")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun linkFederatedCredentialCompat(cachedState: String?, verifyAssertionRequest: VerifyAssertionRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: linkFederatedCredentialCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun linkPhoneAuthCredential(request: LinkPhoneAuthCredentialAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: linkPhoneAuthCredential")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun linkPhoneAuthCredentialCompat(cachedState: String?, credential: PhoneAuthCredential?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: linkPhoneAuthCredentialCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun reload(request: ReloadAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
try {
|
||||
Log.d(TAG, "reload")
|
||||
val getTokenResponse = refreshTokenResponse(request.cachedState)
|
||||
val accountInfoResult = client.getAccountInfo(idToken = getTokenResponse.accessToken).getJSONArray("users").getJSONObject(0).toGetAccountInfoUser()
|
||||
Log.d(TAG, "callback: onGetTokenResponseAndUser")
|
||||
callbacks.onGetTokenResponseAndUser(getTokenResponse, accountInfoResult)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun reloadCompat(cachedState: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
reload(ReloadAidlRequest().apply { this.cachedState = cachedState }, callbacks)
|
||||
}
|
||||
|
||||
override fun sendEmailVerification(request: SendEmailVerificationWithSettingsAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
try {
|
||||
Log.d(TAG, "sendEmailVerification")
|
||||
client.getOobConfirmationCode(
|
||||
requestType = "VERIFY_EMAIL",
|
||||
idToken = request.token,
|
||||
iOSBundleId = request.settings?.iOSBundle,
|
||||
iOSAppStoreId = request.settings?.iOSAppStoreId,
|
||||
continueUrl = request.settings?.url,
|
||||
androidInstallApp = request.settings?.androidInstallApp,
|
||||
androidMinimumVersion = request.settings?.androidMinimumVersion,
|
||||
androidPackageName = request.settings?.androidPackageName,
|
||||
canHandleCodeInApp = request.settings?.handleCodeInApp
|
||||
)
|
||||
callbacks.onEmailVerificationResponse()
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun sendEmailVerificationCompat(token: String?, actionCodeSettings: ActionCodeSettings?, callbacks: IFirebaseAuthCallbacks) {
|
||||
sendEmailVerification(SendEmailVerificationWithSettingsAidlRequest().apply { this.token = token; this.settings = actionCodeSettings }, callbacks)
|
||||
}
|
||||
|
||||
override fun sendVerificationCode(request: SendVerificationCodeAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
try {
|
||||
Log.d(TAG, "sendVerificationCode")
|
||||
val reCaptchaToken = when {
|
||||
request.request.recaptchaToken != null -> request.request.recaptchaToken
|
||||
ReCaptchaOverlay.isSupported(context) -> ReCaptchaOverlay.awaitToken(context, apiKey, getAuthorizedDomain())
|
||||
ReCaptchaActivity.isSupported(context) -> ReCaptchaActivity.awaitToken(context, apiKey, getAuthorizedDomain())
|
||||
else -> throw RuntimeException("No recaptcha token available")
|
||||
}
|
||||
var sessionInfo: String? = null
|
||||
var registered = true
|
||||
val receiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
var smsCode: String? = null
|
||||
for (message in intent.getSmsMessages()) {
|
||||
smsCode = Regex("\\b([0-9]{6})\\b").find(message.messageBody)?.groups?.get(1)?.value
|
||||
?: continue
|
||||
Log.d(TAG, "Received SMS verification code: $smsCode")
|
||||
break
|
||||
}
|
||||
if (smsCode == null) return
|
||||
registered = false
|
||||
context.unregisterReceiver(this)
|
||||
try {
|
||||
callbacks.onVerificationCompletedResponse(PhoneAuthCredential().apply {
|
||||
this.phoneNumber = request.request.phoneNumber
|
||||
this.sessionInfo = sessionInfo
|
||||
this.smsCode = smsCode
|
||||
})
|
||||
Log.d(TAG, "callback: onVerificationCompletedResponse")
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
context.registerReceiver(receiver, IntentFilter("android.provider.Telephony.SMS_RECEIVED"))
|
||||
var timeout = request.request.timeoutInSeconds * 1000L
|
||||
if (timeout <= 0L) timeout = 120000L
|
||||
Handler().postDelayed({
|
||||
if (registered) {
|
||||
Log.d(TAG, "Waited ${timeout}ms for verification code SMS, timeout.")
|
||||
context.unregisterReceiver(receiver)
|
||||
callbacks.onVerificationAutoTimeOut(sessionInfo)
|
||||
Log.d(TAG, "callback: onVerificationAutoTimeOut")
|
||||
}
|
||||
}, timeout)
|
||||
sessionInfo = client.sendVerificationCode(phoneNumber = request.request.phoneNumber, reCaptchaToken = reCaptchaToken).getString("sessionInfo")
|
||||
callbacks.onSendVerificationCodeResponse(sessionInfo)
|
||||
Log.d(TAG, "callback: onSendVerificationCodeResponse")
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun sendVerificationCodeCompat(request: SendVerificationCodeRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
sendVerificationCode(SendVerificationCodeAidlRequest().apply { this.request = request }, callbacks)
|
||||
}
|
||||
|
||||
override fun sendGetOobConfirmationCodeEmail(request: SendGetOobConfirmationCodeEmailAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
try {
|
||||
Log.d(TAG, "sendGetOobConfirmationCodeEmail")
|
||||
client.getOobConfirmationCode(
|
||||
requestType = request.settings?.requestTypeAsString ?: "OOB_REQ_TYPE_UNSPECIFIED",
|
||||
email = request.email,
|
||||
iOSBundleId = request.settings?.iOSBundle,
|
||||
iOSAppStoreId = request.settings?.iOSAppStoreId,
|
||||
continueUrl = request.settings?.url,
|
||||
androidInstallApp = request.settings?.androidInstallApp,
|
||||
androidMinimumVersion = request.settings?.androidMinimumVersion,
|
||||
androidPackageName = request.settings?.androidPackageName,
|
||||
canHandleCodeInApp = request.settings?.handleCodeInApp
|
||||
)
|
||||
Log.d(TAG, "callback: onResetPasswordResponse")
|
||||
callbacks.onResetPasswordResponse(null)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun sendGetOobConfirmationCodeEmailCompat(email: String?, actionCodeSettings: ActionCodeSettings?, callbacks: IFirebaseAuthCallbacks) {
|
||||
sendGetOobConfirmationCodeEmail(SendGetOobConfirmationCodeEmailAidlRequest().apply { this.email = email; this.settings = actionCodeSettings }, callbacks)
|
||||
}
|
||||
|
||||
override fun setFirebaseUiVersion(request: SetFirebaseUiVersionAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: setFirebaseUiVersion")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun setFirebaseUIVersionCompat(firebaseUiVersion: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: setFirebaseUIVersionCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun signInAnonymously(request: SignInAnonymouslyAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "signInAnonymously")
|
||||
try {
|
||||
val tokenResult = client.signupNewUser(tenantId = request.tenantId)
|
||||
val idToken = tokenResult.getString("idToken")
|
||||
val refreshToken = tokenResult.getString("refreshToken")
|
||||
val getTokenResponse = client.getTokenByRefreshToken(refreshToken).toGetTokenResponse()
|
||||
val accountInfoResult = client.getAccountInfo(idToken = idToken).getJSONArray("users").getJSONObject(0).toGetAccountInfoUser().apply { this.isNewUser = true }
|
||||
Log.d(TAG, "callback: onGetTokenResponseAndUser")
|
||||
callbacks.onGetTokenResponseAndUser(getTokenResponse, accountInfoResult)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun signInAnonymouslyCompat(callbacks: IFirebaseAuthCallbacks) {
|
||||
signInAnonymously(SignInAnonymouslyAidlRequest(), callbacks)
|
||||
}
|
||||
|
||||
override fun signInWithCredential(request: SignInWithCredentialAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: signInWithCredential")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun signInWithCredentialCompat(verifyAssertionRequest: VerifyAssertionRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: signInWithCredentialCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun signInWithCustomToken(request: SignInWithCustomTokenAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "signInWithCustomToken")
|
||||
try {
|
||||
val tokenResult = client.verifyCustomToken(token = request.token)
|
||||
val idToken = tokenResult.getString("idToken")
|
||||
val refreshToken = tokenResult.getString("refreshToken")
|
||||
val isNewUser = tokenResult.optBoolean("isNewUser")
|
||||
val getTokenResponse = client.getTokenByRefreshToken(refreshToken).toGetTokenResponse()
|
||||
val accountInfoResult = client.getAccountInfo(idToken = idToken).getJSONArray("users").getJSONObject(0).toGetAccountInfoUser().apply { this.isNewUser = isNewUser }
|
||||
Log.d(TAG, "callback: onGetTokenResponseAndUser")
|
||||
callbacks.onGetTokenResponseAndUser(getTokenResponse, accountInfoResult)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun signInWithCustomTokenCompat(token: String, callbacks: IFirebaseAuthCallbacks) {
|
||||
signInWithCustomToken(SignInWithCustomTokenAidlRequest().apply { this.token = token }, callbacks)
|
||||
}
|
||||
|
||||
override fun signInWithEmailAndPassword(request: SignInWithEmailAndPasswordAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "signInWithEmailAndPassword")
|
||||
try {
|
||||
val tokenResult = client.verifyPassword(email = request.email, password = request.password, tenantId = request.tenantId)
|
||||
val idToken = tokenResult.getString("idToken")
|
||||
val refreshToken = tokenResult.getString("refreshToken")
|
||||
val getTokenResponse = client.getTokenByRefreshToken(refreshToken).toGetTokenResponse()
|
||||
val accountInfoResult = client.getAccountInfo(idToken = idToken).getJSONArray("users").getJSONObject(0).toGetAccountInfoUser()
|
||||
Log.d(TAG, "callback: onGetTokenResponseAndUser")
|
||||
callbacks.onGetTokenResponseAndUser(getTokenResponse, accountInfoResult)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun signInWithEmailAndPasswordCompat(email: String?, password: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
signInWithEmailAndPassword(SignInWithEmailAndPasswordAidlRequest().apply { this.email = email; this.password = password }, callbacks)
|
||||
}
|
||||
|
||||
override fun signInWithEmailLink(request: SignInWithEmailLinkAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: signInWithEmailLink")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun signInWithEmailLinkCompat(credential: EmailAuthCredential?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: signInWithEmailLinkCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun signInWithPhoneNumber(request: SignInWithPhoneNumberAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "signInWithPhoneNumber")
|
||||
try {
|
||||
val tokenResult = client.verifyPhoneNumber(
|
||||
phoneNumber = request.credential.phoneNumber,
|
||||
temporaryProof = request.credential.temporaryProof,
|
||||
sessionInfo = request.credential.sessionInfo,
|
||||
code = request.credential.smsCode
|
||||
)
|
||||
val idToken = tokenResult.getString("idToken")
|
||||
val refreshToken = tokenResult.getString("refreshToken")
|
||||
val isNewUser = tokenResult.optBoolean("isNewUser")
|
||||
val getTokenResponse = client.getTokenByRefreshToken(refreshToken).toGetTokenResponse()
|
||||
val accountInfoResult = client.getAccountInfo(idToken).getJSONArray("users").getJSONObject(0).toGetAccountInfoUser().apply { this.isNewUser = isNewUser }
|
||||
Log.d(TAG, "callback: onGetTokenResponseAndUser")
|
||||
callbacks.onGetTokenResponseAndUser(getTokenResponse, accountInfoResult)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun signInWithPhoneNumberCompat(credential: PhoneAuthCredential?, callbacks: IFirebaseAuthCallbacks) {
|
||||
signInWithPhoneNumber(SignInWithPhoneNumberAidlRequest().apply { this.credential = credential }, callbacks)
|
||||
}
|
||||
|
||||
override fun startMfaEnrollmentWithPhoneNumber(request: StartMfaPhoneNumberEnrollmentAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: startMfaEnrollmentWithPhoneNumber")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun startMfaSignInWithPhoneNumber(request: StartMfaPhoneNumberSignInAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: startMfaSignInWithPhoneNumber")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun unenrollMfa(request: UnenrollMfaAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: unenrollMfa")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun unlinkEmailCredential(request: UnlinkEmailCredentialAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: unlinkEmailCredential")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun unlinkEmailCredentialCompat(cachedState: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: unlinkEmailCredentialCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun unlinkFederatedCredential(request: UnlinkFederatedCredentialAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: unlinkFederatedCredential")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun unlinkFederatedCredentialCompat(provider: String?, cachedState: String?, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: unlinkFederatedCredentialCompat")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
override fun updateProfile(request: UpdateProfileAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
Log.d(TAG, "updateProfile")
|
||||
try {
|
||||
val getTokenResponse = refreshTokenResponse(request.cachedState)
|
||||
val accountInfoResult = client.getAccountInfo(idToken = getTokenResponse.accessToken).getJSONArray("users").getJSONObject(0).toGetAccountInfoUser()
|
||||
val setAccountInfo = client.setAccountInfo(idToken = getTokenResponse.accessToken, localId = accountInfoResult.localId, displayName = request.request.displayName, photoUrl = request.request.photoUrl, deleteAttribute = request.request.deleteAttributeList).toGetAccountInfoUser()
|
||||
accountInfoResult.photoUrl = setAccountInfo.photoUrl
|
||||
accountInfoResult.displayName = setAccountInfo.displayName
|
||||
callbacks.onGetTokenResponseAndUser(getTokenResponse, accountInfoResult)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "callback: onFailure", e)
|
||||
callbacks.onFailure(Status(CommonStatusCodes.INTERNAL_ERROR, e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateProfileCompat(cachedState: String?, userProfileChangeRequest: UserProfileChangeRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
updateProfile(UpdateProfileAidlRequest().apply { this.cachedState = cachedState; this.request = userProfileChangeRequest}, callbacks)
|
||||
}
|
||||
|
||||
override fun verifyBeforeUpdateEmail(request: VerifyBeforeUpdateEmailAidlRequest, callbacks: IFirebaseAuthCallbacks) {
|
||||
Log.d(TAG, "Not yet implemented: verifyBeforeUpdateEmail")
|
||||
callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported"))
|
||||
}
|
||||
|
||||
|
||||
override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean {
|
||||
if (super.onTransact(code, data, reply, flags)) return true
|
||||
Log.d(TAG, "onTransact: $code, $data, $flags")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2020, microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.microg.gms.firebase.auth
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.android.volley.NetworkResponse
|
||||
import com.android.volley.ParseError
|
||||
import com.android.volley.Request.Method.GET
|
||||
import com.android.volley.Request.Method.POST
|
||||
import com.android.volley.Response
|
||||
import com.android.volley.VolleyError
|
||||
import com.android.volley.toolbox.HttpHeaderParser
|
||||
import com.android.volley.toolbox.JsonObjectRequest
|
||||
import com.android.volley.toolbox.JsonRequest
|
||||
import com.android.volley.toolbox.Volley
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import org.microg.gms.utils.singleInstanceOf
|
||||
import org.microg.gms.utils.toHexString
|
||||
import java.io.UnsupportedEncodingException
|
||||
import java.lang.RuntimeException
|
||||
import java.nio.charset.Charset
|
||||
import kotlin.coroutines.resume
|
||||
import kotlin.coroutines.resumeWithException
|
||||
import kotlin.coroutines.suspendCoroutine
|
||||
|
||||
private const val TAG = "GmsFirebaseAuthClient"
|
||||
|
||||
class IdentityToolkitClient(context: Context, private val apiKey: String, private val packageName: String? = null, private val certSha1Hash: ByteArray? = null) {
|
||||
private val queue = singleInstanceOf { Volley.newRequestQueue(context.applicationContext) }
|
||||
|
||||
private fun buildRelyingPartyUrl(method: String) = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/$method?key=$apiKey"
|
||||
private fun buildStsUrl(method: String) = "https://securetoken.googleapis.com/v1/$method?key=$apiKey"
|
||||
|
||||
private fun getRequestHeaders(): Map<String, String> = hashMapOf<String, String>().apply {
|
||||
if (packageName != null) put("X-Android-Package", packageName)
|
||||
if (certSha1Hash != null) put("X-Android-Cert", certSha1Hash.toHexString().uppercase())
|
||||
}
|
||||
|
||||
private suspend fun request(method: String, data: JSONObject): JSONObject = suspendCoroutine { continuation ->
|
||||
queue.add(object : JsonObjectRequest(POST, buildRelyingPartyUrl(method), data, {
|
||||
continuation.resume(it)
|
||||
}, {
|
||||
Log.d(TAG, "Error: ${it.networkResponse?.data?.decodeToString() ?: it.message}")
|
||||
continuation.resumeWithException(RuntimeException(it))
|
||||
}) {
|
||||
override fun getHeaders(): Map<String, String> = getRequestHeaders()
|
||||
})
|
||||
}
|
||||
|
||||
suspend fun createAuthUri(identifier: String? = null, tenantId: String? = null, continueUri: String? = "http://localhost"): JSONObject =
|
||||
request("createAuthUri", JSONObject()
|
||||
.put("identifier", identifier)
|
||||
.put("tenantId", tenantId)
|
||||
.put("continueUri", continueUri))
|
||||
|
||||
suspend fun getAccountInfo(idToken: String? = null): JSONObject =
|
||||
request("getAccountInfo", JSONObject()
|
||||
.put("idToken", idToken))
|
||||
|
||||
suspend fun getProjectConfig(): JSONObject = suspendCoroutine { continuation ->
|
||||
queue.add(JsonObjectRequest(GET, buildRelyingPartyUrl("getProjectConfig"), null, { continuation.resume(it) }, { continuation.resumeWithException(RuntimeException(it)) }))
|
||||
}
|
||||
|
||||
suspend fun getOobConfirmationCode(requestType: String, email: String? = null, newEmail: String? = null, continueUrl: String? = null, idToken: String? = null, iOSBundleId: String? = null, iOSAppStoreId: String? = null, androidMinimumVersion: String? = null, androidInstallApp: Boolean? = null, androidPackageName: String? = null, canHandleCodeInApp: Boolean? = null): JSONObject =
|
||||
request("getOobConfirmationCode", JSONObject()
|
||||
.put("kind", "identitytoolkit#relyingparty")
|
||||
.put("requestType", requestType)
|
||||
.put("email", email)
|
||||
.put("newEmail", newEmail)
|
||||
.put("continueUrl", continueUrl)
|
||||
.put("idToken", idToken)
|
||||
.put("iOSBundleId", iOSBundleId)
|
||||
.put("iOSAppStoreId", iOSAppStoreId)
|
||||
.put("androidMinimumVersion", androidMinimumVersion)
|
||||
.put("androidInstallApp", androidInstallApp)
|
||||
.put("androidPackageName", androidPackageName)
|
||||
.put("canHandleCodeInApp", canHandleCodeInApp))
|
||||
|
||||
|
||||
suspend fun sendVerificationCode(phoneNumber: String? = null, reCaptchaToken: String? = null): JSONObject =
|
||||
request("sendVerificationCode", JSONObject()
|
||||
.put("phoneNumber", phoneNumber)
|
||||
.put("recaptchaToken", reCaptchaToken))
|
||||
|
||||
suspend fun setAccountInfo(idToken: String? = null, localId: String? = null, email: String? = null, password: String? = null, displayName: String? = null, photoUrl: String? = null, deleteAttribute: List<String> = emptyList()): JSONObject =
|
||||
request("setAccountInfo", JSONObject()
|
||||
.put("idToken", idToken)
|
||||
.put("localId", localId)
|
||||
.put("email", email)
|
||||
.put("password", password)
|
||||
.put("displayName", displayName)
|
||||
.put("photoUrl", photoUrl)
|
||||
.put("deleteAttribute", JSONArray().apply { deleteAttribute.map { put(it) } }))
|
||||
|
||||
suspend fun signupNewUser(email: String? = null, password: String? = null, tenantId: String? = null): JSONObject =
|
||||
request("signupNewUser", JSONObject()
|
||||
.put("email", email)
|
||||
.put("password", password)
|
||||
.put("tenantId", tenantId))
|
||||
|
||||
suspend fun verifyCustomToken(token: String? = null, returnSecureToken: Boolean = true): JSONObject =
|
||||
request("verifyCustomToken", JSONObject()
|
||||
.put("token", token)
|
||||
.put("returnSecureToken", returnSecureToken))
|
||||
|
||||
suspend fun verifyPassword(email: String? = null, password: String? = null, tenantId: String? = null, returnSecureToken: Boolean = true): JSONObject =
|
||||
request("verifyPassword", JSONObject()
|
||||
.put("email", email)
|
||||
.put("password", password)
|
||||
.put("tenantId", tenantId)
|
||||
.put("returnSecureToken", returnSecureToken))
|
||||
|
||||
suspend fun verifyPhoneNumber(phoneNumber: String? = null, sessionInfo: String? = null, code: String? = null, idToken: String? = null, verificationProof: String? = null, temporaryProof: String? = null): JSONObject =
|
||||
request("verifyPhoneNumber", JSONObject()
|
||||
.put("verificationProof", verificationProof)
|
||||
.put("code", code)
|
||||
.put("idToken", idToken)
|
||||
.put("temporaryProof", temporaryProof)
|
||||
.put("phoneNumber", phoneNumber)
|
||||
.put("sessionInfo", sessionInfo))
|
||||
|
||||
suspend fun getTokenByRefreshToken(refreshToken: String): JSONObject = suspendCoroutine { continuation ->
|
||||
queue.add(object : JsonRequest<JSONObject>(POST, buildStsUrl("token"), "grant_type=refresh_token&refresh_token=$refreshToken", { continuation.resume(it) }, { continuation.resumeWithException(RuntimeException(it)) }) {
|
||||
override fun parseNetworkResponse(response: NetworkResponse): Response<JSONObject> {
|
||||
return try {
|
||||
val jsonString = String(response.data, Charset.forName(HttpHeaderParser.parseCharset(response.headers, PROTOCOL_CHARSET)))
|
||||
Response.success(JSONObject(jsonString), null)
|
||||
} catch (e: UnsupportedEncodingException) {
|
||||
Response.error(ParseError(e))
|
||||
} catch (je: JSONException) {
|
||||
Response.error(ParseError(je))
|
||||
}
|
||||
}
|
||||
|
||||
override fun getBodyContentType(): String {
|
||||
return "application/x-www-form-urlencoded"
|
||||
}
|
||||
|
||||
override fun getHeaders(): Map<String, String> = getRequestHeaders()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
android.useAndroidX=true
|
||||
org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
android.nonTransitiveRClass=false
|
||||
android.nonFinalResIds=false
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
11
gradle/wrapper/gradle-wrapper.properties
vendored
11
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,11 +0,0 @@
|
|||
#Thu Jun 29 16:45:22 ICT 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
<<<<<<< HEAD
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-rc-3-bin.zip
|
||||
=======
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
||||
networkTimeout=10000
|
||||
>>>>>>> 48e0b00a (Update build tools and dependencies)
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue