Repo Created
This commit is contained in:
parent
eb305e2886
commit
a8c22c65db
4784 changed files with 329907 additions and 2 deletions
43
play-services-clearcut/build.gradle
Normal file
43
play-services-clearcut/build.gradle
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'signing'
|
||||
|
||||
android {
|
||||
namespace "com.google.android.gms.clearcut"
|
||||
|
||||
compileSdkVersion androidCompileSdk
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
buildFeatures {
|
||||
aidl = true
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionName version
|
||||
minSdkVersion androidMinSdk
|
||||
targetSdkVersion androidTargetSdk
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
}
|
||||
|
||||
apply from: '../gradle/publish-android.gradle'
|
||||
|
||||
description = 'microG implementation of play-services-clearcut'
|
||||
|
||||
dependencies {
|
||||
// Dependencies from play-services-clearcut:17.0.0
|
||||
api "androidx.core:core:1.0.0"
|
||||
api project(':play-services-base')
|
||||
api project(':play-services-basement')
|
||||
api project(':play-services-phenotype')
|
||||
api project(':play-services-tasks')
|
||||
}
|
||||
6
play-services-clearcut/src/main/AndroidManifest.xml
Normal file
6
play-services-clearcut/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<manifest />
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.clearcut;
|
||||
|
||||
parcelable LogEventParcelable;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.google.android.gms.clearcut.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.data.DataHolder;
|
||||
|
||||
interface IClearcutLoggerCallbacks {
|
||||
oneway void onLogResult(in Status status) = 0;
|
||||
oneway void onForceUploadResult(in Status status) = 1;
|
||||
oneway void onStartCollectForDebugResult(in Status status, long l) = 2;
|
||||
oneway void onStopCollectForDebugResult(in Status status) = 3;
|
||||
oneway void onCollectForDebugExpiryTime(in Status status, long l) = 4;
|
||||
oneway void onLogEventParcelables(in DataHolder data) = 6;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.google.android.gms.clearcut.internal;
|
||||
|
||||
import com.google.android.gms.clearcut.internal.IClearcutLoggerCallbacks;
|
||||
import com.google.android.gms.clearcut.LogEventParcelable;
|
||||
|
||||
interface IClearcutLoggerService {
|
||||
oneway void log(IClearcutLoggerCallbacks callbacks, in LogEventParcelable event) = 0;
|
||||
oneway void forceUpload(IClearcutLoggerCallbacks callbacks) = 1;
|
||||
oneway void startCollectForDebug(IClearcutLoggerCallbacks callbacks) = 2;
|
||||
oneway void stopCollectForDebug(IClearcutLoggerCallbacks callbacks) = 3;
|
||||
oneway void getCollectForDebugExpiryTime(IClearcutLoggerCallbacks callbacks) = 4;
|
||||
oneway void getLogEventParcelablesLegacy(IClearcutLoggerCallbacks callbacks) = 5;
|
||||
oneway void getLogEventParcelables(IClearcutLoggerCallbacks callbacks) = 6;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.clearcut.internal;
|
||||
|
||||
parcelable PlayLoggerContext;
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.google.android.gms.playlog.internal;
|
||||
|
||||
import com.google.android.gms.clearcut.internal.PlayLoggerContext;
|
||||
import com.google.android.gms.playlog.internal.LogEvent;
|
||||
|
||||
// Deprecated
|
||||
interface IPlayLogService {
|
||||
void onEvent(String packageName, in PlayLoggerContext context, in LogEvent event) = 1;
|
||||
void onMultiEvent(String packageName, in PlayLoggerContext context, in List<LogEvent> events) = 2;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.playlog.internal;
|
||||
|
||||
parcelable LogEvent;
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2017 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.clearcut;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
import com.google.android.gms.clearcut.internal.LogVerifierResultParcelable;
|
||||
import com.google.android.gms.phenotype.ExperimentTokens;
|
||||
import com.google.android.gms.phenotype.GenericDimension;
|
||||
import com.google.android.gms.clearcut.internal.PlayLoggerContext;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class LogEventParcelable extends AutoSafeParcelable {
|
||||
@Field(1)
|
||||
private int versionCode = 1;
|
||||
|
||||
@Field(2)
|
||||
public final PlayLoggerContext context;
|
||||
|
||||
@Field(3)
|
||||
public final byte[] bytes;
|
||||
|
||||
@Field(4)
|
||||
public final int[] testCodes;
|
||||
|
||||
@Field(5)
|
||||
public final String[] mendelPackages;
|
||||
|
||||
@Field(6)
|
||||
public final int[] experimentIds;
|
||||
|
||||
@Field(7)
|
||||
public final byte[][] experimentTokens;
|
||||
|
||||
@Field(8)
|
||||
public final boolean addPhenotypeExperimentTokens;
|
||||
|
||||
@Field(9)
|
||||
public final ExperimentTokens[] experimentTokenParcelables;
|
||||
|
||||
@Field(10)
|
||||
public final GenericDimension[] genericDimensions;
|
||||
|
||||
@Field(11)
|
||||
public final LogVerifierResultParcelable logVerifierResult;
|
||||
|
||||
@Field(12)
|
||||
private String[] mendelPackagesToFilter;
|
||||
|
||||
@Field(13)
|
||||
public int eventCode;
|
||||
|
||||
private LogEventParcelable() {
|
||||
context = null;
|
||||
bytes = null;
|
||||
testCodes = experimentIds = null;
|
||||
mendelPackages = null;
|
||||
experimentTokens = null;
|
||||
addPhenotypeExperimentTokens = true;
|
||||
experimentTokenParcelables = null;
|
||||
genericDimensions = null;
|
||||
logVerifierResult = null;
|
||||
}
|
||||
|
||||
public LogEventParcelable(PlayLoggerContext context, byte[] bytes, int[] testCodes, String[] mendelPackages, int[] experimentIds, byte[][] experimentTokens, boolean addPhenotypeExperimentTokens) {
|
||||
this.context = context;
|
||||
this.bytes = bytes;
|
||||
this.testCodes = testCodes;
|
||||
this.mendelPackages = mendelPackages;
|
||||
this.experimentIds = experimentIds;
|
||||
this.experimentTokens = experimentTokens;
|
||||
this.addPhenotypeExperimentTokens = addPhenotypeExperimentTokens;
|
||||
this.experimentTokenParcelables = null;
|
||||
this.genericDimensions = null;
|
||||
this.logVerifierResult = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("LogEventParcelable[")
|
||||
.append(versionCode).append(", ").append(context)
|
||||
.append(", LogEventBytes: ").append(getBytesAsString());
|
||||
if (testCodes != null) sb.append(", TestCodes: ").append(Arrays.toString(testCodes));
|
||||
if (mendelPackages != null)
|
||||
sb.append(", MendelPackages: ").append(Arrays.toString(mendelPackages));
|
||||
if (experimentIds != null)
|
||||
sb.append(", ExperimentIds: ").append(Arrays.toString(experimentIds));
|
||||
if (experimentTokens != null)
|
||||
sb.append(", ExperimentTokens: ").append(Arrays.toString(experimentTokens));
|
||||
return sb.append(", AddPhenotypeExperimentTokens: ").append(addPhenotypeExperimentTokens)
|
||||
.append(']').toString();
|
||||
}
|
||||
|
||||
private String getBytesAsString() {
|
||||
if (bytes == null) return "null";
|
||||
try {
|
||||
CharsetDecoder d = Charset.forName("US-ASCII").newDecoder();
|
||||
CharBuffer r = d.decode(ByteBuffer.wrap(bytes));
|
||||
return r.toString();
|
||||
} catch (Exception e) {
|
||||
return Base64.encodeToString(bytes, Base64.NO_WRAP);
|
||||
}
|
||||
}
|
||||
|
||||
public static final Creator<LogEventParcelable> CREATOR = new AutoCreator<LogEventParcelable>(LogEventParcelable.class);
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.clearcut.internal;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
public class LogVerifierResultParcelable extends AutoSafeParcelable {
|
||||
@Field(1)
|
||||
public boolean b;
|
||||
|
||||
public static final Creator<LogVerifierResultParcelable> CREATOR = new AutoCreator<>(LogVerifierResultParcelable.class);
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.clearcut.internal;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
public class PlayLoggerContext extends AutoSafeParcelable {
|
||||
|
||||
@Field(1)
|
||||
private int versionCode = 1;
|
||||
|
||||
@Field(2)
|
||||
public final String packageName;
|
||||
|
||||
@Field(3)
|
||||
public final int packageVersionCode;
|
||||
|
||||
@Field(4)
|
||||
public final int logSource;
|
||||
|
||||
@Field(5)
|
||||
public final String uploadAccount;
|
||||
|
||||
@Field(6)
|
||||
public final String loggingId;
|
||||
|
||||
@Field(7)
|
||||
public final boolean logAndroidId;
|
||||
|
||||
@Field(8)
|
||||
public final String logSourceName;
|
||||
|
||||
@Field(9)
|
||||
public final boolean isAnonymous;
|
||||
|
||||
@Field(10)
|
||||
public final int qosTier;
|
||||
|
||||
@Field(11)
|
||||
public final Integer appMobileSpecId;
|
||||
|
||||
@Field(12)
|
||||
public final boolean scrubMccMnc;
|
||||
|
||||
@Field(13)
|
||||
public final Integer piiLevelset;
|
||||
|
||||
private PlayLoggerContext() {
|
||||
packageName = uploadAccount = logSourceName = loggingId = null;
|
||||
qosTier = packageVersionCode = logSource = appMobileSpecId = piiLevelset = -1;
|
||||
isAnonymous = logAndroidId = scrubMccMnc = false;
|
||||
}
|
||||
|
||||
public PlayLoggerContext(String packageName, int packageVersionCode, int logSource, String logSourceName, String uploadAccount, String loggingId, boolean isAnonymous, int qosTier, boolean scrubMccMnc, int piiLevelset) {
|
||||
this.packageName = packageName;
|
||||
this.packageVersionCode = packageVersionCode;
|
||||
this.logSource = logSource;
|
||||
this.logSourceName = logSourceName;
|
||||
this.uploadAccount = uploadAccount;
|
||||
this.loggingId = loggingId;
|
||||
this.logAndroidId = !isAnonymous;
|
||||
this.isAnonymous = isAnonymous;
|
||||
this.qosTier = qosTier;
|
||||
this.appMobileSpecId = null;
|
||||
this.scrubMccMnc = scrubMccMnc;
|
||||
this.piiLevelset = piiLevelset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("PlayLoggerContext[").append(versionCode);
|
||||
sb.append(", package=").append(packageName);
|
||||
sb.append(", packageVersionCode=").append(packageVersionCode);
|
||||
sb.append(", logSource=").append(logSource);
|
||||
sb.append(", uploadAccount=").append(uploadAccount);
|
||||
sb.append(", loggingId=").append(loggingId);
|
||||
sb.append(", logAndroidId=").append(logAndroidId);
|
||||
sb.append(", logSourceName=").append(logSourceName);
|
||||
sb.append(", isAnonymous=").append(isAnonymous);
|
||||
sb.append(", qosTier=").append(qosTier);
|
||||
sb.append(", appMobileSpecId=").append(appMobileSpecId);
|
||||
sb.append(", scrubMccMnc=").append(scrubMccMnc);
|
||||
sb.append(", piiLevelset=").append(piiLevelset);
|
||||
sb.append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static Creator<PlayLoggerContext> CREATOR = new AutoCreator<PlayLoggerContext>(PlayLoggerContext.class);
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2017 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.playlog.internal;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
import org.microg.safeparcel.SafeParceled;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Deprecated
|
||||
public class LogEvent extends AutoSafeParcelable {
|
||||
|
||||
@SafeParceled(1)
|
||||
private int versionCode = 1;
|
||||
|
||||
@SafeParceled(2)
|
||||
public final long eventTime;
|
||||
|
||||
@SafeParceled(3)
|
||||
public final String tag;
|
||||
|
||||
@SafeParceled(4)
|
||||
public final byte[] data;
|
||||
|
||||
private LogEvent() {
|
||||
eventTime = -1;
|
||||
tag = null;
|
||||
data = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LogEvent{" +
|
||||
"eventTime=" + new Date(eventTime) +
|
||||
", tag='" + tag + '\'' +
|
||||
", data=" + (data == null ? "null" : ('\'' + new String(data) + '\'')) +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static Creator<LogEvent> CREATOR = new AutoCreator<LogEvent>(LogEvent.class);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue