Skip to content

Commit

Permalink
temp+chore: updated in-app review to comply with SDK 14 on Android (#…
Browse files Browse the repository at this point in the history
…10647)

## **Description**

This PR bumps the in-app review package to comply with the updates to 

## **Related issues**

Fixes: #10198 

## **Manual testing steps**

1. Build for Android and see successful submission
2.
3.

## **Screenshots/Recordings**

NA

### **Before**
<img width="1306" alt="Screenshot 2024-08-14 at 3 20 41 PM"
src="https://github.com/user-attachments/assets/8e73151f-835e-4e08-b95e-f2224ec4c27a">

### **After**
<img width="1334" alt="Screenshot 2024-08-14 at 3 43 46 PM"
src="https://github.com/user-attachments/assets/20ff7630-18c0-47bc-af50-50d26fd6b557">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
  • Loading branch information
runway-github[bot] and metamaskbot authored Aug 15, 2024
1 parent 77bf7c6 commit c5fe9cd
Show file tree
Hide file tree
Showing 636 changed files with 10,809 additions and 30,121 deletions.
2 changes: 1 addition & 1 deletion .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = {
'android.emulator': {
type: 'android.emulator',
device: {
avdName: 'Pixel_5_Pro_API_34',
avdName: 'Pixel_5_Pro_API_30',
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion .e2e.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
export MM_TEST_ACCOUNT_SRP='word1 word... word12'
export MM_TEST_ACCOUNT_ADDRESS='0x...'
export MM_TEST_ACCOUNT_PRIVATE_KEY=''
export IS_TEST="true"
export IS_TEST="true"
6 changes: 1 addition & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ module.exports = {
rules: {
// TODO: re-enable
'jsdoc/no-types': 'off',
'react/display-name': 'off',
'react/no-unused-prop-types': 'off',
'react/prop-types': 'off',
'react/self-closing-comp': 'off',
// This change is included in `@metamask/eslint-config-typescript@10.0.0
'@typescript-eslint/no-unused-vars': [
'error',
Expand Down Expand Up @@ -190,5 +186,5 @@ module.exports = {
radix: 0,
},

ignorePatterns: ['wdio.conf.js', 'app/util/termsOfUse/termsOfUseContent.js'],
ignorePatterns: ['wdio.conf.js'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ async function main(): Promise<void> {
// We can't use "GITHUB_TOKEN" here, as its permissions are scoped to the repository where the action is running.
// "GITHUB_TOKEN" does not have access to other repositories, even when they belong to the same organization.
// As we want to get files which are not necessarily located in the same repository,
// we need to create our own "PERSONAL_ACCESS_TOKEN" with "repo" permissions.
// we need to create our own "RELEASE_LABEL_TOKEN" with "repo" permissions.
// Such a token allows to access other repositories of the MetaMask organisation.
const personalAccessToken = process.env.PERSONAL_ACCESS_TOKEN;
const personalAccessToken = process.env.RELEASE_LABEL_TOKEN;
if (!personalAccessToken) {
core.setFailed('PERSONAL_ACCESS_TOKEN not found');
core.setFailed('RELEASE_LABEL_TOKEN not found');
process.exit(1);
}

Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/add-team-label.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Add team label
name: Add team label to PR when it is opened

on:
pull_request:
Expand All @@ -7,6 +7,31 @@ on:

jobs:
add-team-label:
uses: metamask/github-tools/.github/workflows/add-team-label.yml@7c10eb3bafb3f221111a9e4309ae5dcaee171de5
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.RELEASE_LABEL_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- run: corepack enable

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # This is needed to checkout all branches

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn

- name: Install dependencies
run: yarn --immutable

- name: Add team label to PR
id: add-team-label-to-pr
env:
RELEASE_LABEL_TOKEN: ${{ secrets.RELEASE_LABEL_TOKEN }}
run: yarn run add-team-label-to-pr
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
url-to-cladocument: 'https://metamask.io/cla.html'
# This branch can't have protections, commits are made directly to the specified branch.
branch: 'cla-signatures'
allowlist: 'dependabot[bot],metamaskbot,crowdin-bot,runway-github[bot]'
allowlist: 'dependabot[bot],metamaskbot,crowdin-bot'
allow-organization-members: true
blockchain-storage-flag: false
7 changes: 3 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ on:
branches: main
pull_request:


jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
uses: docker/setup-buildx-action@v3

- uses: actions/checkout@v3

- name: Build and load
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
uses: docker/build-push-action@v5
with:
context: .
file: scripts/docker/Dockerfile
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/update-attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
uses: actions/checkout@v4
with:
# Use PAT to ensure that the commit later can trigger status check workflows
token: ${{ secrets.ACTIONS_WRITE_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout pull request
run: gh pr checkout "${PR_NUMBER}"
env:
Expand Down Expand Up @@ -144,6 +144,8 @@ jobs:
git config --global user.email 'metamaskbot@users.noreply.github.com'
git commit -am "Update Attributions"
git push
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_WRITE_TOKEN }}
- name: Post comment
run: |
if [[ $HAS_CHANGES == 'true' ]]
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,3 @@ ccache

# open-rpc/test-coverage
html-report/

# terms of use
app/util/termsOfUse/termsOfUseContent.js
docs/assets/termsOfUse.html
6 changes: 5 additions & 1 deletion .iyarc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# ReDoS vulnerability, no impact to this application, and fix not backported yet to the versions we use

GHSA-c2qf-rxjj-qqgw
GHSA-8hc4-vh64-cxmj

# ip SSRF improper categorization in isPublic, since it only affect dev tools on, and the server is actually a local server, this advisory shouldn't apply to this use cases

GHSA-2p57-rm9w-gvfp
GHSA-8hc4-vh64-cxmj
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- [#10172](https://github.com/MetaMask/metamask-mobile/pull/10172): chore: changelog release automation (#10172)
- [#10282](https://github.com/MetaMask/metamask-mobile/pull/10282): chore: update Android SDK to API Level 34 (#10282)
- [#10241](https://github.com/MetaMask/metamask-mobile/pull/10241): chore: add Sentry snapshot with masked data (#10241)
- [#10305](https://github.com/MetaMask/metamask-mobile/pull/10305): chore: 7.27.0 RC 2 (#10305)
- [#10292](https://github.com/MetaMask/metamask-mobile/pull/10292): chore: cleanup (#10292)
- [#10289](https://github.com/MetaMask/metamask-mobile/pull/10289): chore: Download state logs on login screen (#10289)
- [#10291](https://github.com/MetaMask/metamask-mobile/pull/10291): chore: Update webview to v 14.0.2 (#10291)
- [#10253](https://github.com/MetaMask/metamask-mobile/pull/10253): chore: typescript hooks and base folder coverage (#10253)
Expand Down
52 changes: 39 additions & 13 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apply plugin: "com.facebook.react"
apply plugin: "io.sentry.android.gradle"
apply plugin: 'com.google.gms.google-services'

import com.android.build.OutputFile

/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
Expand All @@ -13,8 +15,8 @@ react {
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
// codegenDir = file("../node_modules/react-native-codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
/* Variants */
Expand Down Expand Up @@ -125,6 +127,14 @@ def getPassword(String currentUser, String keyChain) {
stdout.toString().trim()
}

/**
* Set this to true to create four separate APKs instead of one,
* one for each native architecture. This is useful if you don't
* use App Bundles (https://developer.android.com/guide/app-bundle/)
* and want to have separate APKs to upload to the Play Store.
*/
def enableSeparateBuildPerCPUArchitecture = false

/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
Expand Down Expand Up @@ -153,7 +163,6 @@ def reactNativeArchitectures() {
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}


/**
* Adding function that will retuen the Bitrise ndkPath if it is a QA or Production Build
*/
Expand All @@ -173,8 +182,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1375
versionName "7.28.0"
versionCode 1379
versionName "7.28.1"
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy 'react-native-camera', 'general'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -184,14 +193,6 @@ android {

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libcrypto.so'
pickFirst 'lib/armeabi-v7a/libcrypto.so'
pickFirst 'lib/x86/libcrypto.so'
pickFirst 'lib/x86_64/libcrypto.so'
}

signingConfigs {
Expand Down Expand Up @@ -221,6 +222,15 @@ android {
}
}

splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include (*reactNativeArchitectures())
}
}

buildTypes {
debug {
manifestPlaceholders.isDebug = true
Expand Down Expand Up @@ -260,6 +270,21 @@ android {
it.buildConfigField 'String', 'IS_RAMP_UAT', "\"$System.env.RAMP_INTERNAL_BUILD\""
// Used to point to dev environment API for ramp
it.buildConfigField 'String', 'IS_RAMP_DEV', "\"$System.env.RAMP_DEV_BUILD\""
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}

}
}
}

Expand All @@ -268,6 +293,7 @@ dependencies {
implementation(files("../libs/ecies.aar"))
implementation(files("../libs/nativesdk.aar"))
implementation("com.facebook.react:react-android")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation 'org.apache.commons:commons-compress:1.22'
androidTestImplementation 'org.mockito:mockito-android:4.2.0'
androidTestImplementation 'androidx.test:core:1.5.0'
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
android:theme="@style/AppTheme"
android:hardwareAccelerated="true"
android:usesCleartextTraffic="${isDebug}"
tools:targetApi="33"
tools:targetApi="29"
tools:ignore="GoogleAppIndexingWarning"
android:networkSecurityConfig="@xml/react_native_config"
android:largeHeap="true"
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/java/io/metamask/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void onNewIntent(Intent intent) {
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new DefaultReactActivityDelegate(this, getMainComponentName(), DefaultNewArchitectureEntryPoint.getFabricEnabled()) {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected Bundle getLaunchOptions() {
Bundle initialProperties = new Bundle();
Expand Down
14 changes: 0 additions & 14 deletions android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
import io.metamask.nativesdk.NativeSDKPackage;
import io.metamask.nativeModules.RNTar.RNTarPackage;

import android.content.Context;
import android.content.Intent;
import android.content.BroadcastReceiver;
import android.content.IntentFilter;
import android.os.Build;

public class MainApplication extends Application implements ShareApplication, ReactApplication {

@Override
Expand Down Expand Up @@ -77,14 +71,6 @@ public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}

@Override
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
if (Build.VERSION.SDK_INT >= 34 && getApplicationInfo().targetSdkVersion >= 34) {
return super.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED);
} else {
return super.registerReceiver(receiver, filter);
}
}
@Override
public void onCreate() {
super.onCreate();
Expand Down
11 changes: 6 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
buildscript {

ext {
buildToolsVersion = "34.0.0"
buildToolsVersion = "33.0.0"
minSdkVersion = project.hasProperty('minSdkVersion') ? project.getProperty('minSdkVersion') : 23
compileSdkVersion = 34
targetSdkVersion = 34
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "24.0.8215888"
bitriseNdkPath = "/usr/local/share/android-sdk/ndk-bundle"
kotlin_version = "1.7.22"
kotlin_version = "1.7.0"
kotlinVersion = "$kotlin_version"
supportLibVersion = "28.0.0"
}
Expand All @@ -20,7 +20,8 @@ buildscript {
}

dependencies {
classpath("com.android.tools.build:gradle")
classpath('com.android.tools.build:gradle:7.3.1')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("io.sentry:sentry-android-gradle-plugin:4.2.0")
classpath("com.google.gms:google-services:4.4.2")
Expand Down
4 changes: 1 addition & 3 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.disableAutomaticComponentCreation=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.182.0
FLIPPER_VERSION=0.125.0

# TODO: favour arch options here over cli options
# replace them
Expand All @@ -47,6 +46,5 @@ newArchEnabled=false
hermesEnabled=true

# TODO: explain following config options
# Some of these are depreceated in RN 0.72.15 but when removed the app won't build
android.disableResourceValidation=true
android.enableDexingArtifactTransform.desugaring=false
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
networkTimeout=10000
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c5fe9cd

Please sign in to comment.