PDA

View Full Version : درخواست اصلاح اکتیویتی درون پرداخت



ehsanh22
یک شنبه 21 تیر 1394, 12:50 عصر
سلام . چطور میتونم در اکتیویتی پرداخت زیر کاری کنم اول چک بشه لاکی پچر نصب هست روی گوشی ؟ اگه نصب هست یه پیغام بیاد و عملیات پرداخت ادامه داده نشه .

این نمونه رو دیدم ولی نمیدونم چطور باید استفاده کنم : http://stackoverflow.com/questions/13445598/lucky-patcher-how-can-i-protect-from-it

این هم اکتیویتی من :


package com.example.pay;

import java.util.ArrayList;


import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;


import com.util.IabHelper;
import com.util.IabHelper.OnIabPurchaseFinishedListener;
import com.util.IabHelper.OnIabSetupFinishedListener;
import com.util.IabHelper.QueryInventoryFinishedListener;
import com.util.IabResult;
import com.util.Inventory;
import com.util.Purchase;
import com.util.SkuDetails;






public class Upgrade extends Activity {




protected static final int BUY_REQUEST_CODE = 12345;


private IabHelper buyHelper;


private Button butBuy;
public boolean premium;








// Getting the Price for the In-App SKU
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);


setContentView(R.layout.upgrade);





butBuy = (Button) findViewById(R.id.button_buy);







// [...]


// Initially, disable the "buy me" button
butBuy.setEnabled(false);



buyHelper = new IabHelper(this,Billing. PUBLIC_KEY);
buyHelper.startSetup(new OnIabSetupFinishedListener() {
@Override
public void onIabSetupFinished(IabResult result) {
if(result.isSuccess()) {
// Fill a list of SKUs that we want the price infos for
// (SKU = "stockable unit" = buyable things)
ArrayList<String> moreSkus = new ArrayList<String>();
moreSkus.add(Billing.SKU_NAME_PREMIUM);


// We initialize the price field with a "retrieving price" message while we wait
// for the price
final TextView tvPrice = (TextView) findViewById(R.id.price);

tvPrice.setText("لطفا منتظر بمانید ...");


// Start the query for the details for the SKUs. This runs asynchronously, so
// it may be that the price appears a bit later after the rest of the Activity is shown.
buyHelper.queryInventoryAsync(true, moreSkus, new QueryInventoryFinishedListener() {
@Override
public void onQueryInventoryFinished(IabResult result, Inventory inv) {
if(result.isSuccess()) {


// If we successfully got the price, show it in the text field
SkuDetails details = inv.getSkuDetails(Billing.SKU_NAME_PREMIUM);
String price = details.getPrice();


tvPrice.setText(price);
// tvPrice.setText("لطفا جهت ارتقا کلیک کنید");



// On successful init and price getting, enable the "buy me" button
butBuy.setEnabled(true);
} else {
// Error getting the price... show a sorry text in the price field now

//
butBuy.setEnabled(true);
//

}

}


});
}
}
});


// [...]
//Buying an In-App Item
// [...]


butBuy.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Disable the button after the click to prevent double clicks
butBuy.setEnabled(false);


// Start the purchase flow
buyHelper.launchPurchaseFlow(Upgrade.this,
Billing.SKU_NAME_PREMIUM, BUY_REQUEST_CODE,
new OnIabPurchaseFinishedListener() {
@Override
public void onIabPurchaseFinished(IabResult result, Purchase info) {
if (result.isSuccess()) {
// Successful - the item has been payed for


// We set a vale in the shared preferences to mark this app as
SharedPreferences shared = getSharedPreferences("Prefs", MODE_PRIVATE);
SharedPreferences.Editor editor = shared.edit();
editor.putBoolean(Billing.KEY_PREMIUM_VERSION, true);
editor.apply();



//
// The flag "CLEAR_TASK" is important, so the user is not sent
// back to this buy activity when he presses the back button.
//
Toast.makeText(getBaseContext(), "تبریک ، با موفقیت به نسخه کامل ارتقا یافتید",Toast.LENGTH_SHORT).show();
Intent intentz = new Intent(
Upgrade.this,
MainActivity.class);
intentz.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
| Intent.FLAG_ACTIVITY_NEW_TASK);



startActivity(intentz);
}

}
});
}
});
}


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Delegate the answer from the purchase request to the buying helper - necessary
// to let it handle the answers from the backend
buyHelper.handleActivityResult(requestCode, resultCode, data);
}


//Don’t forget to cleanup after
//ourselves when the BuyActivity ends:


@Override
protected void onDestroy() {
super.onDestroy();
buyHelper.dispose();
}





@Override
public void onBackPressed() {
backButtonHandler();
return;
}
public void backButtonHandler (){




AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
Upgrade.this);


// set title
alertDialogBuilder.setTitle("لغو عملیات ارتقا به نسخه کامل");


// set dialog message
alertDialogBuilder
.setMessage("قصد لغو عملیات را دارید ؟")
.setIcon(R.drawable.star_v)
.setCancelable(false)
.setPositiveButton("بله ، منصرف شدم",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
// if this button is clicked, close
// current activity
System.exit(id);
}
})
.setNegativeButton("خیر ، ادامه میدهم",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
dialog.cancel();
}
});


// create alert dialog'
AlertDialog alertDialog = alertDialogBuilder.create();


// show it
alertDialog.show();


}




/*
@Override
public void onBackPressed() {


Intent ip=new Intent();
ip.setClass(BuyPremiumActivity.this,page3.class);
startActivity(ip);
Toast.makeText(getBaseContext(), "nemayeshe peyghame shoma",Toast.LENGTH_SHORT).show();
}
*/

}

ehsanh22
یک شنبه 21 تیر 1394, 16:56 عصر
این سوال رو بارها پرسیدم ، خیلی ها میدونن که جوابش یک خط کد هست ولی همه پیغام خصوصی دادن که پول بده برات درستش کنم:قهقهه:

یه مرد پیدا نشد که بگه فلان خطو اضافه کن خودم اصلاحش کردم و لاکی پچر نتونست هکش کنه:چشمک:

بدون ارسال سمت سرور و هاست و ....

به افتخار خودم :تشویق:

hamedg1366
یک شنبه 21 تیر 1394, 19:29 عصر
دوست عزیز بهتر نیس جواب رو اینجا بدارین تا ما هم از تجربه شما استفاده کنیم


با تشکر

ehsanh22
یک شنبه 21 تیر 1394, 20:00 عصر
من دقیقا از سورس این صفحه استفاده کردم . دقیقا هرکاری کردم برنامه هک نشد از طریق لاکی پچر :

http://answers.uncox.com/android/question/9631/%D8%A2%DB%8C%D8%A7-%D8%A7%DB%8C%D9%86-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87-%D8%AA%D9%88%D8%B3%D8%B7-%D9%84%D8%A7%DA%A9%DB%8C-%D9%BE%DA%86%D8%B1-%D9%85%D8%B9%D8%B1%D9%88%D9%81-%D9%87%DA%A9-%D9%85%DB%8C%D8%B4%D9%87-%D8%AC%D9%88%D8%A7%D8%A8-%D8%A8%D9%87-%D9%87%DB%8C%DA%86-%D9%88%D8%AC%D9%87-%D8%B3%D9%88%D8%B1%D8%B3-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87-%D8%A7%D8%B6%D8%A7%D9%81%D9%87-%D8%B4%D8%AF-