我一直想要啓用proguard很長一段時間,但它似乎很麻煩。Libgdx enable proguard
但我在想是否可行只啓用proguard刪除程序不使用的類,我有一個簡單的遊戲加權幾乎25mb,我甚至沒有2mb的資產,我不在乎關於混淆。
這應該更容易實施嗎?因爲啓用proguard時大多數錯誤是由於混淆?
我可以這樣做嗎?怎麼樣?
感謝
編輯:
我用eclipse
build.gradle
文件:
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "test"
gdxVersion = '1.9.5'
roboVMVersion = '2.3.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
admobVersion = '10.2.1';
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
compile "com.google.android.gms:play-services-ads:$admobVersion"
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
compile fileTree(dir: 'libs', include: '*.jar')
}
}
tasks.eclipse.doLast {
delete ".project"
}
proguard主要用於混淆,但如果考慮它的大小,它只會減少2-3 mb。 25Mb與2Mb資產。我擁有10 MB的資產,擁有7.5 MB的資產。 – Aryan
@AbhishekAryan我不知道,我猜想谷歌播放服務lib添加像7mb和Im只使用它的admob廣告 – centenond
我也使用'com.google.android.gms:play-services的谷歌播放服務的廣告子模塊-ads:10.0.1',但對於libGDX項目來說仍然是25 MB。 – Aryan