<commit_before>package com.billing.google;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.android.vending.billing.IabHelper;
import com.billing.BillingService;

import java.util.List;

public class GoogleBillingService extends BillingService {

    private IabHelper iap;
    public List<String> iapkeys;
    private GoogleBillingListener googleBillingListener;

    public GoogleBillingService(Context context, List<String> iapkeys) {
        super();
        this.context = context;
        this.iapkeys = iapkeys;
    }

    public void purchaseCallback(int requestCode, int resultCode, Intent data) {
        try {
            iap.handleActivityResult(requestCode, resultCode, data);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @SuppressWarnings("ConstantConditions")
    @Override
    public void init(String key) {
        //We rebuild the public key at run-time.
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < key.length(); i++) {
            char c = key.charAt(i);
            if ((c >= 'A' && c <= 'M') || (c >= 'a' && c <= 'm'))
                c += 13;
            else if ((c >= 'N' && c <= 'Z') || (c >= 'n' && c <= 'z'))
                c -= 13;
            stringBuilder.append(c);
        }
        try {
            iap = new IabHelper(context, stringBuilder.toString());
            if (iap != null) {
                googleBillingListener = new GoogleBillingListener(iap, this);
                iap.startSetup(googleBillingListener);
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void buy(Activity activity, String sku, int id) {
        try {
            if (iap != null)
                iap.launchPurchaseFlow(activity, sku, id, googleBillingListener);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void subscribe(Activity activity, String sku, int id) {
        try {
            if (iap != null)
                iap.launchSubscriptionPurchaseFlow(activity, sku, id, googleBillingListener);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }<commit_msg>enable debug logging gor google in-app library<commit_after>package com.billing.google;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.android.vending.billing.IabHelper;
import com.billing.BillingService;
import com.eggheadgames.inapppayments.BuildConfig;

import java.util.List;

public class GoogleBillingService extends BillingService {

    private IabHelper iap;
    public List<String> iapkeys;
    private GoogleBillingListener googleBillingListener;

    public GoogleBillingService(Context context, List<String> iapkeys) {
        super();
        this.context = context;
        this.iapkeys = iapkeys;
    }

    public void purchaseCallback(int requestCode, int resultCode, Intent data) {
        try {
            iap.handleActivityResult(requestCode, resultCode, data);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @SuppressWarnings("ConstantConditions")
    @Override
    public void init(String key) {
        //We rebuild the public key at run-time.
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < key.length(); i++) {
            char c = key.charAt(i);
            if ((c >= 'A' && c <= 'M') || (c >= 'a' && c <= 'm'))
                c += 13;
            else if ((c >= 'N' && c <= 'Z') || (c >= 'n' && c <= 'z'))
                c -= 13;
            stringBuilder.append(c);
        }
        try {
            iap = new IabHelper(context, stringBuilder.toString());
            if (iap != null) {
                googleBillingListener = new GoogleBillingListener(iap, this);
                iap.enableDebugLogging(BuildConfig.DEBUG);
                iap.startSetup(googleBillingListener);
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void buy(Activity activity, String sku, int id) {
        try {
            if (iap != null)
                iap.launchPurchaseFlow(activity, sku, id, googleBillingListener);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void subscribe(Activity activity, String sku, int id) {
        try {
            if (iap != null)
                iap.launchSubscriptionPurchaseFlow(activity, sku, id, googleBillingListener);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
{'fraction_non_alphanumeric': 0.11276461957660867, 'fraction_numerical': 0.0020959966464053656, 'mean_word_length': 2.0987012987012985, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3522846', 'n_tokens_mistral': 1361, 'n_tokens_neox': 1320, 'n_words': 341}