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

Implement Secrets Vault Plugin #2

Merged
merged 31 commits into from
Aug 9, 2023
Merged

Implement Secrets Vault Plugin #2

merged 31 commits into from
Aug 9, 2023

Conversation

azizutku
Copy link
Contributor

  • Set up initial project
  • Add detekt
  • Add CPP resources and CMakeLists.txt
  • Add initial kotlin file for secrets
  • Implement task that unzip plugin to temp folder
  • Implement utility methods
  • Implement code generator methods
  • Add capitalize extension function to capitalize the first character
  • Add kotlinx serialization dependency
  • Implement keep secrets task
  • Register KeepSecretsTask to the plugin
  • Generate obfuscation key randomly
  • Add CHANGELOG.md
  • Add README.md
  • Create build workflow

@azizutku azizutku requested review from agabeyalioglu and burakaygun and removed request for agabeyalioglu and burakaygun May 23, 2023 07:34
@oguzgu oguzgu requested review from opsenes and removed request for agabeyalioglu May 23, 2023 07:35
.github/workflows/build.yml Outdated Show resolved Hide resolved
@azizutku azizutku self-assigned this May 23, 2023
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
* @return the destination file for the CPP code
*/
private fun getCppDestination(flavor: String, fileName: String): File {
return project.file(SOURCE_SET_TEMPLATE.format(flavor, "cpp") + fileName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since project.layout.file returns provider, it is generally preferred(Of course providers can be used If we inject these as input/output)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this specific case, we don't have a Provider readily available, and so we cannot use project.layout.file. The method project.file is suitable in our current context, where we have a file path represented as a String.

*
* @return the package name of the Android app
*/
private fun getAppPackageName(): String {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think most of these methods would be better if they were defined as input/output properties

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved these methods to the plugin extension.

* @return a string containing the generated C++ code for app signature check
*/
fun getAppSignatureCheck(appSignatures: List<String>): String {
val signatures = appSignatures.joinToString(separator = "") { " $it,\n" }.trimEnd(',', '\n')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ " $it,\n" }
can we use \t instead of whitespaces?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use spaces for indentation as the size of a tab character can vary between different IDEs, potentially leading to inconsistent formatting. Using spaces ensures that our code looks the same everywhere.

alias(libs.plugins.gradle.publish).apply(false)
alias(libs.plugins.detekt).apply(false)
alias(libs.plugins.kotlin.serialization).apply(false)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

import java.io.IOException
import java.nio.charset.Charset

private const val SOURCE_SET_TEMPLATE = "src/%1\$s/%2\$s/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

@azizutku azizutku merged commit f3c5ddf into main Aug 9, 2023
1 check passed
@azizutku azizutku deleted the develop branch August 9, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants