728x90

앱을 업데이트하기 위해 앱번들을 이미 업로드 하였는데,
뒤늦게 수정사항이 발견되어 처리하고 버전 코드를 그대로 하여,
다시 업로드를 하려니 업로드를 실패하였음.

이미 올라간 버전코드 4와 충돌되어 업로드 실패

수정하기 직전에 올라간 앱번들은 쓸모없이 앱번들 탐색기만 복잡하게 만들고,
버전 코드를 다시 수정해서 파일 만들기도 번거롭기 때문에 이미 올라가 있던 앱번들 파일을 삭제하고자 함.

App Bundle 탐색기에서 삭제할 버전 코드 화살표 클릭  >  앱번들 상세 페이지에서 app bundle 삭제.

그런데 앱번들이 이미 사용중이면, 삭제 버튼이 보이지 않음.
프로덕션 버전 만드는 중에 임시저장이라도 되어 있으면, 삭제 버튼이 보이지 않으므로
임시 저장된 프로덕션 버전을 삭제 -임시출시 삭제- 하고, 위를 다시 시도하면 삭제 버튼이 생김.

app bunddle 삭제 버튼으로 앱번들 삭제
app bunddle이 사용중이면 삭제 불가하므로, 임시출시 삭제를 먼저 처리 후 app bunddle 삭제를 시도할 것

반응형
728x90

안드로이드 앱은 구글 플레이 스토어에서, 아이폰 앱은 앱스토어에서 앱을 내리는 방법, 숨기는 방법을 정리함

1. [안드로이드] 구글 플레이 스토어
  1) 플레이 구글 콘솔(https://play.google.com/console)에 접속
  2) 테스트 및 출시 > 고급 설정 > 앱 이용 가능여부 > "출시 안됨" 으로 변경

  3) 혹시 "출시 안됨"이 비활성화 되어 있다면, 게시 개요에서 관리 게시가 활성화 되어 있을 가능성이 큼. 관리 게시 비활성화 후 다시 처리.

 

2. [ios 아이폰] 앱 스토어
  1) 앱스토어 컨넥트 (https://appstoreconnect.apple.com/) 접속
  2) 앱 선택 후, 수익화 > 가격 및 사용 가능 여부 > 맨 하단에 "앱 판매 중단" 클립

반응형
728x90

MAC에서 flutter로 앱을 개발하기 위해서 셋팅하는 과정을 정리함.
일단 flutter를 설치하고 나면 flutter doctor 명령으로 추가적인 필요 사항을 체크할 수 있음.
크게 android studio, xcode, cocoapods를 추가로 설치하면 되는데, 중간중간 삽질이 필요함.

  1. flutter 설치
    1. 다운로드 및 설치
    2. SDK PATH 설정 (shell에 따라 구분)
  2. android Studio 설치
  3. Xcode 설치
  4. cocoapods 설치

1. flutter 설치

  1) 다운로드 및 설치
- flutter 사이트에서 (https://docs.flutter.dev/get-started/install) macOs용으로 다운로드 받음.
- MAC 프로세서에 따라 설치 가능한 버전을 다운로드함. (
Intel Processor or Apple Silicon )
- 다운 받은 압축 파일을 ~/development/ 폴더에 압축 해제하면 되는데, development 폴더 없으면 새로 생성하면 됨.

unzip ~/Downloads/flutter_macos_arm64_3.29.0-stable.zip \ -d ~/development/

또는
mkdir ~/development
cp flutter_macos_arm64_3.29.0-stable.zip ~/development/
unzip ~/development/flutter_macos_arm64_3.29.0-stable.zip

- 이렇게 하면, flutter/Dart의 SDK가 설치 완료되고, 아래의 두 패스를 사용하게 됨.

flutter SDK 패스 : /Users/유저명/development/flutter/bin
Dart SDK 패스 : /Users/유저명/development/flutter/bin/cache/dart-sdk (이건 android-studio에서 사용할 예정)

 

   2) PATH 설정 (shell에 따라 구분)

- 터미널에서 flutter 명령어를 바로 사용할 수 없기 때문에 PATH를 추가해야 함.

- 어떤 shell을 사용하는지에 따라 구분됨.

echo $SHELL   // 쉘 확인

// (1) zsh 쉘이면
vim ~/.zshrc   

    #Flutter PATH 설정 추가
    export PATH="플러터폴더경로/bin:$PATH"

source ~/.zshrc

// (2) bash 쉘이면 .zshrc 대신 .bash_profile 편집하고 적용

