Google Play에서 사용자가 다운로드 한 앱 목록 (유료 / 무료)을 얻는 방법은 무엇입니까?
최근에이 앱 구매 앱 이 나타났습니다 . Google 계정으로 로그인 한 후 Google Play에서 지불 한 앱을 검색 할 수 있습니다.
비슷한 앱을 만들고 싶지만 다운로드 된 무료 앱을 위해 어떻게 수행되고 있는지 확인하려고합니다.
그러나 전체 API 목록을 검토 한 후에도 해당 정보를 검색하는 데 사용 된 OAuth API 범위를 찾을 수 없습니다 .
편집 : 비슷한 질문에 의해 제안 나는이 질문에 새로운 현상금을 걸었습니다, 나는에 대해 질문했습니다 여기 , 여기에 있기 때문에 나는 그것을 수행하는, 그리고 무엇을 할 수있는 방법에 대한 진짜 대답이 표시되지 않습니다 그것으로.
질문을 여러 조각으로 세분화하고 싶습니다.
구매 한 앱의 정보를 얻는 데 사용할 수있는 API는 무엇입니까? 어디서 읽을 수 있습니까? 그것을 수행하는 방법에 대한 전체 예제를 보여주십시오.
더 할 수 있습니까? 검색을 수행 할 수 있습니까? 설치된 무료 앱을 보여줄 수 있습니까? 설치 및 제거 된 시간 일 수 있습니까? 그리고 그 앱의 카테고리는?
이 API를 사용하기위한 특별한 요구 사항이 있습니까?
편집 : 나는 이것에 최대의 현상금을 걸고 있습니다. 얼마나 많은 것을 읽고 시도했는지에 관계없이 사용자가 다운로드 한 Play 스토어에서 앱을 쿼리 할 수있는 POC를 만들지 못했습니다 (이름, 패키지 유료 및 무료 앱을 포함한 이름, 설치 및 / 또는 제거 날짜, 아이콘 URL, 가격 ...)
작업중인 샘플을 발견 한 사람은 샘플을 찾은 방법과 샘플을 찾은 방법 (문서 또는 솔루션으로 이끄는 것)을 보여줍니다. 어디에서나 찾을 수 없으며 현재 솔루션이 너무 모호하여 시작할 수 없습니다.
최근 업데이트:
이것은 버그이며 Google 은 다음 업데이트에서 해결합니다.
향후 릴리스에서는이 문제를 고려하여 연기했습니다. Android를 개선하는 데 시간을 내 주셔서 감사합니다
이 답변은 아이디어의 대기업으로 바뀌 었으며 의견에 토론의 정보를 포함하도록 편집되었습니다.
androidmarketAPI는 사용자 정의 될 API를 개발자에 의해 작성. 공개적으로 사용할 수 없습니다.
의견에 귀하의 우려를 해결하기 위해. 개발자는 Android 개발자와 Google을 통해 제공되는 현재 API를 활용하여 이러한 모든 것을 관리하는 프로젝트를 만들었을 것입니다.
에 액세스 Full Account Access하는 경우 이러한 개발자가 어떻게 이것을 달성했는지 정확히 모르겠습니다.
android.accounts의 일부인 AccountManager를 사용하여 자격 증명 및 getUserData 메소드에 액세스하는 것이 좋습니다 . 계정 관리자는 비밀번호에 액세스 할 수 있으며 계정을 작성 및 삭제할 수 있습니다. 콘텐츠 제공자 와 함께 사용 가능
Udinic / SyncAdapter 인증을 참조하십시오 .
귀하의 의견에 답변하려면 :
이 블로그는 시작하는 데 도움이됩니다. 자신 만의 Android Authenticator를 작성하십시오 .
이 앱들이 실제로 어떻게 작동하는지는 말할 수 없습니다. 또한 구현 방식이 다를 수 있습니다 (뒤에서 공동 작업을하지 않는 한 가장 확실하게 다를 수 있음).
한 가지 추측. 먼저 com.google.android.gms.auth.api.signin 과 함께 GoogleSignInAccount 를 사용하십시오 .
앱에 부여 된 권한의 범위를 결정하기 위해 scope에 대한 정의가 있습니다 .
requestScopes ()를 사용 하여
... / 웹 앱에서 무선 Android 앱 설치에 액세스 할 수 있습니다.
예를 들면 다음과 같습니다.
GoogleSignInOptions gso =
new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail().
.requestScopes(new Scope("https://www.googleapis.com/auth/contacts.readonly"))
.build();
전체 액세스 권한을 얻을 수있는 경우 계정 소유자가 사용하는 모든 앱 목록을 찾아 장치의 항목과 비교할 수 있습니다.
패키지 관리자 는 현재 장치에 설치된 모든 앱 목록을 검색합니다.
PackageInfo 는 앱에 대한 세부 정보를 제공합니다.
INSTALL_REASON_USER는 사용자가 적극적으로 설치 한 앱도 필터링합니다.
당신은보고 할 수 있습니다 com.google.firebase.appindexing 및 로그 사용자 작업 . 다른 동작 을 추적 할 수 있습니다.
사용자 계정 기록은 https://myactivity.google.com/myactivity에 있습니다.
유용한 링크는 OAuth 2.0 Playground 입니다.
이 github repo node-google-play 노드를 사용하는 최신 버전이며 Google Play API를 호출합니다. "비공식"API, android-market-api 로 사용 된 아카이브는 시장 을 쿼리하기 위해 사용되었습니다.
앱 1
응용 프로그램은 주장 다음과 같은 권한을 사용할 수 :
버전 2.1.8 액세스 가능 :
$ 인앱 구매다른
- 인터넷에서 데이터를 수신
- 네트워크 연결보기
- 완전한 네트워크 액세스
- 기기에서 계정을 사용
- 장치가 잠자 지 않도록 방지
- Google 서비스 구성 읽기
주목할 점은 기본 설치가있을 때 앱이 권한을 설정하지 않는다는 것입니다. 유료 앱이 없어 기능을 사용할 수 없습니다. 따라서 초기 검색을 위해-권한이 필요하지 않았으므로 앱이 내 계정에 액세스하지 못했음을 나타냅니다.
권한을 확인했습니다. 설정이 없습니다. 따라서 귀하의 질문에 표시된 것처럼 팝업을 수락하는 것이 필요했습니다.

앱 2
당신이 언급 한 다른 응용 프로그램은 액세스되는 것에 대해 더 선행 적입니다.
보안 / 개인 정보 보호 공지이
앱을 처음 실행하면 Google 계정에 대한 모든 권한을 요청합니다. 불행히도 필요한 정보에 액세스 할 수있는 유일한 방법입니다. 개인 정보는 저장되지 않으며, 앱에 대한 정보는이 앱의 개발자와 공유되거나 제 3 자와 공유되지 않습니다. 모든 것은 휴대 전화에만 보관됩니다.

이 블로그 게시물 에서 이러한 앱들에 대해 자세히 살펴 보았습니다. 이 블로그 게시물 은 대학의 주춧돌 프로젝트를위한 것이 었습니다 (금전적 이익은 없습니다). 개발자 자체 앱 이외의 앱 구매를 가져 오기 위해 API 호출이 없기 때문에 이것이 Google의 의도에 의한 상태가 아니라 API의 악용이라고 생각합니다. 제로 데이 익스플로잇이라고 가정합니다.이 경우이 정보에 액세스 할 수있는 합법적 인 방법은 없습니다.
이러한 애플리케이션 중 하나 (My Paid Apps)의 경우 네트워크 트래픽을 확인한 후 Store 's Account (스토어 계정) 페이지를 사용하여 유료 애플리케이션 목록을 검색하는 것이 분명합니다. 현재 사용하는 메커니즘은 현재 Chrome과 동일한 메커니즘이며, 특정 시점의 Pokemon GO는 사용되었습니다.
간단히 말해 다음 단계는 다음과 같습니다.
로그인 : 언급 된 프로그램이 첫 번째 단계에서하는 일은 사용자를 로그인하고 사용자의 액세스 토큰에 액세스하는 것입니다. 그렇게하기 위해이
android.accounts.AccountManager.getAuthToken()방법을 사용합니다 . (더보기 : AccountManager ) 그러나 토큰 범위oauth2:https://www.google.com/accounts/OAuthLogin는 요청됩니다. Google 의 OAth2 문서에 따르면이 범위는 유효하지 않습니다. 그러나 Google OAuth v1의 유효한 범위처럼 보입니다.새로 검색된 액세스 토큰을 다음으로 변환
ubertoken: 실제로, 실제로ubertoken해야 할 일을 알 수 없으며 공식적인 문서가 없습니다. 그러나 크롬 브라우저가 사용자를 로그인하는 데 사용되는 것으로 나타났습니다.https://accounts.google.com/OAuthLogin?source=ChromiumBrowser&issueuberauth=1페이지 를 요청하면 됩니다.ubertoken웹 사이트 세션으로 전환 : 나중에 새로 생성ubertoken된https://accounts.google.com/MergeSessionAPI를 사용하여 API 엔드 포인트를 사용하여 웹 사이트 세션을 얻을 수 있습니다. 이 단계 후에 응용 프로그램은 기본적으로 로그인 한 상태에서 브라우저를 사용하여 열 수있는 모든 개인 페이지를로드 할 수 있습니다. 결제 설정을 포함한 일부 특수 페이지는 제외합니다.유료 애플리케이션 목록 검색 :
https://play.google.com/store/account페이지 요청 및 구문 분석
다음은 ' Packet Capture '에 의해 캡처 된 애플리케이션의 트래픽입니다 .
그림에서 분명히 볼 수 있듯이 최종 결과는 Chrome 데스크톱을 사용하여 PC에서 상점의 계정 페이지를 정상적으로 열 때 얻는 것과 동일합니다. 
사이드 노트 :
이러한 엔드 포인트는 Google 자체 프로그램에서 주로 사용되므로 문서화되지 않은 것으로 내부적으로 간주되어야합니다. 따라서 오랫동안 또는 프로덕션 환경에서 실행될 것으로 예상되는 프로그램이나 코드에서는 사용하지 않는 것이 좋습니다. 또한 나쁜 소식도 있습니다. Google Play 계정 페이지에는 유료 응용 프로그램 또는 무료 응용 프로그램 (특히 OEM 응용 프로그램) 만 나열되어 있습니다. 시간을 찾아서 다른 응용 프로그램에 대해 더 깊이 파고 들겠습니다.
Interesting articles:
Exploiting Google Chrome's OAuth2 Tokens
If you have root access, You can access /data/data/com.android.vending/databases/library.db
OnePlus3T:/data/data/com.android.vending/databases
-rw-rw---- 1 u0_a2 u0_a2 229376 2018-12-26 18:01 library.db
This database has all information, which app you have downloaded, which apps you have purchased, and even in which app you have done IAP.
Check ownership table, It has all information.
ownership (account STRING, library_id STRING, backend INTEGER, doc_id STRING, doc_type INTEGER, offer_type INTEGER, document_hash INTEGER, subs_valid_until_time INTEGER, app_certificate_hash STRING, app_refund_pre_delivery_endtime_ms INTEGER, app_refund_post_delivery_window_ms INTEGER, subs_auto_renewing INTEGER, subs_initiation_time INTEGER, subs_trial_until_time INTEGER, inapp_purchase_data STRING, inapp_signature STRING, preordered INTEGER, owned_via_license INTEGER, shared_by_me INTEGER, sharer_gaia_id TEXT, shareability INTEGER, purchase_time INTEGER, PRIMARY KEY (account, library_id, backend, doc_id, doc_type, offer_type))
Dealing with unofficial Google APIs is incredibly complicated territory. It's going to be possible to get this to work, but that's all I'll say. Proceed at your own risk.
The first thing you're going to need to do is get a Google Play auth token. This can be done several ways, but here's how they do it in Purchased Apps:
public static String getAuthToken(Activity activity, String userEmail) {
AccountManager accountManager = AccountManager.get(activity);
Account userAccount = new Account(userEmail, "com.google");
Bundle options = new Bundle();
options.putBoolean("suppressProgressScreen", true);
String token;
try {
Bundle result = accountManager
.getAuthToken(userAccount, "androidmarket", options, activity, null, null)
.getResult();
token = result.getString("authtoken");
} catch (OperationCanceledException e) {
Log.d(TAG, "Login canceled by user");
return null;
} catch (IOException | AuthenticatorException e) {
Log.e(TAG, "Login failed", e);
return null;
}
return token;
}
A few things to note here:
- The above code must be run asynchronously. I recommend RxJava, but an AsyncTask will work.
- You must supply a email for the account you want to use. I'll leave the details up to you but this is fairly easy using
AccountManager.
After you have an auth token, you can now access any Google Play Store endpoint. The main one used by Purchased Apps is https://android.clients.google.com/fdfe/purchaseHistory. Another one you might be interested in is https://android.clients.google.com/fdfe/details?doc=(package name) (from APKfetch code). Here's a page with some more and some analysis. If you make a request to these APIs, you'll need to supply several headers:
Authorization-"GoogleLogin auth=(your auth token)"User-Agent-"Android-Finsky/6.4.12.C-all%20%5B0%5D%202744941 (api=3,versionCode=80641200,sdk=" + VERSION.SDK_INT + ",isWideScreen=0)";X-DFE-Device-Id- your device's Google Services Framework ID, obtained from AdvertisingIdClient.X-DFE-Client-Id-"am-android-google"Accept-Language- The device's language code, eg"en".
Now, you need to parse the response. Here's where things get tricky. These APIs returns a message encoded as a Protobuf, so it's essentially just binary data unless you have a schema (which of course, only Google has). One way to go about this in theory is to decompile the Google Play Store app and reuse their generated protobuf models with a tool like JADX.
Unfortunately, I've tried this and it doesn't really work. Protobuf model classes are just too complex for a standard decompiler. What you can use is a tool called PBTK. You'll ideally want to run this on the Google Play Store 6.1.12 APK, since that's the last version before they started using ProGuard. Do note that this program has two errors in its script that need to be fixed before running it: changing 'extracto' to 'extractor' in gui.py and removing the assertion statement on line 500 of jar_extract.py.
Now, that should output all of the response classes as .proto files. Create a folder under src/main called proto and drag the entire generated 'com' directory to it. You can delete everything that's not under com/google/android/finsky/protos. Follow instructions online to setup Gradle with the Protobuf Lite plugin.
When you want to parse a response, you can use the ResponseWrapper class, since they all appear to be contained under that.
That's about as far as I can take you. There's a good chance I got some part of this wrong; JADX is your best friend here, because the best way to figure out what an app is doing is by looking at its code. Hope this helps and happy developing!
you can get the package name of all installed apps on device and then get the information of every installed package that you find in the device from google play without any need to get to user account. there is some third party or unofficial apis to get google play apps details as json by getting the app package name. for example: https://42matters.com/ then use the received information for every package to find free ones.
i have two resources for you to consider, but first, in a word, no. there is no api from GOOGLE to let you do what you want, as these metrics arent stored in the phone, they are on the google play store servors, and google has no OFFICIAL api for the play store. you can however glean some info from these two sites:
https://www.quora.com/Is-there-an-API-for-the-Google-Play-Storeenter link description here
and this is enough to see how to accomplish this.
first, a list of what apps have been downloaded by an account is only referencable by the account. and this can be done through the play store. since your app will be installed on that users phone, this dosnt matter... you're in.
second, you will need a 3rd party API built for the GOOGLE PLAY STORE, there are some out there, check the first link.
using the api of your choice, you will send a get request, to the play store, and in return you should receive in most cases a json object to deserialize.
객체를 역 직렬화하면 목록이 나타납니다. 당신이 얻는 목록은 사용하는 엔드 포인트에 달려 있지만 API 자체에서 설명해야합니다.
행운을 빕니다!
'Programing' 카테고리의 다른 글
| 20 개의 임의 바이트 배열을 만드는 방법은 무엇입니까? (0) | 2020.07.19 |
|---|---|
| Dockerfile 내에서 MySQL 설정 및 덤프 가져 오기 (0) | 2020.07.19 |
| Spark에서 단계는 어떻게 작업으로 분할됩니까? (0) | 2020.07.18 |
| 엔터티 프레임 워크를 "웜업"하는 방법? (0) | 2020.07.18 |
| 프로그래머 친화적 인 검색 엔진? (0) | 2020.07.18 |

