This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Irineu333/release/v1.0.4
Release/v1.0.4 feat : added github repository link feat : title span art feat : improving highlighting feat : added visual editor #5
- Loading branch information
Showing
104 changed files
with
2,964 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "883298988094", | ||
"firebase_url": "https://fbrules333-default-rtdb.firebaseio.com", | ||
"project_id": "fbrules333", | ||
"storage_bucket": "fbrules333.appspot.com" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:883298988094:android:d708344cb9fa3f75a5216f", | ||
"android_client_info": { | ||
"package_name": "com.neo.fbrules" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "883298988094-vnrglb8tc2hbuh5an8en66iveskah0p1.apps.googleusercontent.com", | ||
"client_type": 1, | ||
"android_info": { | ||
"package_name": "com.neo.fbrules", | ||
"certificate_hash": "f4c55227b596437058d76090992f70e66b460181" | ||
} | ||
}, | ||
{ | ||
"client_id": "883298988094-n81d26v04dbo34d02n7h31pfitln31lf.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyA9nHPhOFQwI2nEMb0JgTC_QSjnnJHq5js" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "883298988094-n81d26v04dbo34d02n7h31pfitln31lf.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:883298988094:android:c466a916f8935269a5216f", | ||
"android_client_info": { | ||
"package_name": "com.neo.fbrules.dev" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "883298988094-n81d26v04dbo34d02n7h31pfitln31lf.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyA9nHPhOFQwI2nEMb0JgTC_QSjnnJHq5js" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "883298988094-n81d26v04dbo34d02n7h31pfitln31lf.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<background android:drawable="@color/ic_launcher_background"/> | ||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
</adaptive-icon> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package com.neo.fbrules.core | ||
|
||
import androidx.annotation.StringRes | ||
import com.neo.fbrules.R | ||
|
||
object Constants { | ||
const val FIREBASE_RULES = ".settings/rules.json" | ||
|
||
enum class ERROR(val message: String) { | ||
CREDENTIAL_NOT_FOUND("Credenciais de acesso não configuradas"), | ||
UNKNOWN_ERROR("Erro não especificado"), | ||
enum class ERROR(@StringRes val message: Int) { | ||
CREDENTIAL_NOT_FOUND(R.string.credentials_not_found), | ||
UNKNOWN_ERROR(R.string.unknown_error), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.neo.fbrules.core | ||
|
||
import java.util.regex.Pattern | ||
|
||
object Expression { | ||
val variableInProperty: Pattern = Pattern.compile("((?<=/)|^)\\$\\w+(?=/?)$") | ||
val variableInCondition: Pattern = Pattern.compile("\\$\\w+(?=/?)$") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.neo.fbrules.core | ||
|
||
import android.content.Context | ||
import androidx.annotation.StringRes | ||
import androidx.fragment.app.Fragment | ||
import com.google.firebase.crashlytics.ktx.crashlytics | ||
import com.google.firebase.ktx.Firebase | ||
import com.neo.fbrules.R | ||
import com.neo.fbrules.util.showAlertDialog | ||
|
||
|
||
fun Fragment.handlerError(type: ERROR, throwable: Throwable? = null) = | ||
requireContext().handlerError(type, throwable) | ||
|
||
fun Context.handlerError(type: ERROR, throwable: Throwable? = null) { | ||
|
||
@StringRes | ||
val errorMessage = when (type) { | ||
|
||
ERROR.INVALID_RULES -> { | ||
R.string.text_visualRules_invalidRulesError | ||
} | ||
|
||
ERROR.UNRECOGNIZED_RULES -> { | ||
R.string.text_visualRules_unrecognizedRuleError | ||
} | ||
|
||
ERROR.INVALID_JSON -> { | ||
R.string.text_visualRules_invalidRulesError_invalidJsonError | ||
} | ||
} | ||
|
||
showAlertDialog(this, "Error", getString(errorMessage)) { | ||
if (throwable != null) { | ||
negativeButton("log") { | ||
showAlertDialog( | ||
this@handlerError, | ||
"Error", | ||
getString(errorMessage) + "\n\n" + throwable.message | ||
) | ||
} | ||
} | ||
} | ||
|
||
if (throwable != null) { | ||
Firebase.crashlytics.recordException(throwable) | ||
} | ||
} | ||
|
||
enum class ERROR { | ||
UNRECOGNIZED_RULES, | ||
INVALID_RULES, | ||
INVALID_JSON | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
app/src/main/java/com/neo/fbrules/core/constants/Highlighting.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.neo.fbrules.core.constants | ||
|
||
import android.content.Context | ||
import com.neo.fbrules.R | ||
import com.neo.fbrules.util.getCompatColor | ||
import com.neo.fbrules.util.requestColor | ||
import com.neo.highlight.util.scheme.ColorScheme | ||
import java.util.regex.Pattern | ||
|
||
class Highlighting(context: Context) { | ||
|
||
val propertySyntax = listOf( | ||
ColorScheme( | ||
Pattern.compile("(\\.read|\\.write)"), | ||
context.theme.requestColor(R.attr.colorAccent) | ||
) | ||
) | ||
|
||
val conditionSyntax = listOf( | ||
ColorScheme( | ||
Pattern.compile("(?<=auth\\.)uid|auth"), | ||
context.theme.requestColor(R.attr.colorAccent) | ||
), | ||
ColorScheme( | ||
Pattern.compile("===|==|!="), | ||
context.theme.requestColor(R.attr.colorPrimary) | ||
), | ||
ColorScheme( | ||
Pattern.compile("(true|false|null)"), | ||
context.requestColor(R.color.syntax_literal) | ||
), | ||
ColorScheme( | ||
Pattern.compile("(\"[^\"]*\")|('[^']*')"), | ||
context.requestColor(R.color.syntax_string) | ||
) | ||
) | ||
|
||
val completeSyntax = listOf( | ||
ColorScheme( | ||
Pattern.compile("(?<!\\w)(true|false|null)(?!\\w)"), | ||
context.getCompatColor(R.color.syntax_literal) | ||
), | ||
ColorScheme( | ||
Pattern.compile("\"[^\"]*\""), | ||
context.getCompatColor(R.color.syntax_string) | ||
), | ||
propertySyntax[0], | ||
ColorScheme( | ||
Pattern.compile("(?<=auth\\.)uid|auth"), | ||
context.theme.requestColor(R.attr.colorAccent) | ||
), | ||
ColorScheme( | ||
Pattern.compile("===|==|!="), | ||
context.theme.requestColor(R.attr.colorPrimary) | ||
), | ||
ColorScheme( | ||
Pattern.compile("\\$\\w+"), | ||
context.requestColor(R.color.syntax_variable) | ||
), | ||
ColorScheme( | ||
Pattern.compile("[/]{2}.*"), | ||
context.getCompatColor(R.color.syntax_comment) | ||
) | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/neo/fbrules/main/domain/model/DomainCredential.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
package com.neo.fbrules.main.domain.model | ||
|
||
import com.neo.fbrules.main.data.model.DataCredential | ||
|
||
data class DomainCredential( | ||
var privateKey: String, | ||
var databaseKey: String | ||
) | ||
|
||
fun DomainCredential.toData(): DataCredential { | ||
return DataCredential( | ||
privateKey = privateKey, | ||
databaseKey = databaseKey | ||
) | ||
} |
6 changes: 0 additions & 6 deletions
6
app/src/main/java/com/neo/fbrules/main/domain/model/HistoricModel.kt
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
app/src/main/java/com/neo/fbrules/main/domain/model/parse.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.