提交 de005c22 作者: 刘添

更新demo

上级 1d6844f0
My Application
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven4" />
<option name="name" value="maven4" />
<option name="url" value="https://repo1.maven.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="https://www.jitpack.io" />
</remote-repository>
<remote-repository>
<option name="id" value="maven5" />
<option name="name" value="maven5" />
<option name="url" value="https://artifact.bytedance.com/repository/Volcengine/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="https://jitpack.io2" />
</remote-repository>
<remote-repository>
<option name="id" value="maven6" />
<option name="name" value="maven6" />
<option name="url" value="https://artifact.bytedance.com/repository/ttgamesdk/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://jitpack.io" />
</remote-repository>
<remote-repository>
<option name="id" value="maven7" />
<option name="name" value="maven7" />
<option name="url" value="https://maven.aliyun.com/repository/jcenter" />
</remote-repository>
<remote-repository>
<option name="id" value="maven8" />
<option name="name" value="maven8" />
<option name="url" value="https://maven.aliyun.com/repository/google" />
</remote-repository>
<remote-repository>
<option name="id" value="maven9" />
<option name="name" value="maven9" />
<option name="url" value="https://maven.aliyun.com/repository/central" />
</remote-repository>
</component>
</project>
\ No newline at end of file
{
"version": 1,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.liuxiaotian.xiaofengye",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"properties": [],
"versionCode": 1,
"versionName": "1",
"enabled": true,
"outputFile": "app-release.apk"
}
]
}
\ No newline at end of file
package com.liuxiaotian.myapplication;
import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;
import androidx.multidex.MultiDex;
import com.zwwl.overseas.game.module.api.GameApplicationService;
public class App extends Application {
@Override
protected void attachBaseContext(Context base) {
GameApplicationService.getInstance().attachBaseContext(base);
super.attachBaseContext(base);
}
@Override
public void onCreate() {
super.onCreate();
MultiDex.install(this);
GameApplicationService.getInstance().onCreate(this,1);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
GameApplicationService.getInstance().onConfigurationChanged(this);
}
}
package com.liuxiaotian.myapplication.game
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.Button
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.liuxiaotian.myapplication.R
import com.zwwl.overseas.game.module.api.GameService
import com.zwwl.overseas.game.module.calback.InitZyCallback
import com.zwwl.overseas.game.module.calback.OnLoginListener
import com.zwwl.overseas.game.module.calback.OnPlayListener
import com.zwwl.overseas.game.module.calback.RoleInfoCallBack
import com.zwwl.overseas.game.module.model.CustomPayParam
import org.json.JSONObject
import java.util.*
import kotlin.collections.HashMap
class MainActivity : AppCompatActivity() {
private val mBtn: Button by lazy { findViewById<Button>(R.id.btn) }
private val mLoginOut: Button by lazy { findViewById<Button>(R.id.login_out) }
private val mRoleCreate: Button by lazy { findViewById<Button>(R.id.role_create) }
private val mRoleOnline: Button by lazy { findViewById<Button>(R.id.role_online) }
private val mRoleLevelUp: Button by lazy { findViewById<Button>(R.id.role_level_up) }
private val mRoleOffline: Button by lazy { findViewById<Button>(R.id.role_offline) }
private val mRoleOther: Button by lazy { findViewById<Button>(R.id.role_other) }
private val mTvLoginInfo: TextView by lazy { findViewById<TextView>(R.id.tv_login_info) }
private val mTvRoleInfo: TextView by lazy { findViewById<TextView>(R.id.tv_role_info) }
private val mGooglePay: Button by lazy { findViewById<Button>(R.id.btn_goole) }
private val TAG= MainActivity::class.java.simpleName
private var mPayerId=""
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
GameService.getInstance().init(this,"","")
mBtn.setOnClickListener {
gameLogin()
}
mRoleCreate.setOnClickListener {
setRoleReporting("create")
}
mRoleOnline.setOnClickListener {
setRoleReporting("online")
}
mRoleLevelUp.setOnClickListener {
setRoleReporting("level_up")
}
mRoleOffline.setOnClickListener {
setRoleReporting("offline")
}
mRoleOther.setOnClickListener {
setRoleReporting("other")
}
mLoginOut. setOnClickListener { loginOut() }
mGooglePay.setOnClickListener {googlePlay()
}
}
private fun googlePlay(){
val data = CustomPayParam()
val role = CustomPayParam.RoleBean()
val orderInfo = CustomPayParam.OrderBean()
role.event = "other"
role.server_id = "100001"
role.role_name = "主宰传奇"
role.cp_role_id = System.currentTimeMillis().toString() + ""
role.server_name = "主宰服"
role.role_level = "83"
role.role_vip = "0"
orderInfo.cp_order_id = System.currentTimeMillis().toString() + ""
orderInfo.amount = "100"
orderInfo.product_price = "100"
orderInfo.product_id = "1505dian" //Google后台配置商品ID
orderInfo.product_cnt = "1"
orderInfo.product_name = "1元档充值"
orderInfo.product_desc = "商品"
orderInfo.ext = "测试数据"
data.role = role
data.order = orderInfo
GameService.getInstance().googlePlay(data,object :OnPlayListener<Any>{
override fun onSuccess(t: Any?) {
}
override fun onFailure(msg: String?) {
}
})
}
override fun onDestroy() {
super.onDestroy()
GameService.getInstance().onDestroy()
}
private fun setRoleReporting(type:String){
if (mPayerId.isEmpty()){
Toast.makeText(this,"请登录成功在进行角色创建",Toast.LENGTH_LONG).show()
return
}
val map=HashMap<String,String>()
map["attack"] = "0"
map["chapter_index"] = "0"
map["combat_num"] = "0"
map["cp_role_id"] = "0"
map["event"] = type
map["gang_name"] = "unknown"
map["main_city_level"] = "0"
map["online_time"] = "0"
map["power"] = "0"
map["profession"] = "unknown"
map["reiki_num"] = "0"
map["role_level"] = "23"
map["cp_role_id"] = "0"
map["role_name"] = "啊啊啊"
map["role_vip"] = "0"
map["server_id"] = "4433175"
map["server_name"] = "4433175"
map["sponsor_level"] = "0"
map["trans_level"] = "0"
val json= JSONObject()
for ((key, value) in map) {
json.put(key, value)
}
GameService.getInstance().setRoleReporting(json.toString(),"",mPayerId,object :RoleInfoCallBack<Any>{
override fun onSuccess(t: Any?) {
when(type){
"create"->{
mTvRoleInfo.text="创建成功"
}
"online"->{
mTvRoleInfo.text="角色登录完成"
}
"level_up"->{
mTvRoleInfo.text="角色升级完成"
}
"offline"->{
mTvRoleInfo.text="角色退出完成"
}
"other"->{
mTvRoleInfo.text="角色其他状态更改成功"
}
}
}
override fun onFailure(msg: String?) {
}
})
}
private fun gameLogin(){
GameService.getInstance().showLogin(object : OnLoginListener<Any> {
override fun loginSuccess(data: Any) {
Log.e(TAG, "返回数据成功:$data")
val json=JSONObject(data.toString())
val statusCode=json.getInt("status_code")
if (statusCode==1){
mTvLoginInfo.text = json.getJSONObject("data").getString("username")
mTvLoginInfo.visibility= View.VISIBLE
mPayerId = json.getJSONObject("data").getString("player_id")
}
}
override fun loginError(data: Any?) {}
})
}
private fun loginOut(){
GameService.getInstance().loginOut(object:InitZyCallback{
override fun onSuccess(status: String?) {
}
override fun onFailed(o: String?) {
}
})
}
}
\ No newline at end of file
package com.liuxiaotian.myapplication.log;
import android.util.Log;
import com.liuxiaotian.myapplication.BuildConfig;
public class MyLog {
static String className;//类名
static String methodName;//方法名
static int lineNumber;//行数
private MyLog(){
/* Protect from instantiations */
}
public static boolean isDebuggable() {
return BuildConfig.DEBUG;
}
private static String createLog( String log ) {
StringBuffer buffer = new StringBuffer();
buffer.append(methodName);
buffer.append("(").append(className).append(":").append(lineNumber).append(")");
buffer.append(log);
return buffer.toString();
}
private static void getMethodNames(StackTraceElement[] sElements){
className = sElements[1].getFileName();
methodName = sElements[1].getMethodName();
lineNumber = sElements[1].getLineNumber();
}
public static void e(String message){
if (!isDebuggable())
return;
// Throwable instance must be created before any methods
getMethodNames(new Throwable().getStackTrace());
Log.e(className, createLog(message));
}
public static void i(String message){
if (!isDebuggable())
return;
getMethodNames(new Throwable().getStackTrace());
Log.i(className, createLog(message));
}
public static void d(String message){
if (!isDebuggable())
return;
getMethodNames(new Throwable().getStackTrace());
Log.d(className, createLog(message));
}
public static void v(String message){
if (!isDebuggable())
return;
getMethodNames(new Throwable().getStackTrace());
Log.v(className, createLog(message));
}
public static void w(String message){
if (!isDebuggable())
return;
getMethodNames(new Throwable().getStackTrace());
Log.w(className, createLog(message));
}
public static void wtf(String message){
if (!isDebuggable())
return;
getMethodNames(new Throwable().getStackTrace());
Log.wtf(className, createLog(message));
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<Button
android:id="@+id/btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="登录注册"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/login_out"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="退出登录"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_goole"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="支付"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:textColor="@color/black"
android:text="角色创建类型"
android:layout_marginLeft="10dp"
android:textSize="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_margin="5dp"
android:id="@+id/role_create"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="创角"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:layout_margin="5dp"
android:id="@+id/role_online"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="登录"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:layout_margin="5dp"
android:id="@+id/role_level_up"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="升级"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:layout_margin="5dp"
android:id="@+id/role_offline"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="退出"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:layout_margin="5dp"
android:id="@+id/role_other"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="其他"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
<TextView
android:textColor="@color/black"
android:id="@+id/tv_login_info"
android:hint="登录信息"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:hint="角色信息"
android:textColor="@color/black"
android:id="@+id/tv_role_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="g_top_margin">100dp</dimen>
</resources>
<resources>
<string name="app_name">App</string>
<string name="app_id">1086324640822-rhv2dcerpa0ig961pig3lscckaqehjkc.apps.googleusercontent.com</string>
<string name="app_google_id">1086324640822-ghcdp46r3g9f97nh1mghcm2jcbjvilcv.apps.googleusercontent.com</string>
<string name="title_text">Google Sign-In\nQuickstart</string>
<!-- Sign-in status messages -->
<string name="signed_in_fmt">Signed in as: %s</string>
<string name="signed_in">Signed in</string>
<string name="signing_in">Signing in…</string>
<string name="signed_out">Signed out</string>
<string name="signed_in_err">"Error: please check logs."</string>
<string name="error_null_person">
Error: Plus.PeopleApi.getCurrentPerson returned null. Ensure that the Google+ API is
enabled for your project, you have a properly configured google-services.json file
and that your device has an internet connection.
</string>
<string name="loading">Loading…</string>
<string name="auth_code_fmt">Auth Code: %s</string>
<string name="id_token_fmt">ID Token: %s</string>
<!-- Google Play Services error for Toast -->
<string name="play_services_error_fmt">Google Play Services Error: %i</string>
<!-- Button labels -->
<string name="sign_out">Sign Out</string>
<string name="disconnect">Disconnect</string>
<string name="refresh_token">Get Fresh Token</string>
<!-- Content Description for images -->
<string name="desc_google_icon">Google Logo</string>
<!-- Rationale for asking for Contacts -->
<string name="contacts_permission_rationale">Contacts access is needed in order to retrieve your email address.</string>
<!-- Activity Names and Descriptions -->
<string name="name_sign_in_activity">SignInActivity</string>
<string name="desc_sign_in_activity">Signing in, signing out, and revoking access.</string>
<string name="desc_sign_in_activity_scopes">Signing in, signing out, and revoking access with Google Drive permissions.</string>
<string name="name_id_token_activity">IdTokenActivity</string>
<string name="desc_id_token_activity">Retrieving an ID Token for the user.</string>
<string name="desc_auth_code_activity">Demonstrate retrieving an auth code for authorizing your server.</string>
<string name="name_auth_code_activity">ServerAuthCodeActivity</string>
<string name="desc_rest_activity">Demonstrate using Google Sign In with a Google REST API</string>
<string name="name_rest_activity">RestApiActivity</string>
<!-- Messages for the Rest API activity -->
<string name="connections_fmt">Connections: %1$s</string>
<string name="msg_contacts_failed">Get contacts failed.</string>
<!-- TODO(user): replace with your real server client ID -->
<!-- Server Client ID. This should be a valid Web OAuth 2.0 Client ID obtained
from https://console.developers.google.com/ -->
<string name="server_client_id">1086324640822-ghcdp46r3g9f97nh1mghcm2jcbjvilcv.apps.googleusercontent.com</string>
<string name="facebook_app_id">312901538156817</string>
<string name="facebook_client_token">d8f89d3621ea8b5483b96de0f73091bd</string>
</resources>
\ No newline at end of file
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
<!-- Activity with no Title -->
<style name="ThemeOverlay.MyNoTitleActivity" parent="AppTheme">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<!-- Dark Buttons -->
<style name="ThemeOverlay.MyDarkButton" parent="ThemeOverlay.AppCompat.Dark">
<item name="colorButtonNormal">@color/blue_grey_500</item>
<item name="android:textColor">@android:color/white</item>
</style>
</resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.31"
repositories {
google()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
maven { url "https://www.jitpack.io" }
maven {
url 'https://artifact.bytedance.com/repository/ttgamesdk/'
}
maven {
url 'https://artifact.bytedance.com/repository/ttgamesdk_dev/'
}
maven {
url 'https://maven.byted.org/repository/android_public/'
}
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'http://nexus.zwwlkj01.top/repository/Android/' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.bytedance.ttgame:gbsdk_helper:1.0.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
maven { url "https://www.jitpack.io" }
maven {
url 'https://artifact.bytedance.com/repository/ttgamesdk/'
}
maven {
url 'https://artifact.bytedance.com/repository/ttgamesdk_dev/'
}
maven {
url 'https://maven.byted.org/repository/android_public/'
}
maven { url 'http://nexus.zwwlkj01.top/repository/Android/' }
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/central' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
\ No newline at end of file
-----BEGIN PUBLIC KEY-----
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAt4MI32exXeSy+iMnJTsc
lWXF/96c4rx3BTV6zp6nDY9NN3Q/mygFiQokIPKQtU/IrKzEe+z24d4GaKPkX4Tw
Z380f0XeiA3EeVLhGY15cCJiGpAbiJ1T/8djwpERAk467EFs3RrwTOeJtJJtbqEH
vAhS3N6OVoaX1YHz/jToQLlhxgfuox0Lac4xTwHLeHYFINWnlbfy2WtK9yqcFlg9
cCQszwq+tYpR+WI/4vhcUNp9sp3M4FYE5vVlpW95PDaxSFB/N5PeJl18YP0hb1aM
TfsWzuvDIinpTOkE1n7kwGaRbDfoUMBeZdEzh2roZhynvQ+4SIg2mhoEhXGaVD5x
k6UwfNSxEUyZqlyPsVSIvYyXR5yk6vyflZk6fau7IuOv3Odc+y9zCS30pK5DB3cC
cq+IM12IAtqW6S/YREkdRE8kTff2BtFs/ApVnJxw63jDW1U/GqJ6yQgkR4g/jYdh
HZgcLFOZvmkkSOmNUc+tzcKAmV2w/4q1zrj9D2/HTYMrAgMBAAE=
-----END PUBLIC KEY-----
rootProject.name = "My Application"
include ':app'
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
<bytecodeTargetLevel target="17" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
......@@ -14,8 +12,8 @@
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
<option name="offlineMode" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.0" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'org.jetbrains.kotlin.android'
id("com.google.gms.google-services")
}
android {
compileSdkVersion 28
namespace 'com.zwwl.game.zhangwansdk'
compileSdk 34
defaultConfig {
applicationId "com.liuxiaotian.xiaofengye"
minSdkVersion 21
targetSdkVersion 28
applicationId "com.android.zw.brave"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', 'src/main/aidl']
resources.srcDirs = ['src/main/java', 'src/main/aidl']
aidl.srcDirs = ['src/main/aidl']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
......@@ -47,23 +34,18 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.1'
}
}
dependencies {
implementation fileTree(dir: 'libs', includes: ['*.aar'])
implementation fileTree(dir: 'libs', includes: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.zwwl.legend.sdk:legend:1.0.1.5'
// implementation 'com.google.android.gms:play-services-auth:20.7.0'
// implementation 'com.google.android.gms:play-services-analytics:17.0.0'
// implementation "com.android.installreferrer:installreferrer:2.0"
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.zwwl.legend.sdk:legend:1.0.3'
implementation 'com.google.code.gson:gson:2.8.6'
}
\ No newline at end of file
{
"project_info": {
"project_number": "542137957301",
"project_id": "heroes-awakening",
"storage_bucket": "heroes-awakening.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:542137957301:android:1f4e0c83857b26e90637fc",
"android_client_info": {
"package_name": "com.android.zw.brave"
}
},
"oauth_client": [
{
"client_id": "542137957301-3nd59233ijkv0ta9fds30coap72c909l.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDEfWQ7iK6lIxNaE-nPlYWqEI28O61B3Og"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "542137957301-3nd59233ijkv0ta9fds30coap72c909l.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "542137957301-50ffoba7a8g68lncsb1qkuv0aujubvn6.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.farsun.rotbotminer.ios"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:542137957301:android:882e37394f15ed230637fc",
"android_client_info": {
"package_name": "com.zw.jjdqs.gp"
}
},
"oauth_client": [
{
"client_id": "542137957301-0im7dmd3bhirhl718s1st8qv4k2d51ot.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.zw.jjdqs.gp",
"certificate_hash": "73f5e195294030be78b5f2362073c02b34030937"
}
},
{
"client_id": "542137957301-3nd59233ijkv0ta9fds30coap72c909l.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDEfWQ7iK6lIxNaE-nPlYWqEI28O61B3Og"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "542137957301-3nd59233ijkv0ta9fds30coap72c909l.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "542137957301-50ffoba7a8g68lncsb1qkuv0aujubvn6.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.farsun.rotbotminer.ios"
}
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
package com.liuxiaotian.myapplication
package com.zwwl.game.zhangwansdk
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
......@@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.myapplication", appContext.packageName)
assertEquals("com.zwwl.game.zhangwansdk", appContext.packageName)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.liuxiaotian.myapplication">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
xmlns:tools="http://schemas.android.com/tools">
<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication">
<activity android:name=".game.MainActivity">
android:name=".MyApp"
android:theme="@style/Theme.ZhangwanSdk"
tools:targetApi="31">
<activity
android:name=".activity.SdkMainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.ZhangwanSdk">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> <!-- 添加 Google 登录配置 -->
</activity>
<meta-data
android:name="game_id"
android:value="1"/>
android:value="42" />
<meta-data
android:name="main_game_id"
android:value="1"/>
android:value="13" />
</application>
</manifest>
\ No newline at end of file
package com.zwwl.game.zhangwansdk
import android.app.Application
import android.content.Context
import android.content.res.Configuration
import com.zwwl.overseas.game.module.api.GameApplicationService
class MyApp : Application() {
override fun attachBaseContext(base: Context) {
GameApplicationService.getInstance().attachBaseContext(base)
super.attachBaseContext(base)
}
override fun onCreate() {
super.onCreate()
GameApplicationService.getInstance().onCreate(this, 1)
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
GameApplicationService.getInstance().onConfigurationChanged(this)
}
}
\ No newline at end of file
package com.zwwl.game.zhangwansdk.activity;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseArray;
import android.widget.GridView;
import com.zwwl.game.zhangwansdk.R;
import com.zwwl.game.zhangwansdk.adapter.ListViewAdapter;
import com.zwwl.game.zhangwansdk.manager.ModuleManager;
import com.zwwl.game.zhangwansdk.manager.SdkZwManager;
import com.zwwl.game.zhangwansdk.module.BaseModule;
import com.zwwl.game.zhangwansdk.utils.AppUtils;
import com.zwwl.overseas.game.module.api.GameService;
import com.zwwl.overseas.game.module.calback.CheckLoginCallBack;
import java.util.Locale;
public class SdkMainActivity extends Activity {
private SparseArray<BaseModule> mNameList;
private GridView mModuleListView;
private ListViewAdapter adapter;
private BaseModule mSeletedModule;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sdk_main);
AppUtils.updateActivity(this);
Locale locale = Locale.getDefault();
String language = locale.getLanguage();
Log.e("systenmLanguage:",language.toString());
if (language.equals("zh")) {
// 如果系统语言为中文
Log.e("systenmLanguage:","中文");
} else {
// 如果系统语言为其他语言
Log.e("systenmLanguage:",language.toString());
}
init();
initView();
}
private void init(){
GameService.getInstance().init(this, "", "", new CheckLoginCallBack() {
@Override
public void initSdk(boolean o) {
if (o){
AppUtils.startMaxAd();
}
}
@Override
public void onCheckLogin(Object object) {
AppUtils.showToast("开始执行退出登录");
}
@Override
public void onGameDelete(Object object) {
AppUtils.showToast("删除账号");
}
@Override
public void onFailed(String o) {
}
});
}
private void initView(){
mNameList = ModuleManager.sModulesList;
mModuleListView = (GridView) findViewById(R.id.gridview);
mModuleListView.setSelector(new ColorDrawable(Color.TRANSPARENT));
adapter = new ListViewAdapter(this, mNameList);
mModuleListView.setAdapter(adapter);
mModuleListView.setOnItemClickListener((parent, view, position, id) -> {
mSeletedModule = mNameList.get(mNameList.keyAt(position));
if ("SDK登录".equals(mSeletedModule.name)){
AppUtils.showCallBackLogin();
}else if("退出登录".equals(mSeletedModule.name)){
AppUtils.outLogin();
}else if("Google广告".equals(mSeletedModule.name)){
Log.e("SdkMainName:","setRewardedAdReady:"+GameService.getInstance().isRewardedReady());
Log.e("SdkMainName:","setInterstitialAdReady:"+GameService.getInstance().isInsertPageReady());
}else if("Google支付".equals(mSeletedModule.name)){
SdkZwManager.INSTANCE.GooglePlay();
}else if("Max广告".equals(mSeletedModule.name)){
GameService.getInstance().showMaxRewardedAd("tesetMax广告");
}else if("角色上报".equals(mSeletedModule.name)){
SdkZwManager.INSTANCE.setRoleReporting("level_up");
}else if("角色登录".equals(mSeletedModule.name)){
SdkZwManager.INSTANCE.setRoleReporting("online");
}else if("角色退出".equals(mSeletedModule.name)){
SdkZwManager.INSTANCE.setRoleReporting("offline");
}else if("其他角色".equals(mSeletedModule.name)){
SdkZwManager.INSTANCE.setRoleReporting("other");
}else if("悬浮球".equals(mSeletedModule.name)){
GameService.getInstance().showBall(this);
}else if("设置".equals(mSeletedModule.name)){
GameService.getInstance().startSettings(this);
}else if ("Max插页广告".equals(mSeletedModule.name)){
GameService.getInstance().showMaxAdInsertPageAd("te st");
}else if("隐私协议".equals(mSeletedModule.name)){
// ActivityUtils.getInstance().startPrivacy(this);
// com.zwwl.overseas.game.module.utils.AppUtils.PrivacyApp(this);
}else if("HashKey".equals(mSeletedModule.name)){
// SdkUtils.INSTANCE.getHashKey(this);
}else if ("CP-SET".equals(mSeletedModule.name)){
}else if ("CP-GET".equals(mSeletedModule.name)){
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
GameService.getInstance().onDestroy();
}
@Override
protected void onResume() {
super.onResume();
GameService.getInstance().onResume();
}
}
\ No newline at end of file
package com.zwwl.game.zhangwansdk.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.zwwl.overseas.game.module.R;
import java.util.List;
/**
* Created by Administrator on 2016/5/6.
*/
public class EventAdapter extends BaseAdapter {
private Context mcontext;
private List<String> list_string;
private ViewHolder viewHolder;
private boolean isOpen=false;
public EventAdapter(Context context, List<String> list_string) {
mcontext = context;
this.list_string = list_string;
}
@Override
public int getCount() {
return list_string.size();
}
@Override
public Object getItem(int position) {
return list_string.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = LayoutInflater.from(mcontext).inflate(R.layout.spinner_layout, null);
viewHolder.textView = (TextView) convertView.findViewById(R.id.textView);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.textView.setText(list_string.get(position));
return convertView;
}
class ViewHolder {
private TextView textView;
}
}
package com.zwwl.game.zhangwansdk.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.zwwl.game.zhangwansdk.R;
import com.zwwl.game.zhangwansdk.module.BaseModule;
public class ListViewAdapter extends BaseAdapter {
private SparseArray<BaseModule> mDataArray;
private Context mContext;
private boolean isLogin;
public ListViewAdapter(@NonNull Context context, @NonNull SparseArray<BaseModule> moduleArray) {
this.mDataArray = moduleArray;
mContext = context;
}
@Override
public int getCount() {
return mDataArray.size();
}
@Override
public BaseModule getItem(int position) {
return mDataArray.get(mDataArray.keyAt(position));
}
@Override
public long getItemId(int position) {
return 0;
}
private static class ViewHolder {
TextView name;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
View view = convertView;
if (view == null) {
view = LayoutInflater.from(mContext).inflate(R.layout.gridview_item, null);
holder = new ViewHolder();
TextView itemText = view.findViewById(R.id.item_txt);
holder.name = itemText;
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
String item = getItem(position).name;
if (TextUtils.isEmpty(item)) {
return null;
}
updateViewByPlatform(holder, view, item);
holder.name.setText(item);
return view;
}
private void updateViewByPlatform(ViewHolder holder, View view, String item) {
handleRenderViewByQQPlatform(holder, view, item);
}
private void handleRenderViewByQQPlatform(ViewHolder holder, View view, String item) {
renderInactiveView(holder, view);
}
private void renderActiveView(ViewHolder holder, View view) {
view.getBackground().setAlpha(255);
holder.name.setTextColor(0xff000000);
}
public void switchInit(boolean isLogin) {
this.isLogin = isLogin;
notifyDataSetChanged();
}
private void renderInactiveView(ViewHolder holder, View view) {
view.getBackground().setAlpha(60);
holder.name.setTextColor(0x60000000);
}
}
package com.zwwl.game.zhangwansdk.manager;
import android.util.SparseArray;
import com.zwwl.game.zhangwansdk.module.AppLinMaxCYModule;
import com.zwwl.game.zhangwansdk.module.AppLinMaxModule;
import com.zwwl.game.zhangwansdk.module.BaseModule;
import com.zwwl.game.zhangwansdk.module.FaceBookHashKeyModule;
import com.zwwl.game.zhangwansdk.module.GetInfoModule;
import com.zwwl.game.zhangwansdk.module.GoogleAdModule;
import com.zwwl.game.zhangwansdk.module.LoginOutModule;
import com.zwwl.game.zhangwansdk.module.OherRoleModule;
import com.zwwl.game.zhangwansdk.module.PlayModule;
import com.zwwl.game.zhangwansdk.module.PriModule;
import com.zwwl.game.zhangwansdk.module.QQModule;
import com.zwwl.game.zhangwansdk.module.RoleLoginModule;
import com.zwwl.game.zhangwansdk.module.RoleModule;
import com.zwwl.game.zhangwansdk.module.RoleOutModule;
import com.zwwl.game.zhangwansdk.module.SetInfoModule;
import com.zwwl.game.zhangwansdk.module.SettingsModule;
import com.zwwl.game.zhangwansdk.module.ShowBallModule;
public class ModuleManager {
public static final int LOGIN = 1;
public static final int OUT_LOGIN = 1 << 1;
public static final int GOOGLE_AD = 1 << 3;
public static final int GOOGLE_PLAY = 1 << 4;
public static final int OTHERS_MODULE = 1 << 5;
public static final int ROLE_SIGN_OUT = 1 << 6;
public static final int ROLE_QITA = 1 << 7;
public static final int ROLE_LOGIN = 1 << 8;
public static final int ROLE_UP = 1 << 9;
public static final int SHOW_BALL = 1 << 10;
public static final int SEETTINGS = 1 << 11;
public static final int CHAYE = 1 << 12;
public static final int YINSI=1 << 13;
public static final int HASH_KEY=1 << 14;
public static final int CP_SET=1 << 15;
public static final int CP_GET=1 << 16;
public static String LANG;
public static SparseArray<BaseModule> sModulesList;
static {
// 添加模块
sModulesList = new SparseArray<>();
sModulesList.append(LOGIN, new QQModule());
sModulesList.append(OUT_LOGIN, new LoginOutModule());
sModulesList.append(GOOGLE_AD, new GoogleAdModule());
sModulesList.append(GOOGLE_PLAY, new PlayModule());
sModulesList.append(OTHERS_MODULE, new AppLinMaxModule());
sModulesList.append(ROLE_LOGIN, new RoleLoginModule());
sModulesList.append(ROLE_SIGN_OUT, new RoleOutModule());
sModulesList.append(ROLE_QITA, new OherRoleModule());
sModulesList.append(ROLE_UP, new RoleModule());
sModulesList.append(SHOW_BALL, new ShowBallModule());
sModulesList.append(SEETTINGS, new SettingsModule());
sModulesList.append(CHAYE,new AppLinMaxCYModule());
sModulesList.append(YINSI,new PriModule());
sModulesList.append(HASH_KEY,new FaceBookHashKeyModule());
sModulesList.append(CP_SET,new SetInfoModule());
sModulesList.append(CP_GET,new GetInfoModule());
}
private ModuleManager() {
}
}
package com.zwwl.game.zhangwansdk.manager
import android.app.Activity
import android.util.Log
import android.view.View
import android.widget.TextView
import com.zwwl.game.zhangwansdk.utils.AppUtils
import com.zwwl.game.zhangwansdk.utils.GsonUtils
import com.zwwl.overseas.game.module.api.GameService
import com.zwwl.overseas.game.module.calback.GoogleAdsCallBack
import com.zwwl.overseas.game.module.calback.InitZyCallback
import com.zwwl.overseas.game.module.calback.OnLoginListener
import com.zwwl.overseas.game.module.calback.OnPlayListener
import com.zwwl.overseas.game.module.calback.RoleInfoCallBack
import com.zwwl.overseas.game.module.model.CustomPayParam
import java.util.HashMap
object SdkZwManager {
private var mPayerId=""
fun inintGoogleAd(activity: Activity){
GameService.getInstance().initGoogleAds(activity,object :
GoogleAdsCallBack {
override fun onSuccess(status: Any?) {
}
override fun onFailed(o: Any?) {
}
})
}
fun GooglePlay() {
val data = CustomPayParam()
val role = CustomPayParam.RoleBean()
val orderInfo = CustomPayParam.OrderBean()
role.event = "other"
role.server_id = "0"
role.role_level="2"
role.role_name = "火箭大亨"
role.cp_role_id = System.currentTimeMillis().toString() +"12366"
role.server_name = "太空一区"
orderInfo.cp_order_id = "com.zwwl.game.match.pack499"
orderInfo.amount = "499"
orderInfo.product_price = "499"
orderInfo.product_id = "com.zwwl.game.match.pack499" //商品ID
orderInfo.product_cnt = "1"
orderInfo.product_name = "钻石160"
orderInfo.product_desc = "商品"
orderInfo.ext = "测试数据"
data.role = role
data.order = orderInfo
GameService.getInstance().googlePlay(data,object : OnPlayListener<Any> {
override fun onSuccess(t: Any?) {
Log.e("GooglePlay:",t.toString());
}
override fun onFailure(msg: String?) {
}
override fun onGooglePlayFailure(o: Any?) {
}
})
}
fun setRoleReporting(type:String){
val map= HashMap<String,String>()
map["attack"] = "0"
map["chapter_index"] = "0"
map["combat_num"] = "0"
map["cp_role_id"] = "0"
map["event"] = type
map["gang_name"] = "unknown"
map["main_city_level"] = "0"
map["online_time"] = "0"
map["power"] = "0"
map["profession"] = "unknown"
map["reiki_num"] = "0"
map["role_level"] = "23"
map["cp_role_id"] = "0"
map["role_name"] = "啊啊啊"
map["role_vip"] = "0"
map["server_id"] = "4433175"
map["server_name"] = "4433175"
map["sponsor_level"] = "0"
map["trans_level"] = "0"
GameService.getInstance().setRoleReporting(GsonUtils.toJson(map),"", mPayerId,object :
RoleInfoCallBack<Any> {
override fun onSuccess(t: Any?) {
when(type){
"create"->{
AppUtils.showToast("创建成功")
}
"online"->{
AppUtils.showToast("角色登录完成")
}
"level_up"->{
AppUtils.showToast("角色升级完成")
}
"offline"->{
AppUtils.showToast("角色退出完成")
}
"other"->{
AppUtils.showToast("角色其他状态更改成功")
}
}
}
override fun onFailure(msg: String?) {
}
})
}
fun gameLogin(mTvLoginInfo:TextView){
GameService.getInstance().showLogin(object : OnLoginListener<Any> {
override fun loginSuccess(data: Any) {
//
}
override fun loginError(data: Any?) {}
})
}
fun loginOut(){
GameService.getInstance().loginOut(object: InitZyCallback {
override fun onSuccess(status: String?) {
}
override fun onFailed(o: String?) {
}
})
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class AppLinMaxCYModule extends BaseModule{
public AppLinMaxCYModule() {
this.name = "Max插页广告";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class AppLinMaxModule extends BaseModule{
public AppLinMaxModule() {
this.name = "Max广告";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public abstract class BaseModule {
public String name;
public abstract void init(LinearLayout parent);
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class CreateRoleModule extends BaseModule{
public CreateRoleModule() {
this.name = "创角";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class FaceBookHashKeyModule extends BaseModule{
public FaceBookHashKeyModule() {
this.name = "HashKey";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class GetInfoModule extends BaseModule{
public GetInfoModule() {
this.name = "CP-GET";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class GoogleAdModule extends BaseModule{
public GoogleAdModule() {
this.name = "Google广告";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class LoginOutModule extends BaseModule{
public LoginOutModule() {
this.name = "退出登录";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class OherRoleModule extends BaseModule{
public OherRoleModule() {
this.name = "其他角色";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class PlayModule extends BaseModule{
public PlayModule() {
this.name = "Google支付";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class PriModule extends BaseModule{
public PriModule() {
this.name = "隐私协议";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class QQModule extends BaseModule{
public QQModule() {
this.name = "SDK登录";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class RoleLoginModule extends BaseModule{
public RoleLoginModule() {
this.name = "角色登录";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class RoleModule extends BaseModule{
public RoleModule() {
this.name = "角色上报";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class RoleOutModule extends BaseModule{
public RoleOutModule() {
this.name = "角色退出";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class SetInfoModule extends BaseModule{
public SetInfoModule() {
this.name = "CP-SET";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class SettingsModule extends BaseModule{
public SettingsModule() {
this.name = "设置";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class ShowBallModule extends BaseModule{
public ShowBallModule() {
this.name = "悬浮球";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.module;
import android.widget.LinearLayout;
public class UpLoveRoleModule extends BaseModule{
public UpLoveRoleModule() {
this.name = "升级";
}
@Override
public void init(LinearLayout parent) {
}
}
package com.zwwl.game.zhangwansdk.utils;
import android.app.Activity;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.zwwl.overseas.game.module.api.GameService;
import com.zwwl.overseas.game.module.calback.ApplovinListener;
import com.zwwl.overseas.game.module.calback.InitZyCallback;
import com.zwwl.overseas.game.module.calback.OnLoginListener;
import java.lang.ref.WeakReference;
public class AppUtils {
private static String TAG="SDK-AppUtils";
private static WeakReference<Activity> sActivityRef = null;
public static void updateActivity(Activity activity) {
sActivityRef = new WeakReference<>(activity);
}
public static @Nullable
Activity getCurActivity() {
if (sActivityRef == null) {
return null;
}
return sActivityRef.get();
}
public static void startMaxAd(){
GameService.getInstance().initMaxApplovin(new ApplovinListener() {
@Override
public void onUserRewarded(@NonNull Object maxAd, @NonNull Object maxReward, int type) {
Log.e(TAG,"onUserRewarded:"+maxAd);
}
@Override
public void onAdLoaded(@NonNull Object maxAd, int type) {
Log.e(TAG,"onAdLoaded:"+maxAd);
}
@Override
public void onAdDisplayed(@NonNull Object maxAd, int type) {
Log.e(TAG,"onAdDisplayed:"+maxAd);
}
@Override
public void onAdHidden(@NonNull Object maxAd, int type) {
Log.e(TAG,"onAdHidden:"+maxAd);
}
@Override
public void onAdClicked(@NonNull Object maxAd, int type) {
Log.e(TAG,"onAdClicked:"+maxAd);
}
@Override
public void onAdLoadFailed(@NonNull String s, @NonNull Object maxError, int type) {
Log.e(TAG,"onAdLoadFailed:"+s);
}
@Override
public void onAdDisplayFailed(@NonNull Object maxAd, @NonNull Object maxError, int type) {
Log.e(TAG,"onAdDisplayFailed:"+maxAd);
}
@Override
public void onAdRevenuePaid(Object entity, int type) {
Log.e(TAG,"onAdRevenuePaid:"+entity);
}
});
}
public static void showLogin(){
GameService.getInstance().showLogin(new OnLoginListener() {
@Override
public void loginSuccess(Object data) {
showToast("登录成功");
}
@Override
public void loginError(Object data) {
}
});
}
public static void showCallBackLogin(){
GameService.getInstance().showNewLoginCallBack(new OnLoginListener() {
@Override
public void loginSuccess(Object data) {
Log.e(TAG,data.toString());
showToast("登录成功");
}
@Override
public void loginError(Object data) {
Log.e(TAG,data.toString());
showToast("登录失败"+data);
}
});
}
public static void outLogin(){
GameService.getInstance().loginOut(new InitZyCallback() {
@Override
public void onSuccess(String status) {
}
@Override
public void onFailed(String o) {
}
});
}
public static void showToast(String msg){
Toast.makeText(getCurActivity(),msg,Toast.LENGTH_LONG).show();
}
}
package com.zwwl.game.zhangwansdk.utils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonNull;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import org.json.JSONObject;
import java.lang.reflect.Type;
import java.util.Map;
/**
* Gson工具类
*/
public class GsonUtils {
private static Gson gson = null;
static {
if (gson == null) {
gson = new Gson();
}
}
private GsonUtils() {
}
public static <T> T parserGsonToObject(String json, Class<T> classOft) {
return (new Gson()).fromJson(json, classOft);
}
/**
* @param src :
* @return :转化后的JSON数据
* @Description : 将对象转为JSON串,此方法能够满足大部分需求
*/
public static String toJson(Object src) {
if (null == src) {
Gson gson = new GsonBuilder().disableHtmlEscaping().create();
return gson.toJson(JsonNull.INSTANCE);
}
try {
Gson gson = new GsonBuilder().disableHtmlEscaping().create();
return gson.toJson(src);
} catch (JsonSyntaxException e) {
e.printStackTrace();
}
return null;
}
/**
* 将json转成bean
* @param gsonString
* @param cls
* @return
*/
public static <T> T GsonToBean(String gsonString, Class<T> cls) {
T t = null;
if (gson != null) {
t = gson.fromJson(gsonString, cls);
}
return t;
}
/**
* @param gsonString 需要转换的字符串,
* @param <T>
* @return 返回map类型数据,多用于不确定键值对类型
*/
public static <T> Map<String, T> GsonToMaps(String gsonString) {
Map<String, T> map = null;
if (gson != null) {
map = gson.fromJson(gsonString, new TypeToken<Map<String, T>>() {
}.getType());
}
return map;
}
/**
* @param json
* @param classOfT
* @return
* @Description : 用来将JSON串转为对象,但此方法不可用来转带泛型的集合
*/
public static <T> Object fromJson(String json, Class<T> classOfT) {
try {
return gson.fromJson(json, (Type) classOfT);
} catch (JsonSyntaxException e) {
e.printStackTrace();
}
return null;
}
/**
* @param json
* @return
* @Description : 用来将JSON串转为对象,此方法可用来转带泛型的集合,如:Type为 new
* TypeToken<List<T>>(){}.getType()
* ,其它类也可以用此方法调用,就是将List<T>替换为你想要转成的类
*/
public static Object fromJson(String json, Type typeOfT) {
try {
return gson.fromJson(json, typeOfT);
} catch (JsonSyntaxException e) {
e.printStackTrace();
}
return null;
}
/**
* 获取json中的某个值,也可先将其转成键值对再获取
*
* @param json
* @param key
* @return
*/
public static String getValue(String json, String key) {
try {
JSONObject object = new JSONObject(json);
return object.getString(key);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
package com.zwwl.game.zhangwansdk.utils;
import android.text.TextUtils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Util {
/**
* 根据手机的分辨率从 dp 的单位 转成为 px
*/
public static int dp(float dpValue) {
final float scale = AppUtils.getCurActivity().getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
/**
* 根据手机的分辨率从 sp 的单位 转成为 px
*/
public static int sp(float spValue) {
final float fontScale = AppUtils.getCurActivity().getResources().getDisplayMetrics().scaledDensity;
return (int) (spValue * fontScale + 0.5f);
}
/**
* 获取md5
*
* @param str
* @return
*/
public static String getMD5(String str) {
if (TextUtils.isEmpty(str)) {
return "";
}
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
byte[] bytes = md5.digest(str.getBytes());
String result = "";
for (byte b : bytes) {
String temp = Integer.toHexString(b & 0xff);
if (temp.length() == 1) {
temp = "0" + temp;
}
result += temp;
}
return result;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return "";
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@color/holo_color_pressed" />
<item android:state_window_focused="false" android:drawable="@color/transparent" />
<item android:state_window_focused="true" android:drawable="@color/transparent" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffff" />
<stroke
android:width="1dp"
android:color="@color/teal_200" />
<padding
android:bottom="1dp"
android:left="0.5dp"
android:right="0.5dp"
android:top="0dp" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 实心 -->
<solid android:color="@color/transparent" />
<!-- 描边 -->
<stroke
android:width="1dp"
android:color="#33b5e5" />
<!-- 圆角 -->
<corners android:radius="8dp" />
<padding
android:bottom="5dp"
android:left="0.5dp"
android:right="0.5dp"
android:top="0dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.GooglePlay">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context="com.zwwl.hjdh.activity.SdkMainActivity">
<TextView
android:textSize="18dp"
android:text="掌玩SDK"
android:gravity="center"
android:background="@color/text_qq"
android:textColor="@color/white"
android:layout_width="match_parent"
android:layout_height="50dp"/>
<GridView
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:numColumns="2"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:layout_marginTop="15dp"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_marginBottom="3dp"
android:stretchMode="columnWidth"
android:gravity="center"
tools:ignore="MissingConstraints" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/demo_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#33b5e5"
android:textSize="22sp"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/angry_btn"
android:shadowColor="#A8A8A8"
android:shadowRadius="5" android:layout_height="wrap_content"
android:layout_width="wrap_content">
</Button>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/gridview_llayout">
<TextView
android:id="@+id/item_txt"
android:layout_width="match_parent"
android:layout_height="58dp"
android:layout_gravity="center"
android:gravity="center"
android:textSize="17sp"
android:textColor="#000000"
android:background="@drawable/gridview_click" />
</LinearLayout>
......@@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
......@@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
......@@ -7,9 +7,9 @@
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="blue_grey_500">#607D8B</color>
<color name="blue_grey_600">#546E7A</color>
<color name="blue_grey_700">#455A64</color>
<color name="blue_grey_800">#37474F</color>
<color name="blue_grey_900">#263238</color>
<color name="transparent">#00000000</color>
<color name="btn_green_up">#00CC99</color>
<color name="btn_green_down">#99FFCD</color>
<color name="holo_color_pressed">#5533b5e5</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">ZhangwanSdk</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="gridview_llayout">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_margin">10dp</item>
<item name="android:background">@drawable/gridview_layoutborder</item>
<item name="android:gravity">center</item>
<item name="android:orientation">vertical</item>
<item name="android:layout_weight">1</item>
</style>
<style name="demo_layout">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_margin">10dp</item>
<item name="android:background">@drawable/layout_border</item>
<item name="android:gravity">center</item>
<item name="android:orientation">vertical</item>
<item name="android:layout_weight">1</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.ZhangwanSdk" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
id("com.google.gms.google-services") version "4.4.1" apply false
}
\ No newline at end of file
......@@ -12,9 +12,12 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.enableJetifier = true
\ No newline at end of file
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
\ No newline at end of file
#Wed Dec 15 15:21:41 CST 2021
#Tue Jul 09 16:16:53 CST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
......@@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
......@@ -66,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
......@@ -109,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
......@@ -138,19 +156,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
......@@ -159,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
......@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
......@@ -35,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
......@@ -45,28 +64,14 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
......
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://www.jitpack.io" }
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven {
url "https://developer.huawei.com/repo/"
}
/*APPLOVIN广告*/
maven { url 'https://artifacts.applovin.com/android' }
maven { url "https://android-sdk.is.com" }
maven { url "https://artifact.bytedance.com/repository/pangle" }
maven { url 'http://nexus.zwwlkj01.top/repository/android-brave/'
allowInsecureProtocol=true
}
}
}
rootProject.name = "ZhangwanSdk"
include ':app'
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论