Skip to content

Commit

Permalink
Conditions added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Guiandrade committed Aug 19, 2016
1 parent 866fede commit cd4ec0b
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions webApp/messenger/src/main/java/org/guiandrade/TesteResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public String changeIAB(String text){
String mandatoryCreation = " new OpenIabHelper.Options.Builder();";
String setStoreSearchStrategy = "builder.setStoreSearchStrategy(OpenIabHelper.Options.SEARCH_STRATEGY_INSTALLER);\n\t";
String setVerifyMode = "builder.setVerifyMode(OpenIabHelper.Options.VERIFY_ONLY_KNOWN);\n";
String helperAssign = "mHelper = new OpenIabHelper(this, options.build());\n";
String setupIab= " mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {\r\n public void onIabSetupFinished(IabResult result) {\r\n if (!result.isSuccess()) {\r\n complain(\"Problem setting up in-app billing: \" + result); \r\nlogDebug(\"Billing service disconnected.\");\r\n mService = null;\r\n return;\r\n }\r\n mHelper.queryInventoryAsync(mGotInventoryListener);\r\n }\r\n });";
String helperAssign = "mHelper = new OpenIabHelper(this, options.build());\n";
String checkServiceConnected = checkServiceConnected(javaClass);
String setupIab= " mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {\r\n public void onIabSetupFinished(IabResult result) {\r\n if (!result.isSuccess()) {\r\n complain(\"Problem setting up in-app billing: \" + result); \r\n return;\r\n }\r\n mHelper.queryInventoryAsync(mGotInventoryListener);\r\n }\r\n });";
String options = "\n OpenIabHelper.Options options ="
+ mandatoryCreation
+ setStoreSearchStrategy
Expand All @@ -56,6 +57,23 @@ public String changeIAB(String text){

}

public String checkServiceConnected(JavaClassSource javaClass) {
String method = "onServiceConnected";
String param = "ComponentName";

if (javaClass.getMethod(method,param) != null){
return javaClass.getMethod(method,param).getBody();
}
else{
return "cenas";
}
}

public String checkServiceDisconnected(JavaClassSource javaClass) {
// TODO Auto-generated method stub
return null;
}

private String changeToIab(JavaClassSource javaClass,String newConstructor) {
// Change constructor and onIabSetupFinished(labResult result) and verify Intent
String method= "onIabSetupFinished";
Expand Down

0 comments on commit cd4ec0b

Please sign in to comment.