[Galaxy Y GT-S5360 General] James_Smith:
Hi, I managed stop upgrading google play via chattr on Kitkat, and mkdir on Ginger bread. But google play download each day (I have disabled data on night) after reenabling data 20 MB (!!!). I believe thats could be the new version, which then isnt installed.

Does anyone know, how to get rid this big data eater? I dont know how to "rebuilt/signed the apk phonesky app", mentioned post earlier. I dont have checker there - I found different file: SelfUpdateScheduler.java.

package com.google.android.finsky.utils;

import android.accounts.Account;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.VolleyError;
import com.google.android.finsky.FinskyApp;
import com.google.android.finsky.analytics.PlayStore.AppData;
import com.google.android.finsky.api.AccountHandler;
import com.google.android.finsky.download.Download;
import com.google.android.finsky.download.DownloadImpl;
import com.google.android.finsky.download.DownloadProgress;
import com.google.android.finsky.download.DownloadQueue;
import com.google.android.finsky.download.DownloadQueueListener;
import com.google.android.finsky.download.InternalDownload;
import com.google.android.finsky.protos.AndroidAppDelivery.AndroidAppDeliveryData;
import com.google.android.finsky.protos.AndroidAppDelivery.HttpCookie;
import com.google.android.finsky.protos.Delivery.DeliveryResponse;
import com.google.android.finsky.protos.SelfUpdate.SelfUpdateResponse;
import com.google.android.finsky.protos.Toc.SelfUpdateConfig;
import com.google.android.finsky.protos.Toc.TocResponse;
import com.google.android.finsky.utils.PackageManagerHelper.InstallPackageListener;

public class SelfUpdateScheduler implements DownloadQueueListener {
private static String sCertificateHash;
private static String sCertificateHashSelfUpdateMD5;
private final DownloadQueue mDownloadQueue;
private AppData mLogAppData;
private int mMarketVersion;
private ApplicationDismissedDeferrer mOnAppExitDeferrer;
private Download mUpdateDownload;
private boolean mUpdateInProgress;

/* renamed from: com.google.android.finsky.utils.SelfUpdateScheduler.1 */
class C07081 implements Listener<DeliveryResponse> {
C07081() {
}

public void onResponse(DeliveryResponse deliveryResponse) {
if (deliveryResponse.status != 1) {
FinskyLog.m12w("SelfUpdate non-OK response - %d", Integer.valueOf(deliveryResponse.status));
} else if (deliveryResponse.appDeliveryData == null) {
FinskyLog.m12w("SelfUpdate response missing appDeliveryData", new Object[0]);
} else {
AndroidAppDeliveryData deliveryData = deliveryResponse.appDeliveryData;
HttpCookie authCookie = deliveryData.downloadAuthCookie[0];
SelfUpdateScheduler.this.startSelfUpdateDownload(deliveryData.downloadUrl, authCookie.name, authCookie.value);
}
}
}

/* renamed from: com.google.android.finsky.utils.SelfUpdateScheduler.2 */
class C07092 implements ErrorListener {
C07092() {
}

public void onErrorResponse(VolleyError volleyError) {
FinskyLog.m12w("SelfUpdate error - %s", volleyError);
}
}

/* renamed from: com.google.android.finsky.utils.SelfUpdateScheduler.3 */
class C07113 implements Runnable {
final /* synthetic */ Download val$download;

/* renamed from: com.google.android.finsky.utils.SelfUpdateScheduler.3.1 */
class C07101 implements InstallPackageListener {
C07101() {
}

public void installCompleted(boolean successful, int errorCode, String exceptionType) {
FinskyApp.get().getEventLogger().logBackgroundEvent(111, FinskyApp.get().getPackageName(), null, errorCode, null, SelfUpdateScheduler.this.mLogAppData);
}
}

C07113(Download download) {
this.val$download = download;
}

public void run() {
String str = null;
boolean z = false;
PackageManagerHelper.installPackage(this.val$download.getContentUri(), null, -1, str, false, z, new C07101(), false, "", null);
}
}

public SelfUpdateScheduler(DownloadQueue downloadQueue, int marketVersion) {
this.mUpdateInProgress = false;
this.mLogAppData = null;
this.mUpdateDownload = null;
this.mDownloadQueue = downloadQueue;
this.mMarketVersion = marketVersion;
}

public int getNewVersion(TocResponse response) {
if (response.selfUpdateConfig == null) {
return -1;
}
SelfUpdateConfig config = response.selfUpdateConfig;
if (config.hasLatestClientVersionCode) {
return config.latestClientVersionCode;
}
return -1;
}

public int getNewVersion(SelfUpdateResponse response) {
if (response.hasLatestClientVersionCode) {
return response.latestClientVersionCode;
}
return -1;
}

public boolean isSelfUpdateRunning() {
return this.mUpdateInProgress;
}

public boolean checkForSelfUpdate(int serverMarketVersion) {
if (this.mUpdateInProgress) {
FinskyLog.m8d("Skipping DFE self-update check as there is an update already queued.", new Object[0]);
return true;
} else if (this.mMarketVersion >= serverMarketVersion) {
FinskyLog.m8d("Skipping DFE self-update. Local Version [%d] >= Server Version [%d]", Integer.valueOf(this.mMarketVersion), Integer.valueOf(serverMarketVersion));
return false;
} else {
FinskyLog.m8d("Starting DFE self-update from local version [%d] to server version [%d]", Integer.valueOf(this.mMarketVersion), Integer.valueOf(serverMarketVersion));
this.mUpdateInProgress = true;
this.mLogAppData = new AppData();
this.mLogAppData.oldVersion = this.mMarketVersion;
this.mLogAppData.hasOldVersion = true;
this.mLogAppData.version = serverMarketVersion;
this.mLogAppData.hasVersion = true;
this.mLogAppData.systemApp = true;
this.mLogAppData.hasSystemApp = true;
Context context = FinskyApp.get();
String vendingPackageName = context.getPackageName();
Account account = AccountHandler.getFirstAccount(context);
Integer num = null;
String[] strArr = null;
FinskyApp.get().getDfeApi(account.name).delivery(vendingPackageName, 1, null, Integer.valueOf(serverMarketVersion), num, strArr, getCertificateHashSelfUpdateMD5(context), getCertificateHash(context), new C07081(), new C07092());
return true;
}
}

private void startSelfUpdateDownload(String url, String cookieName, String cookieValue) {
InternalDownload download = new DownloadImpl(url, "", null, 0, cookieName, cookieValue, null, -1, -1, null, false, true);
this.mUpdateDownload = download;
this.mDownloadQueue.addListener(this);
this.mDownloadQueue.add(download);
FinskyApp.get().getEventLogger().logBackgroundEvent(100, FinskyApp.get().getPackageName(), null, 0, null, this.mLogAppData);
}

public void onComplete(Download download) {
if (download != this.mUpdateDownload) {
FinskyLog.m8d("Self-update ignoring completed download " + download, new Object[0]);
return;
}
FinskyApp.get().getEventLogger().logBackgroundEvent(102, FinskyApp.get().getPackageName(), null, 0, null, this.mLogAppData);
this.mUpdateDownload = null;
if (this.mOnAppExitDeferrer != null) {
FinskyLog.m8d("Self-update package Uri was already assigned!", new Object[0]);
return;
}
FinskyLog.m8d("Self-update ready to be installed, waiting for market to close.", new Object[0]);
this.mOnAppExitDeferrer = new ApplicationDismissedDeferrer(FinskyApp.get());
this.mOnAppExitDeferrer.runOnApplicationClose(new C07113(download), 10000);
}

public void onError(Download download, int httpStatus) {
if (download == this.mUpdateDownload) {
FinskyApp.get().getEventLogger().logBackgroundEvent(104, FinskyApp.get().getPackageName(), null, httpStatus, null, this.mLogAppData);
FinskyLog.m9e("Self-update failed because of HTTP error code: %d", Integer.valueOf(httpStatus));
}
}

public void onStart(Download download) {
if (download == this.mUpdateDownload) {
FinskyApp.get().getEventLogger().logBackgroundEvent(101, FinskyApp.get().getPackageName(), null, 0, null, this.mLogAppData);
}
}

public void onCancel(Download download) {
}

public void onNotificationClicked(Download download) {
}

public void onProgress(Download download, DownloadProgress progress) {
}

public static synchronized String getCertificateHashSelfUpdateMD5(Context context) {
String str;
synchronized (SelfUpdateScheduler.class) {
if (sCertificateHashSelfUpdateMD5 == null) {
computeClientHashes(context);
}
str = sCertificateHashSelfUpdateMD5;
}
return str;
}

public static synchronized String getCertificateHash(Context context) {
String str;
synchronized (SelfUpdateScheduler.class) {
if (sCertificateHash == null) {
computeClientHashes(context);
}
str = sCertificateHash;
}
return str;
}

private static void computeClientHashes(Context context) {
try {
byte[] signature = context.getPackageManager().getPackageInfo(context.getPackageName(), 64).signatures[0].toByteArray();
sCertificateHashSelfUpdateMD5 = Md5Util.secureHash(signature);
sCertificateHash = Sha1Util.secureHash(signature);
} catch (NameNotFoundException e) {
FinskyLog.wtf("Unable to find package info for %s - %s", vendingPackageName, e);
sCertificateHashSelfUpdateMD5 = "signature-hash-NameNotFoundException";
sCertificateHash = "certificate-hash-NameNotFoundException";
}
}
}