• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AndroidPublisherScopes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.api.services.androidpublisher.AndroidPublisherScopes的典型用法代码示例。如果您正苦于以下问题:Java AndroidPublisherScopes类的具体用法?Java AndroidPublisherScopes怎么用?Java AndroidPublisherScopes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AndroidPublisherScopes类属于com.google.api.services.androidpublisher包,在下文中一共展示了AndroidPublisherScopes类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: authorizeWithServiceAccount

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
private static Credential authorizeWithServiceAccount(String serviceAccountEmail)
        throws GeneralSecurityException, IOException {
    log.info(String.format("Authorizing using Service Account: %s", serviceAccountEmail));

    // Build service account credential.
    log.info("Loading service account key ...");
    final InputStream is = AndroidPublisherHelper.class.getResourceAsStream(SRC_RESOURCES_KEY_P12);
    File keyFile = getTempFile(is, "key");
    log.info("keyFile.exists() = " + keyFile.exists());
    log.info("keyFile.length() = " + keyFile.length());
    GoogleCredential credential = new GoogleCredential.Builder()
            .setTransport(HTTP_TRANSPORT)
            .setJsonFactory(JSON_FACTORY)
            .setServiceAccountId(serviceAccountEmail)
            .setServiceAccountScopes(
                    Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER))
            .setServiceAccountPrivateKeyFromP12File(keyFile)
            .build();
    return credential;
}
 
开发者ID:wisobi,项目名称:leanbean,代码行数:21,代码来源:AndroidPublisherHelper.java


示例2: authorizeWithInstalledApplication

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
/**
 * Authorizes the installed application to access user's protected data.
 *
 * @throws IOException
 * @throws GeneralSecurityException
 */
private static Credential authorizeWithInstalledApplication() throws IOException {
    log.info("Authorizing using installed application");

    // load client secrets
    GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
            JSON_FACTORY,
            new InputStreamReader(
                    AndroidPublisherHelper.class
                            .getResourceAsStream(RESOURCES_CLIENT_SECRETS_JSON)));
    // Ensure file has been filled out.
    checkClientSecretsFile(clientSecrets);

    dataStoreFactory = new FileDataStoreFactory(DATA_STORE_DIR);

    // set up authorization code flow
    GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow
            .Builder(HTTP_TRANSPORT,
            JSON_FACTORY, clientSecrets,
            Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER))
            .setDataStoreFactory(dataStoreFactory).build();
    // authorize
    return new AuthorizationCodeInstalledApp(
            flow, new LocalServerReceiver()).authorize(INST_APP_USER_ID);
}
 
开发者ID:wisobi,项目名称:leanbean,代码行数:31,代码来源:AndroidPublisherHelper.java


示例3: authorizeWithServiceAccount

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
private static Credential authorizeWithServiceAccount(String serviceAccountEmail,
												  File serviceAccountKeyFile)
          throws GeneralSecurityException, IOException {
      log.info(String.format("Authorizing using Service Account: %s", serviceAccountEmail));

      // Build service account credential.
log.info("Using service key file: "+serviceAccountKeyFile.getAbsolutePath());
      GoogleCredential credential = new GoogleCredential.Builder()
              .setTransport(HTTP_TRANSPORT)
              .setJsonFactory(JSON_FACTORY)
              .setServiceAccountId(serviceAccountEmail)
              .setServiceAccountScopes(
                      Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER))
              .setServiceAccountPrivateKeyFromP12File(serviceAccountKeyFile)
              .build();
      return credential;
  }
 
开发者ID:bluesliverx,项目名称:gradle-android-publisher,代码行数:18,代码来源:AndroidPublisherHelper.java


示例4: authorizeWithInstalledApplication

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
/**
 * Authorizes the installed application to access user's protected data.
 *
 * @throws IOException
 * @throws GeneralSecurityException
 */
private static Credential authorizeWithInstalledApplication() throws IOException {
    log.info("Authorizing using installed application");

    // load client secrets
    GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(
            JSON_FACTORY,
            new InputStreamReader(
                    AndroidPublisherHelper.class
                            .getResourceAsStream(RESOURCES_CLIENT_SECRETS_JSON)));
    // Ensure file has been filled out.
    checkClientSecretsFile(clientSecrets);

    dataStoreFactory = new FileDataStoreFactory(DATA_STORE_DIR);

    // set up authorization code flow
    GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow
            .Builder(HTTP_TRANSPORT,
                    JSON_FACTORY, clientSecrets,
                    Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER))
                    .setDataStoreFactory(dataStoreFactory).build();
    // authorize
    return new AuthorizationCodeInstalledApp(
            flow, new LocalServerReceiver()).authorize(INST_APP_USER_ID);
}
 
