마스터Q&A
접속유지
가입하기
안드로이드 Q&A
최근 질문
미답변 질문
태그
사용자
질문하기
마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다.
안드로이드펍
에서 운영하고 있습니다. [
사용법
,
운영진
]
인기있는 태그
초보어플개발
(3427)
안드로이드스튜디오
(2664)
안드로이드-초보어플개발
(1333)
안드로이드-스튜디오
(1086)
도와주세요-
(995)
이미지
(970)
listview
(866)
리스트뷰
(844)
오류
(805)
레이아웃
(693)
fragment
(675)
webview
(670)
구글플레이 등록된 앱으로부터 APK 다운로드
0
추천
구글플레이의 앱이 등록된 URL 이나 Package Name 으로 APK 를 얻을수 있는 방법이 있는지 궁금합니다.
관련자료를 못찾겠어서 질문드립니다..답변부탁드려요 ㅠ
안드로이드
구글플레이
apk
늘순수하게
(
360
포인트)
님이
2016년 4월 19일
질문
Please
log in
or
register
to add a comment.
답변 달기
·
글에 소스 코드 보기 좋게 넣는 법
·
질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
답변이 채택되거나 답변에 댓글이 달리면 이메일로 알려드립니다:
답변이 채택되거나 댓글이 달리면 이메일로 알려드립니다
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면
로그인
하거나 혹은
가입
하세요.
1개의 답변
0
추천
구글 스토어에서 apk extractor 라고 검색하면 많이 나옵니다.
aucd29
(
218,390
포인트)
님이
2016년 4월 19일
답변
혹시 안드로이드 소스코드(자바)로 하는방법은 없을까요!?
/*
* AppList.java
* Copyright 2013 Burke Choi All rights reserved.
*
http://www.sarangnamu.net
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.sarangnamu.apk_extractor;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.WeakHashMap;
import net.sarangnamu.apk_extractor.cfg.Cfg;
import net.sarangnamu.common.BkMath;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.graphics.drawable.Drawable;
public class AppList {
private static AppList mInst;
private WeakHashMap<String, Drawable> mIconMap;
public static AppList getInstance() {
if (mInst == null) {
mInst = new AppList();
}
return mInst;
}
private AppList() {
}
public ArrayList<PkgInfo> getInstalledApps(Context context, String sortBy) {
return getAllApps(context, true, sortBy);
}
public ArrayList<PkgInfo> getAllApps(Context context, boolean hideSystemApp, String sortBy) {
ArrayList<PkgInfo> res = new ArrayList<PkgInfo>();
List<PackageInfo> packs = context.getPackageManager().getInstalledPackages(0);
if (mIconMap == null) {
mIconMap = new WeakHashMap<String, Drawable>();
}
for (int i = 0; i < packs.size(); i++) {
PackageInfo p = packs.get(i);
if (hideSystemApp) {
if ((p.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
continue;
}
}
PkgInfo newInfo = new PkgInfo();
newInfo.appName = p.applicationInfo.loadLabel(context.getPackageManager()).toString();
newInfo.pkgName = p.packageName;
newInfo.versionName = p.versionName;
newInfo.versionCode = p.versionCode;
if (!mIconMap.containsKey(p.packageName)) {
mIconMap.put(p.packageName, p.applicationInfo.loadIcon(context.getPackageManager()).getConstantState().newDrawable());
}
newInfo.icon = mIconMap.get(p.packageName);
newInfo.srcDir = p.applicationInfo.sourceDir;
newInfo.size = new File(p.applicationInfo.sourceDir).length();
newInfo.appSize = BkMath.toFileSizeString(newInfo.size);
newInfo.firstInstallTime = p.firstInstallTime;
res.add(newInfo);
}
if (sortBy.equals(Cfg.SORT_ALPHABET_ASC)) {
Collections.sort(res, new SortByAlphabetAsc());
} else if (sortBy.equals(Cfg.SORT_ALPHABET_DESC)) {
Collections.sort(res, new SortByAlphabetDesc());
} else if (sortBy.equals(Cfg.SORT_FIRST_INSTALL_TIME)) {
Collections.sort(res, new SortByFirstInstallTime());
} else if (sortBy.equals(Cfg.SORT_LAST_INSTALL_TIME)) {
Collections.sort(res, new SortByLastInstallTime());
}
return res;
}
////////////////////////////////////////////////////////////////////////////////////
//
// Comparator
//
////////////////////////////////////////////////////////////////////////////////////
class SortByFirstInstallTime implements Comparator<PkgInfo> {
@Override
public int compare(PkgInfo lhs, PkgInfo rhs) {
if (lhs.firstInstallTime > rhs.firstInstallTime) {
return 1;
} else if (lhs.firstInstallTime < rhs.firstInstallTime) {
return -1;
}
return 0;
}
}
class SortByLastInstallTime implements Comparator<PkgInfo> {
@Override
public int compare(PkgInfo lhs, PkgInfo rhs) {
if (lhs.firstInstallTime < rhs.firstInstallTime) {
return 1;
} else if (lhs.firstInstallTime > rhs.firstInstallTime) {
return -1;
}
return 0;
}
}
class SortByAlphabetAsc implements Comparator<PkgInfo> {
@Override
public int compare(PkgInfo lhs, PkgInfo rhs) {
return lhs.appName.compareTo(rhs.appName);
}
}
class SortByAlphabetDesc implements Comparator<PkgInfo> {
@Override
public int compare(PkgInfo lhs, PkgInfo rhs) {
return rhs.appName.compareTo(lhs.appName);
}
}
////////////////////////////////////////////////////////////////////////////////////
//
// PkgInfo
//
////////////////////////////////////////////////////////////////////////////////////
public static class PkgInfo {
public String appName;
public String pkgName;
public String versionName;
public String appSize;
public String srcDir;
public int versionCode = 0;
public long size;
public Drawable icon;
public long firstInstallTime = 0;
}
}
newInfo.srcDir = p.applicationInfo.sourceDir; 이게 apk 파일 경로이니 해당 경로에서 원하는 경로로 파일을 복사 하면 됩니다.
Please
log in
or
register
to add a comment.
...