本文整理汇总了Java中com.google.android.vending.licensing.ServerManagedPolicy类的典型用法代码示例。如果您正苦于以下问题:Java ServerManagedPolicy类的具体用法?Java ServerManagedPolicy怎么用?Java ServerManagedPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServerManagedPolicy类属于com.google.android.vending.licensing包,在下文中一共展示了ServerManagedPolicy类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkLicense
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
protected void checkLicense() {
mHandler = new Handler();
// Try to use more data here. ANDROID_ID is a single point of attack.
String deviceId = Settings.Secure.getString(getContentResolver(),
Settings.Secure.ANDROID_ID);
// Library calls this when it's done.
mLicenseCheckerCallback = new MyLicenseCheckerCallback();
// Construct the LicenseChecker with a policy.
mChecker = new LicenseChecker(this, new ServerManagedPolicy(this,
new AESObfuscator(SALT, getPackageName(), deviceId)),
BASE64_PUBLIC_KEY);
doCheck();
}
示例2: run
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
/**
*
*
* @public
* @return void
*/
public void run( final String sPublicKey , final HaxeObject cb ) {
Log.i( TAG, "run ::: " );
//
String deviceId = Secure.getString(GameActivity.getContext().getContentResolver(), Secure.ANDROID_ID);
Log.i( TAG, "deviceId ::: "+deviceId );
Log.i( TAG, "package ::: "+GameActivity.getContext().getPackageName() );
AESObfuscator aes = new AESObfuscator( SALT, GameActivity.getContext().getPackageName(), deviceId );
ServerManagedPolicy pol = new ServerManagedPolicy( GameActivity.getContext(), aes );
//
mCallback = cb;
//
mChecker = new LicenseChecker( GameActivity.getContext(), pol ,sPublicKey );
mChecker.checkAccess( this );
}
示例3: onCreate
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Try to use more data here. ANDROID_ID is a single point of attack.
String deviceId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
// Library calls this when it's done.
mLicenseCheckerCallback = new MyLicenseCheckerCallback();
// Construct the LicenseChecker with a policy.
mChecker = new LicenseChecker(this, new ServerManagedPolicy(this, new AESObfuscator(SALT, getPackageName(), deviceId)), BASE64_PUBLIC_KEY);
}
示例4: onCreate
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.main);
mStatusText = (TextView) findViewById(R.id.status_text);
mCheckLicenseButton = (Button) findViewById(R.id.check_license_button);
mCheckLicenseButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
doCheck();
}
});
mHandler = new Handler();
// Try to use more data here. ANDROID_ID is a single point of attack.
String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
// Library calls this when it's done.
mLicenseCheckerCallback = new MyLicenseCheckerCallback();
// Construct the LicenseChecker with a policy.
mChecker = new LicenseChecker(
this, new ServerManagedPolicy(this,
new AESObfuscator(SALT, getPackageName(), deviceId)),
BASE64_PUBLIC_KEY);
doCheck();
}
示例5: setUp
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
public void setUp() {
final byte[] SALT = new byte[] {
104, -12, 112, 82, -85, -10, -11, 61, 15, 54, 44, -66, -117, -89, -64, 110, -53, 123, 33
};
String deviceId = Settings.Secure.getString(
getActivity().getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
p = new ServerManagedPolicy(getActivity().getApplicationContext(),
new AESObfuscator(SALT, getActivity().getPackageName(), deviceId));
}
示例6: call
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
@Override
public FREObject call(FREContext arg0, FREObject[] arg1)
{
ExtensionContext ctx = (ExtensionContext)arg0;
Activity act = ctx.getActivity();
try
{
FREObject input = arg1[0];
String base64Key = input.getAsString();
String deviceId = Secure.getString(act.getContentResolver(), Secure.ANDROID_ID);
// Library calls this when it's done.
_licenseCheckerCallback = new CheckerCallback(ctx);
// Construct the LicenseChecker with a policy.
_checker = new LicenseChecker(
act, new ServerManagedPolicy(act,
new AESObfuscator(SUGAR, act.getPackageName(), deviceId)),
base64Key);
_checker.checkAccess(_licenseCheckerCallback);
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
示例7: EasyLicenseChecker
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
public EasyLicenseChecker(Activity activity, Handler handler) {
if (activity == null) throw new IllegalArgumentException("activity is null");
if (handler == null) throw new IllegalArgumentException("handler is null");
mHandler = handler;
mActivity = activity;
String deviceId = Settings.Secure.getString(activity.getContentResolver(),
Settings.Secure.ANDROID_ID);
mChecker = new LicenseChecker(mActivity,
new ServerManagedPolicy(mActivity, new AESObfuscator(SALT,
mActivity.getPackageName(), deviceId)),
BASE64_PUBLIC_KEY);
}
示例8: createPolicy
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
public static Policy createPolicy(@NonNull Context context, @NonNull String packageName) {
String deviceID = Installation.id(context);
return new ServerManagedPolicy(context, new AESObfuscator(Key.SALT, packageName, deviceID));
}
示例9: License
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
public License(Activity activity) {
String deviceId = Secure.getString(activity.getContentResolver(), Secure.ANDROID_ID);
licenseCallback = new BlueWatcherLicenseCheckerCallback(activity);
licenseChecker = new LicenseChecker(activity, new ServerManagedPolicy(activity, new AESObfuscator(License.SALT, activity.getPackageName(),
deviceId)), License.APP_PUBLIC_KEY);
}
示例10: checkAccess
import com.google.android.vending.licensing.ServerManagedPolicy; //导入依赖的package包/类
public void checkAccess() {
LicenseChecker licenseChecker = new LicenseChecker(BakerApplication.getInstance(), new ServerManagedPolicy(BakerApplication.getInstance(), new AESObfuscator(SALT, BakerApplication.getInstance().getPackageName(), Configuration.getUserId())), BakerApplication.getInstance().getString(R.string.google_play_license_key));
licenseChecker.checkAccess(licenseCheckerCallback);
}