remove from login method for test sentry and add s to websocket enviremnt domain

This commit is contained in:
Eudes Inácio
2022-12-19 11:54:18 +01:00
parent 52b9ea6c51
commit 63e75e82b2
17 changed files with 39 additions and 342 deletions
-3
View File
@@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
-5
View File
@@ -31,10 +31,5 @@
<option name="name" value="maven" />
<option name="url" value="https://maven.google.com" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://jitpack.io" />
</remote-repository>
</component>
</project>
+1 -12
View File
@@ -1,17 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/Users/eudes.inacio/Gabinet-DigitalProject/gabinete-digital_latest/gabinete-digital/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.1" />
<entry key="..\:/Users/eudes.inacio/Gabinet-DigitalProject/gabinete-digital_latest/gabinete-digital/android/app/src/main/res/drawable/ic_launcher_background.xml" value="0.1037037037037037" />
<entry key="..\:/Users/eudes.inacio/Gabinet-DigitalProject/gabinete-digital_latest/gabinete-digital/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.14635416666666667" />
<entry key="..\:/Users/eudes.inacio/Gabinet-DigitalProject/gabinete-digital_latest/gabinete-digital/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.10648148148148148" />
</map>
</option>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
+1 -6
View File
@@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.gpr.gabinetedigital"
applicationId "com.capacitorjs.app.testapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
@@ -27,13 +27,9 @@ repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation 'com.google.firebase:firebase-config:15.0.2'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation project(':capacitor-android')
@@ -41,7 +37,6 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
implementation 'com.github.javiersantos:AppUpdater:2.7'
}
apply from: 'capacitor.build.gradle'
-40
View File
@@ -1,40 +0,0 @@
{
"project_info": {
"project_number": "800733765231",
"firebase_url": "https://gabinete-digital-2020.firebaseio.com",
"project_id": "gabinete-digital-2020",
"storage_bucket": "gabinete-digital-2020.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:800733765231:android:e7ffc0b310037d9f13779a",
"android_client_info": {
"package_name": "com.gpr.gabinetedigital"
}
},
"oauth_client": [
{
"client_id": "800733765231-92oa7ib62ob0pkouphb5i5sp01vkalid.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyD0pfW45DLoW6mqvZRklJdbfSTskW22Fok"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "800733765231-92oa7ib62ob0pkouphb5i5sp01vkalid.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
-18
View File
@@ -1,18 +0,0 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.gpr.gabinetedigital",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
]
}
+32 -8
View File
@@ -1,17 +1,41 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest package="com.gpr.gabinetedigital" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name=".App" android:requestLegacyExternalStorage="true" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/title_activity_main" android:launchMode="singleTask" android:name="com.gpr.gabinetedigital.MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.capacitorjs.app.testapp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:name="com.capacitorjs.app.testapp.MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

@@ -1,39 +0,0 @@
package com.gpr.gabinetedigital;
import android.app.Application;
import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import java.util.HashMap;
import java.util.Map;
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();
Map<String,Object> defaultValue = new HashMap<>();
defaultValue.put(UpdateHelper.KEY_UPDATE_ENABLE,false);
defaultValue.put(UpdateHelper.KEY_UPDATE_VERSION,"1.0");
defaultValue.put(UpdateHelper.KEY_UPDATE_URL,"https://d953-41-63-166-54.ngrok.io/gabinete_digital.apk");
remoteConfig.setDefaults(defaultValue);
remoteConfig.fetch(1)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if(task.isSuccessful()) {
remoteConfig.activateFetched();
}
}
});
}
}
@@ -1,8 +0,0 @@
package com.gpr.gabinetedigital;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {}
@@ -1,39 +0,0 @@
package com.gpr.gabinetedigital;
import android.app.AlertDialog;
import android.app.Application;
import android.content.DialogInterface;
import android.os.Bundle;
import android.widget.Toast;
public class UpdateActivity extends Application implements UpdateHelper.onUpdateCheckListener {
@Override
public void onCreate() {
super.onCreate();
UpdateHelper.with(this)
.onUpdateCheck(this)
.check();
}
@Override
public void onUpdateCheckListener(String urlApp) {
AlertDialog alertDialog = new AlertDialog.Builder(this)
.setTitle("New Version Available")
.setMessage("Please update to new version to continue use")
.setPositiveButton("UPDATE", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(UpdateActivity.this, ""+urlApp,Toast.LENGTH_SHORT).show();
}
}).setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).create();
alertDialog.show();
}
}
@@ -1,60 +0,0 @@
package com.gpr.gabinetedigital;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class UpdateApp extends AsyncTask<String,Void,Void> {
private Context context;
public void setContext(Context contextf){
context = contextf;
}
@Override
protected Void doInBackground(String... arg0) {
try {
URL url = new URL(arg0[0]);
HttpURLConnection c = (HttpURLConnection) url.openConnection();
c.setRequestMethod("GET");
c.setDoOutput(true);
c.connect();
String PATH = "/mnt/sdcard/Download/";
File file = new File(PATH);
file.mkdirs();
File outputFile = new File(file, "update.apk");
if(outputFile.exists()){
outputFile.delete();
}
FileOutputStream fos = new FileOutputStream(outputFile);
InputStream is = c.getInputStream();
byte[] buffer = new byte[1024];
int len1 = 0;
while ((len1 = is.read(buffer)) != -1) {
fos.write(buffer, 0, len1);
}
fos.close();
is.close();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File("/mnt/sdcard/Download/update.apk")), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // without this flag android returned a intent error!
context.startActivity(intent);
} catch (Exception e) {
Log.e("UpdateAPP", "Update error! " + e.getMessage());
}
return null;
}
}
@@ -1,82 +0,0 @@
package com.gpr.gabinetedigital;
import android.content.Context;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
public class UpdateHelper {
public static String KEY_UPDATE_ENABLE = "is_update";
public static String KEY_UPDATE_VERSION = "version";
public static String KEY_UPDATE_URL = "update_url";
public interface onUpdateCheckListener {
void onUpdateCheckListener(String urlApp);
}
public static Builder with(Context context) {
return new Builder(context);
}
private onUpdateCheckListener onUpdateCheckListener;
private Context context;
public UpdateHelper(Context context, UpdateHelper.onUpdateCheckListener onUpdateCheckListener) {
this.onUpdateCheckListener = onUpdateCheckListener;
this.context = context;
}
public void check() {
FirebaseRemoteConfig remoteconfig = FirebaseRemoteConfig.getInstance();
if(remoteconfig.getBoolean(KEY_UPDATE_ENABLE)) {
String currentVersion = remoteconfig.getString(KEY_UPDATE_VERSION);
String appVersion = getAppVersion(context);
String updateURL = remoteconfig.getString(KEY_UPDATE_URL);
if(!TextUtils.equals(currentVersion,appVersion) && onUpdateCheckListener != null)
onUpdateCheckListener.onUpdateCheckListener(updateURL);
}
}
private String getAppVersion(Context context) {
String result ="";
try {
result = context.getPackageManager().getPackageInfo(context.getPackageName(), 0)
.versionName;
result = result.replaceAll("[a-ZA-Z] |-", "");
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return result;
}
public static class Builder {
private Context context;
private onUpdateCheckListener onUpdateCheckListener;
public Builder(Context context) {
this.context = context;
}
public Builder onUpdateCheck(onUpdateCheckListener onUpdateCheckListener) {
this.onUpdateCheckListener = onUpdateCheckListener;
return this;
}
public UpdateHelper build() {
return new UpdateHelper(context, onUpdateCheckListener);
}
public UpdateHelper check() {
UpdateHelper updateHelper = build();
updateHelper.check();
return updateHelper;
}
}
}
+3 -3
View File
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists