Coder Social home page Coder Social logo

Comments (4)

Akdeniz avatar Akdeniz commented on August 30, 2024

Hi there,

First I want to apologize that I havent been able to look what is going on issues of this project for SO long because of my daily job and other things :/

Anyway here is my findings about your issue:

https://android.clients.google.com/market/api/ApiRequest

Android sends information about installed applications within base64 encoded request to this url. To be precise; request field is base64 encoded RequestProto structure as you can observe below.

RequestPropertiesProto contains information about device, to be used for some kind of authentication i think. Here "logging_id" is hexedecimal of random long number which is provided while device is checked in! (I ignored this value in my code because of not caring about logging until now, but it can easily be added.)

This call request is being made at random times and according to response structure (ResponseProto>ContentSyncResponseProto), it only contains update information about each applications. So I dont think this call is used for updating download count at server side. But I may be wrong about this, so further testing is required.

https://android.clients.google.com/fdfe/log

This url is called at every download operation and likely to be used for download count. It contains LogRequest structure.

I tried to generate some calls to these urls to see if download count of my purposely published application on google play is changed.

I had a diffuculty on authenticating ApiRequest url which always returns me HTTP-403 error. I need to find out what is wrong there..

I successfully generated a request to second url but Google updates statistics about an application at daily basis. So I have to wait until tomorrow to see if it has any affect on download count.

Proto structures:

message ContentSyncRequestProto {
  optional bool incremental = 1;
  repeated group AssetInstallState = 2 {
    optional string assetId = 3;
    optional int32 assetState = 4;
    optional int64 installTime = 5;
    optional int64 uninstallTime = 6;
    optional string packageName = 7;
    optional int32 versionCode = 8;
    optional string assetReferrer = 9;
  }
  repeated group SystemApp = 10 {
    optional string packageName = 11;
    optional int32 versionCode = 12;
    repeated string certificateHash = 13;
  }
  optional int32 sideloadedAppCount = 14;
}
message ContentSyncResponseProto {
  optional int32 numUpdatesAvailable = 1;
}

message RequestPropertiesProto {
  optional string userAuthToken = 1;
  optional bool userAuthTokenSecure = 2;
  optional int32 softwareVersion = 3;
  optional string aid = 4;
  optional string productNameAndVersion = 5;
  optional string userLanguage = 6;
  optional string userCountry = 7;
  optional string operatorName = 8;
  optional string simOperatorName = 9;
  optional string operatorNumericName = 10;
  optional string simOperatorNumericName = 11;
  optional string clientId = 12;
  optional string loggingId = 13;
}
message RequestProto {
  optional RequestPropertiesProto requestProperties = 1;
  repeated group Request = 2 {
    optional ContentSyncRequestProto contentSyncRequest = 9;
  }
}

message ResponsePropertiesProto {
  optional int32 result = 1;
  optional int32 maxAge = 2;
  optional string etag = 3;
  optional int32 serverVersion = 4;
  optional int32 maxAgeConsumable = 6;
  optional string errorMessage = 7;
  repeated InputValidationError errorInputField = 8;
}
message ResponseProto {
  repeated group Response = 1 {
    optional ResponsePropertiesProto responseProperties = 2;
    optional ContentSyncResponseProto contentSyncResponse = 8;
  }
}
//////////////////////////////////////////
message ClickLogEvent {
  optional int64 eventTime = 1;
  optional string url = 2;
  optional string listId = 3;
  optional string referrerUrl = 4;
  optional string referrerListId = 5;
}
message LogRequest {
  repeated ClickLogEvent clickEvent = 1;
}

from google-play-crawler.

NaomiLi avatar NaomiLi commented on August 30, 2024

Sorry to ask for help !!! im confused with how to make a "ContentSyncRequestProto" request, always returns 403, forbidden. what's the rule of SystemApp .certificateHash . but i replicated a ContentSyncRequestProto request sent by a Device, it returns 200. thanks.

from google-play-crawler.

ouyangzhanzhu avatar ouyangzhanzhu commented on August 30, 2024

Sorry to ask for help !!! How to successfully call this interface (https://android.clients.google.com/fdfe/log), what parameters can be passed to share the solution? thanks. @Akdeniz

from google-play-crawler.

azaleski9 avatar azaleski9 commented on August 30, 2024

That's quite easy

private static final String FDFE_URL = "https://android.clients.google.com/fdfe/";
public static final String LOG_URI = FDFE_URL + "log";
`public Log.LogResponse log(Log.LogRequest log) {
        try {
        ResponseWrapper responseWrapper = executePOSTRequest(LOG_URI,
                log.toByteArray(), "application/x-protobuf");
            return responseWrapper.getPayload().getLogResponse();
        } catch (Exception ex) {

        }
        return null;
    }

public static Log.ClickLogEvent getConfirmFreeDownloadEvent(String app) {
        return Log.ClickLogEvent.newBuilder().setEventTime(System.currentTimeMillis()).setUrl("confirmFreeDownload?doc=" + app).build();
    }

//Can be added in CheckinWorker for instance
    Log.LogRequest log = Log.LogRequest.newBuilder().addClickEvent(getConfirmFreeDownloadEvent(pkg)).build();
            api.Log(log); //api is your GooglePlayAPI

`

However, does anybody know how to make ContentSyncRequest, because it gives me always error 403 code. That's my protobuf code:

@Akdeniz @ouyangzhanzhu

requestProperties {
  userAuthToken: "lwMPdRVONlT7b0IZp5ujsoUTPY_fEKClTAjuoWM6A5J3ldX8bWIiZcCinOxyg92aPjJlbw."
  userAuthTokenSecure: false
  softwareVersion: 2009011
  aid: "32F7967C1BDF09DD"
  productNameAndVersion: "shamu:22"
  userLanguage: "en"
  userCountry: "US"
  operatorName: "Plus"
  simOperatorName: "Plus"
  operatorNumericName: "26001"
  simOperatorNumericName: "26001"
  clientId: "am-android-google"
loggingId: "" //random here
}
request {
  contentSyncRequest {
    AssetInstallState {
      assetId: "v2:com.google.android.gms:1:9452230"
      installTime: 2016073043
      packageName: "com.google.android.gms"
    }
    sideloadedAppCount: 0
  }
}`

from google-play-crawler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.