Android 권한 요청

 

https://github.com/yanzhenjie/AndPermission

 

    public void requestPermission(String... permissions) {

        AndPermission.with(this)

                .permission(permissions)

                .rationale(mRationale)

                .onGranted(new Action() {

                    @Override

                    public void onAction(List<String> permissions) {

                        toast(R.string.successfully);

                    }

                })

                .onDenied(new Action() {

                    @Override

                    public void onAction(@NonNull List<String> permissions) {

                        toast(R.string.failure);

                        if (AndPermission.hasAlwaysDeniedPermission(MainActivity.this, permissions)) {

                            mSetting.showSetting(permissions);

                        }

                    }

                })

                .start();

    }

 

 

https://developer.android.com/reference/android/Manifest.permission.html

"android.permission.CAMERA"

"android.permission.READ_EXTERNAL_STORAGE"

"android.permission.WRITE_EXTERNAL_STORAGE"

 

.

.

.

 

숫자 코스프레는 종료한다.

 

뭐... 이미지 메이킹이니 코스프레라고 하는 사람이 있어서 잠깐 했었다.

 

SNS로 이렇게 negative하게 이미지 메이킹 하는 사람이 있을까?

 

다 읽을 자신 없으면 툭툭 던지지나 말던가 ㅋㅋ

 

사람들 계속 만나다 보니 커피 사냐 술사랴 밥사랴 돈만 나간다.

 

영업직도 아니고,

 

그럴 필요도 없는데.

 

강의하며 배움에 순수한 학생들이나 찾고

 

오버워치하며

 

가족과 시간을 보내야 겠다.

 

쓸대없는 일은 다 줄이고

 

쓸대없는 물건은 다 버려야지.

 

 

FileInputStream fis = new FileInputStream(new File(Path + "/" + fileName));

 

->

 

InputStream inputStream  = mContext.getResources().openRawResource(R.raw.fileName);

 

둘 다 DataInputStream 인자로 들어가기 때문에 편리하다.

 

인터넷 서버에서 받는 파일은 File 형태고, 내장한 파일은 raw에 저장하는게 편리하다.

 

Asset에 저장하면 R.을 쓸 수 없어서 조금 불편하지만 폴더 구조를 여러 파일을

 

내장해서 배포 할 때는 asset이 편하다.

 

String path = "android.resource://" + mContext.getPackageName() + "/" + R.raw.NAME;

 

{00000004} Android fileinputstream 에서 raw 폴더로 변환

 

일본 출장 지원으로 후임과 똥줄타며 디버깅한 30분의 기록

(시료가 최신폰이 없어서 6.0 이상 지원이 안되어 구버전에서는 잘됨, 확인 없이 마켓 업로드 될 수 밖에 없던 상황) -> 뭐 더 신경쓰면 되겠지만 애사심의 문제일 수도... (그러나 그 시료도 개인돈으로 산 폰이라는...)

 

우선 런타임 권한 획득 문제 발생... 앱 시작전 onCreate에

 

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

           requestPermissions(new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"},   1);

       }

 

 

넣어주고 해결... 워낙 급한지라 onCreate이용해서 걍 땜빵함

 

그 다음 libcypto.so 를 찾을 수 없다거나 열 수 없다는 문제.

 

 

       StringBuilder strblibpath = new StringBuilder(128);

       String strlibpath;

       strblibpath.append("/data/data/");

       strblibpath.append(getPackageName());

       strblibpath.append("/lib/lib");

       strblibpath.append("crypto");

       strblibpath.append(".so");

       strlibpath = strblibpath.toString();

       try {

           System.load(strlibpath);

       }

       catch(java.lang.UnsatisfiedLinkError ex){

           ex.printStackTrace();

       }

 

 

컴파일된 arm eabi 용 libcypto.so 는 아래 링크에서 받음.

 

https://github.com/emileb/OpenSSL-for-Android-Prebuilt/tree/master/openssl-1.0.2/armeabi-v7a/lib

 

으로 해결하니 이런 문제가...

 

https://support.google.com/faqs/answer/6376725

 

5시간을 기다려야함 ㅠㅠ

 

Hello Google Play Developer,

We rejected Previewty, with package name net.morpheus3d.shopandroid, for violating our Malicious Behavior or User Data policy. If you submitted an update, the previous version of your app is still available on Google Play.

This app uses software that contains security vulnerabilities for users or allows the collection of user data without proper disclosure.

Below is the list of issues and the corresponding APK versions that were detected in your recent submission. Please upgrade your app(s) as soon as possible and increment the version number of the upgraded APK.

VulnerabilityAPK Version(s)Past Due Date

OpenSSLThe vulnerabilities were addressed in OpenSSL 1.02f/1.01r. To confirm your OpenSSL version, you can do a grep search for:

\$ unzip -p YourApp.apk | strings | grep "OpenSSL"

You can find more information and next steps in this Google Help Center article.

34

July 13, 2016

To confirm you’ve upgraded correctly, submit the updated version of your app to the Play Console and check back after five hours to make sure the warning is gone.

While these vulnerabilities may not affect every app that uses this software, it’s best to stay up to date on all security patches. Make sure to update any libraries in your app that have known security issues, even if you're not sure the issues are relevant to your app.

Apps must also comply with the Developer Distribution Agreement and Developer Program Policies.

If you feel we have made this determination in error, please reach out to our developer support team.

Best,

The Google Play Team

 

https://github.com/ph4r05/android-openssl/blob/master/jni/openssl/arch-armeabi-v7a/lib/libcrypto.so/

 

다시 받음

 

 

 

안드로이드는 iOS와 달리 워낙 공개된 자료가 많아서 문제 해결이 용이하다.

 

그래도 iOS 개발이 편한 것은 아이러니.

 

 

{00000003} 안드로이드 SDK 버전 변경하며 닥친 문제점 2가지

 

블로그 보기

글쓰기

 

eddie HA(으)로 Blogger 사용

모든 라벨

전체(3024개)임시보관(17개)게시됨(3007개)

 

Blogger

하나의 계정으로 모든 Google 서비스를 Blogger로 이동하려면 로그인하세요.

accounts.google.com

 

블로거 글 3000개 중,.. 30% 쓸대없는 것은 지우고 나머지는 이 블로그에 녹여내고 모두 지울 예정.

 

 

'Blog History' 카테고리의 다른 글

225  (0) 2020.05.03
224  (0) 2020.05.03
222  (0) 2020.05.03
220  (0) 2020.05.03
219  (0) 2020.05.03

+ Recent posts