From 29f2bf7457eff075629d41ab623c9bde3521c1e7 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Fri, 5 Feb 2021 01:13:57 +0100 Subject: [PATCH] Test release Added screenshot package --- .github/workflows/staging.yml | 5 ++ Gemfile.lock | 18 +++--- android/app/build.gradle | 12 ++-- android/app/src/main/AndroidManifest.xml | 21 ++----- fastlane/Appfile | 3 +- fastlane/Fastfile | 75 ++++++++++++++--------- fastlane/Pluginfile | 1 + ios/Podfile.lock | 14 +++-- package.json | 5 +- src/Screens.tsx | 25 ++++++-- src/components/Button.tsx | 14 ++--- src/components/Hashtag.tsx | 8 +-- src/components/Instance.tsx | 4 +- src/components/Timelines/Timeline.tsx | 8 ++- src/i18n/en/common.ts | 5 ++ src/i18n/en/screens/sharedToot.ts | 2 +- src/i18n/zh-Hans/common.ts | 5 ++ src/screens/Compose.tsx | 1 + src/screens/Compose/Root.tsx | 4 +- src/screens/ImagesViewer.tsx | 18 ++---- src/screens/Tabs/Me/Switch.tsx | 4 +- src/screens/Tabs/Me/Switch/Root.tsx | 2 +- src/screens/Tabs/Shared/Hashtag.tsx | 2 - src/screens/Tabs/Shared/sharedScreens.tsx | 9 ++- src/startup/preventScreenshot.ts | 9 +++ yarn.lock | 14 +++++ 26 files changed, 179 insertions(+), 109 deletions(-) create mode 100644 src/startup/preventScreenshot.ts diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 2a1a1da1..1829bb7f 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -41,5 +41,10 @@ jobs: APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} + ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} + ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} + ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} + SUPPLY_JSON_KEY_DATA: ${{ secrets.SUPPLY_JSON_KEY_DATA }} FL_GITHUB_RELEASE_API_BEARER: ${{ secrets.GITHUB_TOKEN }} run: yarn app:build diff --git a/Gemfile.lock b/Gemfile.lock index ee2c18d3..ad8060fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,16 +8,16 @@ GEM atomos (0.1.3) aws-eventstream (1.1.0) aws-partitions (1.422.0) - aws-sdk-core (3.111.2) + aws-sdk-core (3.112.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.41.0) - aws-sdk-core (~> 3, >= 3.109.0) + aws-sdk-kms (1.42.0) + aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.87.0) - aws-sdk-core (~> 3, >= 3.109.0) + aws-sdk-s3 (1.88.0) + aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) aws-sigv4 (1.2.2) @@ -36,7 +36,7 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.7.6) emoji_regex (3.2.1) - excon (0.78.1) + excon (0.79.0) faraday (1.3.0) faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) @@ -47,8 +47,8 @@ GEM faraday-net_http (1.0.1) faraday_middleware (1.0.0) faraday (~> 1.0) - fastimage (2.2.1) - fastlane (2.172.0) + fastimage (2.2.2) + fastlane (2.173.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) artifactory (~> 3.0) @@ -86,6 +86,7 @@ GEM xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) fastlane-plugin-json (1.0.0) + fastlane-plugin-versioning_android (0.1.0) fastlane-plugin-yarn (1.2) gh_inspector (1.1.3) google-api-client (0.38.0) @@ -199,6 +200,7 @@ PLATFORMS DEPENDENCIES fastlane fastlane-plugin-json + fastlane-plugin-versioning_android fastlane-plugin-yarn BUNDLED WITH diff --git a/android/app/build.gradle b/android/app/build.gradle index 2f3bfb6c..614fd5c9 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -135,8 +135,12 @@ android { applicationId 'com.xmflsct.app.tooot' minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 4 - versionName "0.1.0" + versionCode 50 + versionName "0.2" + manifestPlaceholders = [ + expoSDK: project.hasProperty('expoSDK') ? project.property('expoSDK') : "", + releaseChannel: project.hasProperty('releaseChannel') ? project.property('releaseChannel') : "default" + ] } splits { abi { @@ -161,7 +165,7 @@ android { release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. - signingConfig signingConfigs.debug + // signingConfig signingConfigs.debug minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } @@ -218,4 +222,4 @@ task copyDownloadableDepsToLibs(type: Copy) { apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) -apply plugin: 'com.google.gms.google-services' \ No newline at end of file +apply plugin: 'com.google.gms.google-services' diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index b8e1e673..0d4fc71c 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,26 +1,13 @@ - + - - - - - - - - - - - - - - + + @@ -57,6 +46,4 @@ - - diff --git a/fastlane/Appfile b/fastlane/Appfile index d2a7a9de..0ee0afec 100644 --- a/fastlane/Appfile +++ b/fastlane/Appfile @@ -1 +1,2 @@ -app_identifier "com.xmflsct.app.tooot" \ No newline at end of file +app_identifier "com.xmflsct.app.tooot" +package_name "com.xmflsct.app.tooot" \ No newline at end of file diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 7c716067..24a22ab1 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,4 +1,4 @@ -fastlane_version "2.172.0" +fastlane_version "2.173.0" skip_docs ensure_env_vars( @@ -15,7 +15,7 @@ case ENVIRONMENT when "development" GITHUB_RELEASE= "" when "staging" - GITHUB_RELEASE = "v#{VERSION} (#{BUILD_NUMBER})" + GITHUB_RELEASE = "v#{VERSION}(#{BUILD_NUMBER})" when "production" GITHUB_RELEASE = "v#{VERSION}" end @@ -26,20 +26,23 @@ EXPO_PLIST = "./ios/tooot/Supporting/Expo.plist" desc "IOS: Prepare app store" private_lane :prepare_appstore_ios do - case ENVIRONMENT - when "staging", "production" - increment_build_number( xcodeproj: XCODEPROJ, build_number: BUILD_NUMBER ) - app_store_connect_api_key - end + set_info_plist_value( path: INFO_PLIST, key: "CFBundleShortVersionString", value: VERSION ) + increment_build_number( xcodeproj: XCODEPROJ, build_number: BUILD_NUMBER ) + app_store_connect_api_key end -desc 'IOS: Update version information' -private_lane :update_versions_ios do - set_info_plist_value( path: INFO_PLIST, key: "CFBundleShortVersionString", value: VERSION ) +desc 'IOS: Update expo information' +private_lane :update_expo_ios do set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesSDKVersion", value: VERSIONS[:expo] ) set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesReleaseChannel", value: RELEASE_CHANNEL ) end +desc "ANDROID: Prepare play store" +private_lane :prepare_playstore_android do + android_set_version_name( version_name: VERSION, gradle_file: "./android/app/build.gradle" ) + android_set_version_code( version_code: BUILD_NUMBER, gradle_file: "./android/app/build.gradle" ) +end + desc "Create new GitHub release" private_lane :github_release do case ENVIRONMENT @@ -67,8 +70,7 @@ desc "Build and deploy iOS app" private_lane :build_ios do BUILD_DIRECTORY = "./ios/build" - update_versions_ios - prepare_appstore_ios + update_expo_ios setup_ci case ENVIRONMENT @@ -77,6 +79,7 @@ private_lane :build_ios do build_ios_app( export_method: "development", output_directory: BUILD_DIRECTORY, output_name: "#{VERSION}-#{BUILD_NUMBER}" ) install_on_device( skip_wifi: true ) when "staging" + prepare_appstore_ios match( type: "appstore", readonly: true ) build_ios_app( export_method: "app-store" ) upload_to_testflight( @@ -86,6 +89,7 @@ private_lane :build_ios do changelog: "Ready for testing" ) when "production" + prepare_appstore_ios match( type: "appstore", readonly: true ) build_ios_app( export_method: "app-store" ) end @@ -93,32 +97,43 @@ end desc "Build and deploy Android app" private_lane :build_android do + sh("echo #{ENV["ANDROID_KEYSTORE"]} | base64 -d | tee #{File.expand_path('..', Dir.pwd)}/android/tooot.jks >/dev/null", log: false) + case ENVIRONMENT when "development" build_android_app( task: 'assemble', - build_type: 'Debug', + build_type: 'debug', + project_dir: "./android" + ) + adb( + command: "install #{lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]}" + ) + when "staging" + prepare_playstore_android + build_android_app( + task: 'clean bundle', + build_type: 'release', project_dir: "./android", + print_command: false, + print_command_output: false, properties: { - "android.injected.signing.store.file" => "keystore.jks", - "android.injected.signing.store.password" => "store_password", - "android.injected.signing.key.alias" => "key_alias", - "android.injected.signing.key.password" => "key_password", + "expoSDK" => VERSIONS[:expo], + "releaseChannel" => RELEASE_CHANNEL, + "android.injected.signing.store.file" => "#{File.expand_path('..', Dir.pwd)}/android/tooot.jks", + "android.injected.signing.store.password" => ENV["ANDROID_KEYSTORE_PASSWORD"], + "android.injected.signing.key.alias" => ENV["ANDROID_KEYSTORE_ALIAS"], + "android.injected.signing.key.password" => ENV["ANDROID_KEYSTORE_KEY_PASSWORD"], } ) - puts lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] - when "staging" - match( type: "appstore", readonly: true ) - build_ios_app( export_method: "app-store" ) - upload_to_testflight( - demo_account_required: true, - distribute_external: true, - groups: "内测用户", - changelog: "Ready for testing" + upload_to_play_store( + track: "alpha", + skip_upload_metadata: true, + skip_upload_changelogs: true, + skip_upload_images: true, + skip_upload_screenshots: true ) when "production" - match( type: "appstore", readonly: true ) - build_ios_app( export_method: "app-store" ) end end @@ -129,7 +144,7 @@ lane :build do else puts("Release #{GITHUB_RELEASE} does not exist. Create new release as well as new native build.") build_ios - # build_android + build_android case ENVIRONMENT when "staging" github_release @@ -137,6 +152,6 @@ lane :build do github_release end end - # expo_release + expo_release rocket end \ No newline at end of file diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 26c71a41..77d7a7ef 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -4,3 +4,4 @@ gem 'fastlane-plugin-yarn' gem 'fastlane-plugin-json' +gem 'fastlane-plugin-versioning_android' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0cae0003..d2315a0a 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -54,6 +54,8 @@ PODS: - UMPermissionsInterface - EXRandom (10.0.0): - React-Core + - EXScreenCapture (3.0.0): + - UMCore - EXSecureStore (9.3.0): - UMCore - EXSplashScreen (0.8.1): @@ -465,7 +467,7 @@ PODS: - UMBarCodeScannerInterface (5.4.0) - UMCameraInterface (5.4.0) - UMConstantsInterface (5.4.0) - - UMCore (6.0.0) + - UMCore (7.0.0) - UMFaceDetectorInterface (5.4.0) - UMFileSystemInterface (5.4.0) - UMFontInterface (5.4.0) @@ -501,6 +503,7 @@ DEPENDENCIES: - EXLocation (from `../node_modules/expo-location/ios`) - EXPermissions (from `../node_modules/expo-permissions/ios`) - EXRandom (from `../node_modules/expo-random/ios`) + - EXScreenCapture (from `../node_modules/expo-screen-capture/ios`) - EXSecureStore (from `../node_modules/expo-secure-store/ios`) - EXSplashScreen (from `../node_modules/expo-splash-screen/ios`) - EXSQLite (from `../node_modules/expo-sqlite/ios`) @@ -554,7 +557,7 @@ DEPENDENCIES: - UMBarCodeScannerInterface (from `../node_modules/unimodules-barcode-scanner-interface/ios`) - UMCameraInterface (from `../node_modules/unimodules-camera-interface/ios`) - UMConstantsInterface (from `../node_modules/unimodules-constants-interface/ios`) - - "UMCore (from `../node_modules/@unimodules/core/ios`)" + - "UMCore (from `../node_modules/expo-screen-capture/node_modules/@unimodules/core/ios`)" - UMFaceDetectorInterface (from `../node_modules/unimodules-face-detector-interface/ios`) - UMFileSystemInterface (from `../node_modules/unimodules-file-system-interface/ios`) - UMFontInterface (from `../node_modules/unimodules-font-interface/ios`) @@ -626,6 +629,8 @@ EXTERNAL SOURCES: :path: "../node_modules/expo-permissions/ios" EXRandom: :path: "../node_modules/expo-random/ios" + EXScreenCapture: + :path: "../node_modules/expo-screen-capture/ios" EXSecureStore: :path: "../node_modules/expo-secure-store/ios" EXSplashScreen: @@ -729,7 +734,7 @@ EXTERNAL SOURCES: UMConstantsInterface: :path: "../node_modules/unimodules-constants-interface/ios" UMCore: - :path: "../node_modules/@unimodules/core/ios" + :path: "../node_modules/expo-screen-capture/node_modules/@unimodules/core/ios" UMFaceDetectorInterface: :path: "../node_modules/unimodules-face-detector-interface/ios" UMFileSystemInterface: @@ -771,6 +776,7 @@ SPEC CHECKSUMS: EXLocation: d55e2a37f61bcfb4eba9c813b3f4621d896c4c00 EXPermissions: 17d4846ad1880f6891c74ae58ca1acb43e47ed47 EXRandom: d7e0f3dd64810aabd27d59f8ecffee359177e2c3 + EXScreenCapture: 5b8447139e56e2b922e93ccdc7c773c103fb44fd EXSecureStore: 1b571851e6068b30b8ec097be848a04603c03bae EXSplashScreen: 8c7c1112ce7611a853486af4737fe2298eda7657 EXSQLite: bda6a286dded0637bb312ee781239dcca163ff4b @@ -838,7 +844,7 @@ SPEC CHECKSUMS: UMBarCodeScannerInterface: 3f6c1b09ef4b867ce752b8c0b3893bcf9cd85f32 UMCameraInterface: d516032121192fee9a6c93bdfff0bb2cc7282796 UMConstantsInterface: 6825ea3832d26ed392ca6eff2df84edd69968fd0 - UMCore: 97ba5041c9c92317ce61739f6d126a692c8ef4a8 + UMCore: a882a262c77a535d46b058c150f957eface073f4 UMFaceDetectorInterface: 60b36b07faa539205efce30b20c192e058b31c23 UMFileSystemInterface: ab01294ce58a3c773aefb4a5b131ce589c199559 UMFontInterface: 85fe1b845fb7caab45e04d9ce47e1677a5ce90a5 diff --git a/package.json b/package.json index df3a805b..7a9dd696 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "expo-linking": "~2.0.1", "expo-localization": "~9.1.0", "expo-random": "~10.0.0", + "expo-screen-capture": "^3.0.0", "expo-secure-store": "~9.3.0", "expo-splash-screen": "~0.8.1", "expo-status-bar": "~1.0.3", @@ -108,8 +109,8 @@ "versions": { "native": "210201", "major": 0, - "minor": 2, + "minor": 3, "patch": 0, "expo": "40.0.0" } -} \ No newline at end of file +} diff --git a/src/Screens.tsx b/src/Screens.tsx index 0708cfa9..e093b5f9 100644 --- a/src/Screens.tsx +++ b/src/Screens.tsx @@ -1,5 +1,5 @@ import client from '@api/client' -import { HeaderLeft } from '@components/Header' +import { HeaderCenter, HeaderLeft } from '@components/Header' import { toast, toastConfig } from '@components/toast' import { NavigationContainer, @@ -17,9 +17,10 @@ import { import { useTheme } from '@utils/styles/ThemeManager' import { themes } from '@utils/styles/themes' import * as Analytics from 'expo-firebase-analytics' +import { addScreenshotListener } from 'expo-screen-capture' import React, { createRef, useCallback, useEffect, useRef } from 'react' import { useTranslation } from 'react-i18next' -import { Platform, StatusBar } from 'react-native' +import { Alert, Platform, StatusBar } from 'react-native' import Toast from 'react-native-toast-message' import { createSharedElementStackNavigator } from 'react-navigation-shared-element' import { useDispatch, useSelector } from 'react-redux' @@ -33,6 +34,7 @@ export interface Props { export const navigationRef = createRef() const Index: React.FC = ({ localCorrupt }) => { + const { t } = useTranslation('common') const dispatch = useDispatch() const localActiveIndex = useSelector(getLocalActiveIndex) const { mode, theme } = useTheme() @@ -56,8 +58,18 @@ const Index: React.FC = ({ localCorrupt }) => { // } // }, [isConnected, firstRender]) + // Prevent screenshot alert + useEffect(() => { + const screenshotListener = addScreenshotListener(() => + Alert.alert(t('screenshot.title'), t('screenshot.message'), [ + { text: t('screenshot.button'), style: 'destructive' } + ]) + ) + Platform.OS === 'ios' && screenshotListener + return () => screenshotListener.remove() + }, []) + // On launch display login credentials corrupt information - const { t } = useTranslation('common') useEffect(() => { const showLocalCorrect = localCorrupt ? toast({ @@ -153,7 +165,12 @@ const Index: React.FC = ({ localCorrupt }) => { component={ScreenAnnouncements} options={{ gestureEnabled: false, - title: t('sharedAnnouncements:heading'), + headerTitle: t('sharedAnnouncements:heading'), + ...(Platform.OS === 'android' && { + headerCenter: () => ( + + ) + }), headerTransparent: true, headerLeft: () => ( = ({ overlay = false, onPress }) => { - const { i18n } = useTranslation() - const { theme } = useTheme() + const { mode, theme } = useTheme() const mounted = useRef(false) useEffect(() => { @@ -67,7 +65,7 @@ const Button: React.FC = ({ ), - [theme] + [mode] ) const colorContent = useMemo(() => { @@ -88,7 +86,7 @@ const Button: React.FC = ({ } } } - }, [theme, disabled]) + }, [mode, disabled]) const colorBorder = useMemo(() => { if (active) { return theme.blue @@ -103,14 +101,14 @@ const Button: React.FC = ({ } } } - }, [theme, loading, disabled]) + }, [mode, loading, disabled]) const colorBackground = useMemo(() => { if (overlay) { return theme.backgroundOverlay } else { return theme.background } - }, [theme]) + }, [mode]) const children = useMemo(() => { switch (type) { @@ -147,7 +145,7 @@ const Button: React.FC = ({ ) } - }, [i18n.language, theme, content, loading, disabled, active]) + }, [mode, content, loading, disabled, active]) enum spacingMapping { XS = 'S', diff --git a/src/components/Hashtag.tsx b/src/components/Hashtag.tsx index 43c606a5..ebc45430 100644 --- a/src/components/Hashtag.tsx +++ b/src/components/Hashtag.tsx @@ -28,10 +28,7 @@ const ComponentHashtag: React.FC = ({ }, []) return ( - + #{hashtag.name} @@ -41,8 +38,7 @@ const ComponentHashtag: React.FC = ({ const styles = StyleSheet.create({ itemDefault: { - padding: StyleConstants.Spacing.S * 1.5, - borderBottomWidth: StyleSheet.hairlineWidth + padding: StyleConstants.Spacing.S * 1.5 }, itemHashtag: { ...StyleConstants.FontStyle.M diff --git a/src/components/Instance.tsx b/src/components/Instance.tsx index 933fd2f9..a1362352 100644 --- a/src/components/Instance.tsx +++ b/src/components/Instance.tsx @@ -33,7 +33,7 @@ const ComponentInstance: React.FC = ({ disableHeaderImage, goBack = false }) => { - const { t } = useTranslation('componentInstance') + const { t, i18n } = useTranslation('componentInstance') const { theme } = useTheme() const navigation = useNavigation() @@ -136,7 +136,7 @@ const ComponentInstance: React.FC = ({ case 'remote': return t('server.button.remote') } - }, []) + }, [i18n.language]) const requestAuth = useMemo(() => { if ( diff --git a/src/components/Timelines/Timeline.tsx b/src/components/Timelines/Timeline.tsx index a96dcad8..8033c95f 100644 --- a/src/components/Timelines/Timeline.tsx +++ b/src/components/Timelines/Timeline.tsx @@ -164,7 +164,13 @@ const Timeline: React.FC = ({ { isSwipeDown.current = true diff --git a/src/i18n/en/common.ts b/src/i18n/en/common.ts index 51977014..532f83bc 100644 --- a/src/i18n/en/common.ts +++ b/src/i18n/en/common.ts @@ -1,4 +1,9 @@ export default { + screenshot: { + title: 'Privacy Protection', + message: 'Please do not disclose other user\'s identity, such as username, avatar, etc. Thank you!', + button: 'Confirm' + }, index: { localCorrupt: 'Login expired, please login again' }, diff --git a/src/i18n/en/screens/sharedToot.ts b/src/i18n/en/screens/sharedToot.ts index 7b3f89bb..0e5766d8 100644 --- a/src/i18n/en/screens/sharedToot.ts +++ b/src/i18n/en/screens/sharedToot.ts @@ -1,3 +1,3 @@ export default { - heading: 'Direct messages' + heading: 'Discussions' } diff --git a/src/i18n/zh-Hans/common.ts b/src/i18n/zh-Hans/common.ts index 4c42661b..fe83d8db 100644 --- a/src/i18n/zh-Hans/common.ts +++ b/src/i18n/zh-Hans/common.ts @@ -1,4 +1,9 @@ export default { + screenshot: { + title: '隐私保护', + message: '请确保不要泄露其它用户的敏感信息,例如用户名、头像等,谢谢!', + button: '好的' + }, index: { localCorrupt: '登录已过期,请重新登录' }, diff --git a/src/screens/Compose.tsx b/src/screens/Compose.tsx index 8acdb987..74a625d8 100644 --- a/src/screens/Compose.tsx +++ b/src/screens/Compose.tsx @@ -231,6 +231,7 @@ const ScreenCompose: React.FC = ({ { const listItem = useCallback( ({ item, index }) => ( navigation.setOptions({ headerTitle: () => ( - - {currentIndex + 1} / {imageUrls.length} - + ), headerRight: () => ( > = ({ navigation }) => { const { t } = useTranslation() return ( diff --git a/src/screens/Tabs/Me/Switch/Root.tsx b/src/screens/Tabs/Me/Switch/Root.tsx index 873de3c2..15b4261b 100644 --- a/src/screens/Tabs/Me/Switch/Root.tsx +++ b/src/screens/Tabs/Me/Switch/Root.tsx @@ -45,8 +45,8 @@ const AccountButton: React.FC = ({ instance, disabled = false }) => { onPress={() => { haptics('Light') analytics('switch_existing_press') - dispatch(localUpdateActiveIndex(instance)) queryClient.clear() + dispatch(localUpdateActiveIndex(instance)) navigation.goBack() }} /> diff --git a/src/screens/Tabs/Shared/Hashtag.tsx b/src/screens/Tabs/Shared/Hashtag.tsx index cfb49fd9..08670992 100644 --- a/src/screens/Tabs/Shared/Hashtag.tsx +++ b/src/screens/Tabs/Shared/Hashtag.tsx @@ -2,8 +2,6 @@ import Timeline from '@components/Timelines/Timeline' import React from 'react' import { SharedHashtagProp } from './sharedScreens' -// Show remote hashtag? Only when private, show local version? - const TabSharedHashtag: React.FC = ({ route: { params: { hashtag } diff --git a/src/screens/Tabs/Shared/sharedScreens.tsx b/src/screens/Tabs/Shared/sharedScreens.tsx index fa688387..4cfaffa1 100644 --- a/src/screens/Tabs/Shared/sharedScreens.tsx +++ b/src/screens/Tabs/Shared/sharedScreens.tsx @@ -136,7 +136,14 @@ const sharedScreens = ( name='Tab-Shared-Hashtag' component={TabSharedHashtag} options={({ route, navigation }: SharedHashtagProp) => ({ - title: `#${decodeURIComponent(route.params.hashtag)}`, + headerTitle: `#${decodeURIComponent(route.params.hashtag)}`, + ...(Platform.OS === 'android' && { + headerCenter: () => ( + + ) + }), headerLeft: () => navigation.goBack()} /> })} />, diff --git a/src/startup/preventScreenshot.ts b/src/startup/preventScreenshot.ts new file mode 100644 index 00000000..3c6550ca --- /dev/null +++ b/src/startup/preventScreenshot.ts @@ -0,0 +1,9 @@ +import { preventScreenCaptureAsync } from 'expo-screen-capture' +import log from './log' + +const preventScreenshot = () => { + log('log', 'Screenshot', 'preventing') + preventScreenCaptureAsync() +} + +export default preventScreenshot diff --git a/yarn.lock b/yarn.lock index 1ce7e416..57b030f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2630,6 +2630,13 @@ dependencies: compare-versions "^3.4.0" +"@unimodules/core@~7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@unimodules/core/-/core-7.0.0.tgz#0311a9c7c0a661368ceef8891f758eb2e166bdf4" + integrity sha512-hKxNN6ad2VmmJqB3i1C8IJe27TcchY7YAKpkQhshjPxso61f7iM7AUFeG4vcU1vPH5d/X4Vk1ds8bWxaxg7nnw== + dependencies: + compare-versions "^3.4.0" + "@unimodules/react-native-adapter@~5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@unimodules/react-native-adapter/-/react-native-adapter-5.7.0.tgz#c5b7c660c5c69e77a7baeaed62be73cfe18dd7b0" @@ -4565,6 +4572,13 @@ expo-random@~10.0.0: dependencies: base64-js "^1.3.0" +expo-screen-capture@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/expo-screen-capture/-/expo-screen-capture-3.0.0.tgz#c35a94acca4274a0ea67c8e09e0b39c19fecc0a6" + integrity sha512-TXLIH/NcuMPNT5dUGKWdwZtBhA+N17A3cFk1cICHlalerGU5uyRYJalaJAY+U+WwAEpOAIehfonv1Qa87W58Nw== + dependencies: + "@unimodules/core" "~7.0.0" + expo-secure-store@~9.3.0: version "9.3.0" resolved "https://registry.yarnpkg.com/expo-secure-store/-/expo-secure-store-9.3.0.tgz#b716d5d115cc50a34037d1afef84fe4b8ea0745c"