- 만약, 쉘이 꼬여서 해당 파일이 없는 경우에는 아래의 방법으로 쉘을 초기화하여 새로 생성하고, flutter 패스 입력함.

touch ~/.zshrc		// .zshrc 파일 생성
echo "export PATH=$PATH" > ~/.zshrc		// PATH 내용 초기화
source ~/.zshrc		// 서버에 적용

- flutter PATH 설정 후 버전 확인

- flutter doctor로 추가로 필요한 목록 확인
- android studio, xcode 설치 필요.



2. android Studio 설치

- https://developer.android.com/studio?hl=ko 에서 MAC용 android Studio 다운로드하여 설치

- android Studio 열어서 Dart, Flutter 패키지 설치.

- android Studio를 설치하였으나 licenses에 동의가 필요함.

flutter doctor --android-licenses

- adroid studio 설정에서 SDK Tools 중 Android SDK Command-line Tools 설치.

- android studio 설치 완료.

 


3. Xcode 설치

- https://developer.apple.com/download/all/  애플 사이트에서 xcode를 설치해야 함.
- MAC 프로세서와 버전에 따라 설치할 수 있는 xcode 버전이 있으므로 주의하여 찾아서 설치함 ( https://developer.apple.com/support/xcode/ )


4. cocoapods 설치

- Xcode를 설치하고서 cocoapods를 추가로 설치해야 함.

- homebrew가 설치되어 있지 않아, 오류 발생
- https://brew.sh/ko/ 사이트에서 설치함

- 여기까지 설치하면 flutter를 실행할 수 있는 준비가 완료됨.

 

[참고] https://docs.flutter.dev/get-started/install/macos/desktop#configure-xcode

[참고] https://wildeveloperetrain.tistory.com/358

[참고] https://semin1127.tistory.com/entry/MACFlutter-%ED%94%8C%EB%9F%AC%ED%84%B0-%EC%B4%88%EA%B8%B0-%EA%B0%9C%EB%B0%9C-%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-%EB%B0%A9%EB%B2%95

반응형
728x90

RHEL 계열 리눅스에서 유용했던 패키지 관리자 yum 의 업그레이드 버전인 dnf 사용법을 정리하고자 함.
yum과 사용법이 크게 차이나지 않음.

> dnf list "패키지명"*
> dnf list all
* 패키지 확인

> dnf install "패키지명"
* 패키지 설치

> dnf update
> dnf upgrade
* 모든 패키지 업데이트 (업그레이드)

> dnf upgrade "패키지명"
* 특정 패키지 업데이트 (업그레이드)

> dnf remove "패키지명"
* 패키지 삭제

> dnf list installed
* 설치된 패키지 확인

> dnf list installed "패키지명"
* 설치된 패키지중 특정 패키지 확인

> dnf list available "패키지명"
* 사용 가능한 패키지중 특정 패키지 확인   

> dnf history list
* dnf 사용기록 리스트

> dnf search "패키지명"
* 특정 패키지명 검색

기본 제공되는 패키지들이 아닌 경우 리포지토리(저장소)를 변경해야 하는 경우가 발생함.
리포지토리를 확인하고, 변경하는 예시를 아래에 작성함.

 

> dnf repolist 
* 설치된 저장소 리스트 확인

** PHP 버전 업그레이드를 예시
> dnf module reset php
* 모듈 상태 초기화

> dnf module list php
* php를 설치할 수 있는 저장소 리스트 확인

> dnf module enable php:remi-8.0
* php를 설치하고자 하는 저장소 활성화

> dnf install php
* 설치시 선택된 php 버전 설치

 

반응형
728x90

flutter 학습을 위해 기록함.
앱을 시작할때 첫 화면, 즉 스플래시를 만들기 위해 flutter_native_splash 패키지를 사용함.

1) 패키지 설치

 

 flutter pub add flutter_native_splash

2) 환경설정 파일 생성
루트 프로젝트 디렉토리에 flutter_native_splash.yaml 파일 생성하여, 아래 내용을 추가함.
- color 값과 image 경로를 원하는대로 설정

