mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-23 16:01:09 +01:00
Few restructuring after b2d6965
This commit is contained in:
parent
b2d6965608
commit
e47101856d
@ -147,7 +147,8 @@ public class Attestation {
|
||||
}
|
||||
|
||||
private AttestResponse attest(AttestRequest request, String apiKey) throws IOException {
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(SafetyNetPrefs.get(context).getServiceUrl(apiKey)).openConnection();
|
||||
String requestUrl = SafetyNetPrefs.get(context).getServiceUrl() + "?alt=PROTO&key=" + apiKey;
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(requestUrl).openConnection();
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setDoInput(true);
|
||||
connection.setDoOutput(true);
|
||||
|
@ -39,6 +39,7 @@ import java.util.ArrayList;
|
||||
|
||||
public class SafetyNetClientServiceImpl extends ISafetyNetService.Stub {
|
||||
private static final String TAG = "GmsSafetyNetClientImpl";
|
||||
private static final String DEFAULT_API_KEY = "AIzaSyDqVnJBjE5ymo--oBJt3On7HQx9xNm1RHA";
|
||||
|
||||
private Context context;
|
||||
private String packageName;
|
||||
@ -52,7 +53,7 @@ public class SafetyNetClientServiceImpl extends ISafetyNetService.Stub {
|
||||
|
||||
@Override
|
||||
public void attest(ISafetyNetCallbacks callbacks, byte[] nonce) throws RemoteException {
|
||||
attestWithApiKey(callbacks, nonce, "AIzaSyDqVnJBjE5ymo--oBJt3On7HQx9xNm1RHA");
|
||||
attestWithApiKey(callbacks, nonce, DEFAULT_API_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,7 @@ import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
public class SafetyNetPrefs implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private static final String OFFICIAL_ATTEST_BASE_URL = "https://www.googleapis.com/androidcheck/v1/attestations/attest?alt=PROTO&key=";
|
||||
private static final String OFFICIAL_ATTEST_BASE_URL = "https://www.googleapis.com/androidcheck/v1/attestations/attest";
|
||||
|
||||
public static final String PREF_SNET_DISABLED = "snet_disabled";
|
||||
public static final String PREF_SNET_OFFICIAL = "snet_official";
|
||||
@ -88,8 +88,8 @@ public class SafetyNetPrefs implements SharedPreferences.OnSharedPreferenceChang
|
||||
return official;
|
||||
}
|
||||
|
||||
public String getServiceUrl(String apiKey) {
|
||||
if (official) return OFFICIAL_ATTEST_BASE_URL + apiKey;
|
||||
public String getServiceUrl() {
|
||||
if (official) return OFFICIAL_ATTEST_BASE_URL;
|
||||
return customUrl;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user