Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: QR-Codes #460

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mastodon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ android {
buildFeatures {
buildConfig true
}
buildFeatures{
aidl true
}
}

dependencies {
Expand All @@ -151,6 +154,8 @@ dependencies {
implementation 'org.jsoup:jsoup:1.14.3'
implementation 'com.squareup:otto:1.3.8'
implementation 'de.psdev:async-otto:1.0.3'
implementation 'com.google.zxing:core:3.5.3'
implementation 'org.microg:safe-parcel:1.5.0'
implementation 'org.parceler:parceler-api:1.1.12'
implementation 'com.github.bottom-software-foundation:bottom-java:2.1.0'
annotationProcessor 'org.parceler:parceler:1.1.12'
Expand Down
4 changes: 4 additions & 0 deletions mastodon/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
android:windowSoftInputMode="adjustPan"
android:largeHeap="true">

<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="barcode_ui"/>

<activity android:name=".MainActivity" android:exported="true" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustResize" android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.google.android.gms.common.api;

parcelable Status;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.google.android.gms.common.api.internal;

import com.google.android.gms.common.api.Status;

interface IStatusCallback {
void onResult(in Status status);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* SPDX-FileCopyrightText: 2020, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.common.internal;
parcelable ConnectionInfo;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.google.android.gms.common.internal;

parcelable GetServiceRequest;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: 2020, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.common.internal;

import android.os.Bundle;
import com.google.android.gms.common.internal.ConnectionInfo;

interface IGmsCallbacks {
void onPostInitComplete(int statusCode, IBinder binder, in Bundle params);
void onAccountValidationComplete(int statusCode, in Bundle params);
void onPostInitCompleteWithConnectionInfo(int statusCode, IBinder binder, in ConnectionInfo info);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.google.android.gms.common.internal;

import android.os.Bundle;

import com.google.android.gms.common.internal.IGmsCallbacks;
import com.google.android.gms.common.internal.GetServiceRequest;

interface IGmsServiceBroker {
void getService(IGmsCallbacks callback, in GetServiceRequest request) = 45;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.google.android.gms.common.moduleinstall;

parcelable ModuleAvailabilityResponse;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.google.android.gms.common.moduleinstall;

parcelable ModuleInstallIntentResponse;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.google.android.gms.common.moduleinstall;

parcelable ModuleInstallResponse;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.google.android.gms.common.moduleinstall;

parcelable ModuleInstallStatusUpdate;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.google.android.gms.common.moduleinstall.internal;

parcelable ApiFeatureRequest;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.google.android.gms.common.moduleinstall.internal;

import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.moduleinstall.ModuleAvailabilityResponse;
import com.google.android.gms.common.moduleinstall.ModuleInstallIntentResponse;
import com.google.android.gms.common.moduleinstall.ModuleInstallResponse;

interface IModuleInstallCallbacks {
void onModuleAvailabilityResponse(in Status status, in ModuleAvailabilityResponse response) = 0;
void onModuleInstallResponse(in Status status, in ModuleInstallResponse response) = 1;
void onModuleInstallIntentResponse(in Status status, in ModuleInstallIntentResponse response) = 2;
void onStatus(in Status status) = 3;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.google.android.gms.common.moduleinstall.internal;

import com.google.android.gms.common.api.internal.IStatusCallback;
import com.google.android.gms.common.moduleinstall.internal.ApiFeatureRequest;
import com.google.android.gms.common.moduleinstall.internal.IModuleInstallCallbacks;
import com.google.android.gms.common.moduleinstall.internal.IModuleInstallStatusListener;

interface IModuleInstallService {
void areModulesAvailable(IModuleInstallCallbacks callbacks, in ApiFeatureRequest request) = 0;
void installModules(IModuleInstallCallbacks callbacks, in ApiFeatureRequest request, IModuleInstallStatusListener listener) = 1;
void getInstallModulesIntent(IModuleInstallCallbacks callbacks, in ApiFeatureRequest request) = 2;
void releaseModules(IStatusCallback callback, in ApiFeatureRequest request) = 3;
void unregisterListener(IStatusCallback callback, IModuleInstallStatusListener listener) = 5;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.google.android.gms.common.moduleinstall.internal;

import com.google.android.gms.common.moduleinstall.ModuleInstallStatusUpdate;

interface IModuleInstallStatusListener {
void onModuleInstallStatusUpdate(in ModuleInstallStatusUpdate statusUpdate) = 0;
}
15 changes: 15 additions & 0 deletions mastodon/src/main/java/com/google/android/gms/common/Feature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.google.android.gms.common;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class Feature extends AutoSafeParcelable{
@SafeParceled(1)
public String name;
@SafeParceled(2)
public int oldVersion;
@SafeParceled(3)
public long version=-1;

public static final Creator<Feature> CREATOR=new AutoCreator<>(Feature.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.google.android.gms.common.api;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class Scope extends AutoSafeParcelable{
@SafeParceled(1)
public int versionCode=1;
@SafeParceled(2)
public String scopeUri;

public static final Creator<Scope> CREATOR=new AutoCreator<>(Scope.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.google.android.gms.common.api;

import android.app.PendingIntent;

import org.joinmastodon.android.googleservices.ConnectionResult;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class Status extends AutoSafeParcelable{
@SafeParceled(1000)
public int versionCode;
@SafeParceled(1)
public int statusCode;
@SafeParceled(2)
public String statusMessage;
@SafeParceled(3)
public PendingIntent pendingIntent;
@SafeParceled(4)
public ConnectionResult connectionResult;

public static final Creator<Status> CREATOR=new AutoCreator<>(Status.class);

@Override
public String toString(){
return "Status{"+
"versionCode="+versionCode+
", statusCode="+statusCode+
", statusMessage='"+statusMessage+'\''+
", pendingIntent="+pendingIntent+
", connectionResult="+connectionResult+
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.google.android.gms.common.internal;

import android.os.Bundle;

import com.google.android.gms.common.Feature;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class ConnectionInfo extends AutoSafeParcelable{
@SafeParceled(1)
public Bundle params;
@SafeParceled(2)
public Feature[] features;
@SafeParceled(3)
public int unknown3;

public static final Creator<ConnectionInfo> CREATOR=new AutoCreator<>(ConnectionInfo.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.google.android.gms.common.internal;

import android.os.Bundle;
import android.os.IBinder;
import android.accounts.Account;

import com.google.android.gms.common.Feature;
import com.google.android.gms.common.api.Scope;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class GetServiceRequest extends AutoSafeParcelable{
@SafeParceled(1)
int versionCode=6;
@SafeParceled(2)
public int serviceId;
@SafeParceled(3)
public int gmsVersion;
@SafeParceled(4)
public String packageName;
@SafeParceled(5)
public IBinder accountAccessor;
@SafeParceled(6)
public Scope[] scopes;
@SafeParceled(7)
public Bundle extras;
@SafeParceled(8)
public Account account;
@SafeParceled(9)
@Deprecated
long field9;
@SafeParceled(10)
public Feature[] defaultFeatures;
@SafeParceled(11)
public Feature[] apiFeatures;
@SafeParceled(12)
boolean supportsConnectionInfo;
@SafeParceled(13)
int field13;
@SafeParceled(14)
boolean field14;
@SafeParceled(15)
String attributionTag;

public static final Creator<GetServiceRequest> CREATOR=new AutoCreator<>(GetServiceRequest.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.google.android.gms.common.moduleinstall;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class ModuleAvailabilityResponse extends AutoSafeParcelable{
@SafeParceled(1)
public boolean modulesAvailable;
@SafeParceled(2)
public int availabilityStatus;

public static final Creator<ModuleAvailabilityResponse> CREATOR=new AutoCreator<>(ModuleAvailabilityResponse.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.google.android.gms.common.moduleinstall;

import android.app.PendingIntent;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class ModuleInstallIntentResponse extends AutoSafeParcelable{
@SafeParceled(1)
public PendingIntent pendingIntent;

public static final Creator<ModuleInstallIntentResponse> CREATOR=new AutoCreator<>(ModuleInstallIntentResponse.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.google.android.gms.common.moduleinstall;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class ModuleInstallResponse extends AutoSafeParcelable{
@SafeParceled(1)
public int sessionID;
@SafeParceled(2)
public boolean shouldUnregisterListener;

public static final Creator<ModuleInstallResponse> CREATOR=new AutoCreator<>(ModuleInstallResponse.class);

@Override
public String toString(){
return "ModuleInstallResponse{"+
"sessionID="+sessionID+
", shouldUnregisterListener="+shouldUnregisterListener+
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.google.android.gms.common.moduleinstall;

import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;

public class ModuleInstallStatusUpdate extends AutoSafeParcelable{
public static final int STATE_UNKNOWN = 0;
/**
* The request is pending and will be processed soon.
*/
public static final int STATE_PENDING = 1;
/**
* The optional module download is in progress.
*/
public static final int STATE_DOWNLOADING = 2;
/**
* The optional module download has been canceled.
*/
public static final int STATE_CANCELED = 3;
/**
* Installation is completed; the optional modules are available to the client app.
*/
public static final int STATE_COMPLETED = 4;
/**
* The optional module download or installation has failed.
*/
public static final int STATE_FAILED = 5;
/**
* The optional modules have been downloaded and the installation is in progress.
*/
public static final int STATE_INSTALLING = 6;
/**
* The optional module download has been paused.
* <p>
* This usually happens when connectivity requirements can't be met during download. Once the connectivity requirements
* are met, the download will be resumed automatically.
*/
public static final int STATE_DOWNLOAD_PAUSED = 7;

@SafeParceled(1)
public int sessionID;
@SafeParceled(2)
public int installState;
@SafeParceled(3)
public Long bytesDownloaded;
@SafeParceled(4)
public Long totalBytesToDownload;
@SafeParceled(5)
public int errorCode;

@Override
public String toString(){
return "ModuleInstallStatusUpdate{"+
"sessionID="+sessionID+
", installState="+installState+
", bytesDownloaded="+bytesDownloaded+
", totalBytesToDownload="+totalBytesToDownload+
", errorCode="+errorCode+
'}';
}

public static final Creator<ModuleInstallStatusUpdate> CREATOR=new AutoCreator<>(ModuleInstallStatusUpdate.class);
}
Loading
Loading