flutter_native_splash:
  # This package generates native code to customize Flutter's default white native splash screen
  # with background color and splash image.
  # Customize the parameters below, and run the following command in the terminal:
  # dart run flutter_native_splash:create
  # To restore Flutter's default white splash screen, run the following command in the terminal:
  # dart run flutter_native_splash:remove

  # IMPORTANT NOTE: These parameter do not affect the configuration of Android 12 and later, which
  # handle splash screens differently that prior versions of Android.  Android 12 and later must be
  # configured specifically in the android_12 section below.

  # color or background_image is the only required parameter.  Use color to set the background
  # of your splash screen to a solid color.  Use background_image to set the background of your
  # splash screen to a png image.  This is useful for gradients. The image will be stretch to the
  # size of the app. Only one parameter can be used, color and background_image cannot both be set.
  color: "#42a5f5" // 배경색깔
  #background_image: "assets/background.png"

  # Optional parameters are listed below.  To enable a parameter, uncomment the line by removing
  # the leading # character.

  # The image parameter allows you to specify an image used in the splash screen.  It must be a
  # png file and should be sized for 4x pixel density.
  image: assets/img/splash_768.png   // 스플래시 이미지를 사용할 경우, 주석 풀고 이미지 경로

  # The branding property allows you to specify an image used as branding in the splash screen.
  # It must be a png file. It is supported for Android, iOS and the Web.  For Android 12,
  # see the Android 12 section below.
  #branding: assets/dart.png

  # To position the branding image at the bottom of the screen you can use bottom, bottomRight,
  # and bottomLeft. The default values is bottom if not specified or specified something else.
  #branding_mode: bottom
  
  # Set the branding padding from the bottom of the screen.  The default value is 0
  # (Not supported on web yet)
  # branding_bottom_padding: 24

  # The color_dark, background_image_dark, image_dark, branding_dark are parameters that set the background
  # and image when the device is in dark mode. If they are not specified, the app will use the
  # parameters from above.  If there is no parameter above, the app will use the light mode values.
  # If the image_dark parameter is specified, color_dark or background_image_dark must be specified.  
  # color_dark and background_image_dark cannot both be set.
  #color_dark: "#042a49"
  #background_image_dark: "assets/dark-background.png"
  #image_dark: assets/splash-invert.png
  #branding_dark: assets/dart_dark.png

  # From Android 12 onwards, the splash screen is handled differently than in previous versions.
  # Please visit https://developer.android.com/guide/topics/ui/splash-screen
  # Following are specific parameters for Android 12+.
  android_12:
    # The image parameter sets the splash screen icon image.  If this parameter is not specified,
    # the app's launcher icon will be used instead.
    # Please note that the splash screen will be clipped to a circle on the center of the screen.
    # App icon with an icon background: This should be 960×960 pixels, and fit within a circle
    # 640 pixels in diameter.
    # App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
    # 768 pixels in diameter.  To fit a 1152x1152 image within a circle with a 768 diameter, simply 
    # ensure that the most important design elements of your image are placed within a circular area
    # with a 768 diameter at the center of the 1152x1152 canvas.
    image: assets/img/splash_1152.png  // 스플래시 이미지를 사용할 경우, 주석 풀고 이미지 경로

    # Splash screen background color.
    color: "#42a5f5" // 배경색깔

    # App icon background color.
    #icon_background_color: "#111111"

    # The branding property allows you to specify an image used as branding in the splash screen.
    #branding: assets/dart.png

    # The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that
    # apply when the device is in dark mode. If they are not specified, the app will use the
    # parameters from above.  If there is no parameter above, the app will use the light mode values.
    #image_dark: assets/android12splash-invert.png
    #color_dark: "#042a49"
    #icon_background_color_dark: "#eeeeee"

  # The android, ios and web parameters can be used to disable generating a splash screen on a given
  # platform.
  #android: false
  #ios: false
  #web: false

  # Platform specific images can be specified with the following parameters, which will override
  # the respective parameter.  You may specify all, selected, or none of these parameters:
  #color_android: "#42a5f5"
  #color_dark_android: "#042a49"
  #color_ios: "#42a5f5"
  #color_dark_ios: "#042a49"
  #color_web: "#42a5f5"
  #color_dark_web: "#042a49"
  #image_android: assets/splash-android.png
  #image_dark_android: assets/splash-invert-android.png
  #image_ios: assets/splash-ios.png
  #image_dark_ios: assets/splash-invert-ios.png
  #image_web: assets/splash-web.gif
  #image_dark_web: assets/splash-invert-web.gif
  #background_image_android: "assets/background-android.png"
  #background_image_dark_android: "assets/dark-background-android.png"
  #background_image_ios: "assets/background-ios.png"
  #background_image_dark_ios: "assets/dark-background-ios.png"
  #background_image_web: "assets/background-web.png"
  #background_image_dark_web: "assets/dark-background-web.png"
  #branding_android: assets/brand-android.png
  #branding_bottom_padding_android: 24
  #branding_dark_android: assets/dart_dark-android.png
  #branding_ios: assets/brand-ios.png
  #branding_bottom_padding_ios: 24
  #branding_dark_ios: assets/dart_dark-ios.png
  #branding_web: assets/brand-web.gif
  #branding_dark_web: assets/dart_dark-web.gif

  # The position of the splash image can be set with android_gravity, ios_content_mode, and
  # web_image_mode parameters.  All default to center.
  #
  # android_gravity can be one of the following Android Gravity (see
  # https://developer.android.com/reference/android/view/Gravity): bottom, center,
  # center_horizontal, center_vertical, clip_horizontal, clip_vertical, end, fill, fill_horizontal,
  # fill_vertical, left, right, start, or top. android_gravity can be combined using the | operator to achieve multiple effects. 
  # For example:
  # `android_gravity: fill|clip_vertical` - This will fill the width while maintaining the image's vertical aspect ratio
  #android_gravity: center
  #
  # ios_content_mode can be one of the following iOS UIView.ContentMode (see
  # https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill,
  # scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight,
  # bottomLeft, or bottomRight.
  #ios_content_mode: center
  #
  # web_image_mode can be one of the following modes: center, contain, stretch, and cover.
  #web_image_mode: center

  # The screen orientation can be set in Android with the android_screen_orientation parameter.
  # Valid parameters can be found here:
  # https://developer.android.com/guide/topics/manifest/activity-element#screen
  #android_screen_orientation: sensorLandscape

  # To hide the notification bar, use the fullscreen parameter.  Has no effect in web since web
  # has no notification bar.  Defaults to false.
  # NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads.
  #       To show the notification bar, add the following code to your Flutter app:
  #       WidgetsFlutterBinding.ensureInitialized();
  #       SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top], );
  #fullscreen: true

  # If you have changed the name(s) of your info.plist file(s), you can specify the filename(s)
  # with the info_plist_files parameter.  Remove only the # characters in the three lines below,
  # do not remove any spaces:
  #info_plist_files:
  #  - 'ios/Runner/Info-Debug.plist'
  #  - 'ios/Runner/Info-Release.plist'

3) 패키지를 실행

dart run flutter_native_splash:create

* 단, 파일명이 기본 flutter_native_splash.yaml이 아니면, 아래와 같이 파일명으로 패키지를 실행

dart run flutter_native_splash:create --path=path/my/myfile.yaml

 

*참조 : [공식]https://pub.dev/packages/flutter_native_splash

반응형
728x90

flutter로 개발된 앱일 경우 apk 파일을 추출하여
안드로이드 폰에 직접 설치하고, 테스트를 진행하기 위해 apk 파일을 추출함.

> flutter build apk --release --target-platform=android-arm64

...
√ Built build\app\outputs\flutter-apk\app-release.apk (*.*MB)

프로젝트 폴더로 이동 후에 해당 명령어를 실행하면
해당 폴더 아래에 build\app\outputs\flutter-apk 폴더가 생성되고 apk 파일이 저장됨.

[참조] https://blog.dglee.co.kr/37


테스트를 완료하고 안드로이드 앱을 구글 플레이스토어에 올려서 배포하기 위해서는 다른 형식의 파일이 필요함
aab 파일을 생성해야 함.

반응형
728x90

flutter 학습을 위해 기록함.
안드로이드 앱에서 restful API를 연동하여 데이터 값을 처리하기 위해 필요한 AES-256 암호화 및 복호화 코드


1) flutter 패키지 encrypt 설치

pub global activate encrypt

2) 코드 작성

import 'package:encrypt/encrypt.dart' as encrypt;

class MyCrypt {

  // 암호화
  static String AES_encrypt(String normalData) {
    final key = encrypt.Key.fromUtf8('암호화키로 사용될 32byte 길이의 문자열');
    final iv = encrypt.IV.fromUtf8('IV값으로 사용될 16byte 길이의 문자열');

    final encrypter = encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
    final encrypted = encrypter.encrypt(normalData, iv: iv);
    
    return encrypted.base64;
  }

  // 복호화
  static String AES_decrypt(String encryptedData) {
    final key = encrypt.Key.fromUtf8('암호화키로 사용될 32byte 길이의 문자열');
    final iv = encrypt.IV.fromUtf8('IV값으로 사용될 16byte 길이의 문자열');

    final encrypter = encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
    final decrypted = encrypter.decrypt(encrypt.Encrypted.from64(encryptedData), iv: iv);

    return decrypted;
  }
  
}


// 사용
var encodeData = MyCrypt.AES_encrypt('암호화할 문자열');
var decodeData = MyCrypt.AES_decrypt(encodeData); // 암호화된 문자열

 

3) 팁

iv값의 길이는 암호화키보다 짧으므로, 암호화키 문자열에서 추출하여 사용하는 것도 가능함.
단, 암/복호화에 사용되는 key와 iv값은 동일해야 정상적인 복호화가 됨.

var keyString = '32byte길이의 암호화키 문자열';

final key = encrypt.Key.fromUtf8(keyString);
final iv = encrypt.IV.fromUtf8(keyString.toLowerCase().substring(0, 16));

 

참조
[공식] https://pub.dev/packages/encrypt
https://link2me.tistory.com/2215

 

4) 오류 및 디버깅

Invalid or corrupted pad block using encrypt package

sol.> 암호화키 문자열의 길이에 따라 AES 암호화 방식이 구분됨.
        16byte -> AES-128, 24byte  ->  AES-192, 32byte  ->  AES-256
        키 문자열 길이가 16, 24, 32byte 이중에 하나도 아니면, 에러가 발생함.

* 참조 https://kkh0977.tistory.com/6307

flutter/runtime/dart_vm_initializer.cc(41)] unhandled exception: invalid argument(s): input buffer too short

sol> 서버와 연동을 하려다보니 복호화부터 진행해야 했고, 다시 암호화하려니 위와 같은 에러가 발생함. 이에 대한 원인은 키값의 길이가 맞지 않아서 라고 이미 stackoverflow에서 언급되고 있음.
( https://stackoverflow.com/questions/70817666/invalid-arguments-input-buffer-too-short-and-invalid-or-corrupted-pad-block)
        그런데 암호화 키값, iv값 길이 모두 확인해봐도 이상이 없음.
        결국 찾아낸 원인은 암호화 처리 할때, padding 옵션과 평문의 길이가 매칭되지 않아서 오류가 발생되었음.

final encrypter = encrypt.Encrypter(encrypt.AES(
    encrypt.Key.fromUtf8(encryptKey),
    mode: encrypt.AESMode.cbc,
    padding: null,
));  // 오류가 발생된 코드

      padding: null은 평문의 길이가 16바이트의 배수가 아니면 encrypt 메서드에서 오류가 발생할 수 있다고 함. 해결책은 제거하거나 옵션을 Pkcs7Padding()를 사용하면 됨. 난 제거 했음.

반응형
728x90

일시 : 2022년 10월 초 설악산 정상에 첫눈이 온 다음날 맑고 따뜻한 날

* 자전거 대여소가 있어서, 자전거로 영랑호수 둘레길을 한바퀴 도는 것을 추천함.
   둘레길 중간 중간 철새 관찰대에서 비치된 망원경으로 철새들을 관찰하는 것도 꽤 유익함.

영랑호수윗길 설악산 전경 설명판
영랑호수 부교 입구
영랑호수 부교 입구
영랑호 범바위
영랑호 부교 중앙
영랑호 전경
영랑호 부교 전경
범바위
영랑호 철새
영랑호 철새 망원경

반응형
728x90

일시 : 2022년 10월 초 낮동안 맑고 화창한 날

동해 바다 해변를 끼고 자리한 고성 켄싱턴 리조트(비치)에서 바라본 월출과 일출.

핸드폰 카메라의 자동 모드와 이미지 처리 덕분에 좋은 사진을 남길 수는 있었지만,
실제 눈으로 보는 것만큼 감동적이지는 않음.

반응형
728x90

일시 : 2022년 10월 초 어느 맑은날

DMZ 박물관 방문을 위해서는 민통선 내 위치하여 민통선 검문소를 통과하여야 함.
따라서 통일전망대 출입사무소에서 신고 후 민통선 검문소를 지난 후 방문이 가능함.
결국 고성 통일전망대와 DMZ 박물관을 함께 관람하는 것을 적극 추천함.

통일전망대는 워낙 유명해서 통일전망대만 보고 돌아가는 사람들이 많았는데,
전시물도 훌륭하고, 시설도 깨끗하고, 꽤 의미있는 내용들이 많은 박물관이었음.

DMZ박물관 외관
DMZ 박물관 안내도
DMZ 박물관
DMZ 박물관
DMZ 박물관
DMZ 박물관
DMZ 박물관 야외전시관
DMZ 박물관 철책체험
DMZ 박물관 철책체험

반응형

+ Recent posts