开发者ID:rocel,项目名称:playstorepublisher,代码行数:31,代码来源:AndroidPublisherHelper.java


示例5: authorizeWithServiceAccount

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
/**
 * Global instance of the {@link com.google.api.client.util.store.DataStoreFactory}. The best practice is to
 * make it a single globally shared instance across your application.
 */

private static Credential authorizeWithServiceAccount(String serviceAccountEmail, File pk12File)
        throws GeneralSecurityException, IOException {
    log.info(String.format("Authorizing using Service Account: %s", serviceAccountEmail));

    // Build service account credential.
    GoogleCredential credential = new GoogleCredential.Builder()
            .setTransport(HTTP_TRANSPORT)
            .setJsonFactory(JSON_FACTORY)
            .setServiceAccountId(serviceAccountEmail)
            .setServiceAccountScopes(
                    Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER))
            .setServiceAccountPrivateKeyFromP12File(pk12File)
            .build();
    return credential;
}
 
开发者ID:chrissd23,项目名称:play-publisher-bootstrapper,代码行数:21,代码来源:AndroidPublisherHelper.java


示例6: init

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
public static AndroidPublisher init(Context context, String fileName) throws IOException {
    Preconditions.checkArgument(!Strings.isNullOrEmpty(context.getPackageName()), "applicationId cannot be null or empty!");
    newTrustedTransport();
    GoogleCredential credential = GoogleCredential.fromStream(context.getAssets().open(fileName), HTTP_TRANSPORT, JSON_FACTORY);
    credential = credential.createScoped(Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER));

    return new AndroidPublisher.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
            .setApplicationName(context.getPackageName())
            .build();
}
 
开发者ID:sugoi-wada,项目名称:appversionchecker,代码行数:11,代码来源:AndroidPublisherHelper.java


示例7: authorizeWithServiceAccount

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
private static Credential authorizeWithServiceAccount(String serviceAccountEmail)
        throws GeneralSecurityException, IOException {
    log.info(String.format("Authorizing using Service Account: %s", serviceAccountEmail));

    // Build service account credential.
    GoogleCredential credential = new GoogleCredential.Builder()
            .setTransport(HTTP_TRANSPORT)
            .setJsonFactory(JSON_FACTORY)
            .setServiceAccountId(serviceAccountEmail)
            .setServiceAccountScopes(
                    Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER))
            .setServiceAccountPrivateKeyFromP12File(new File(PropertiesComponent.getInstance().getValue(GoogleConfigurationView.KEY_PATH_TO_P12)))
            .build();
    return credential;
}
 
开发者ID:droidchef,项目名称:pubplug,代码行数:16,代码来源:AndroidPublisherHelper.java


示例8: authorizeWithServiceAccount

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
private static Credential authorizeWithServiceAccount(String serviceAccountEmail)
        throws GeneralSecurityException, IOException {
    log.info(String.format("Authorizing using Service Account: %s", serviceAccountEmail));

    // Build service account credential.
    GoogleCredential credential = new GoogleCredential.Builder()
            .setTransport(HTTP_TRANSPORT)
            .setJsonFactory(JSON_FACTORY)
            .setServiceAccountId(serviceAccountEmail)
            .setServiceAccountScopes(
                    Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER))
            .setServiceAccountPrivateKeyFromP12File(new File(SRC_RESOURCES_KEY_P12))
            .build();
    return credential;
}
 
开发者ID:rocel,项目名称:playstorepublisher,代码行数:16,代码来源:AndroidPublisherHelper.java


示例9: getScopes

import com.google.api.services.androidpublisher.AndroidPublisherScopes; //导入依赖的package包/类
@Override
public Collection<String> getScopes() {
	return Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER);
}
 
开发者ID:DavidHamm,项目名称:google-play-publisher,代码行数:5,代码来源:AndroidPublisherScopeRequirement.java



注:本文中的com.google.api.services.androidpublisher.AndroidPublisherScopes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SecondaryIndexSearcher类代码示例发布时间:2022-05-22
下一篇:
Java DataSink类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap