Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ProGuard - O que é e porque utilizar
Search
Rodrigo Sicarelli
July 23, 2015
Technology
0
130
ProGuard - O que é e porque utilizar
Com pouco esforço, melhore substancialmente o tamanho e a qualidade do seu aplicativo
Rodrigo Sicarelli
July 23, 2015
Tweet
Share
More Decks by Rodrigo Sicarelli
See All by Rodrigo Sicarelli
Melhores práticas para encontrar Crashes utilizando o CrashLytics
rsicarelli
2
160
Firebase para Desenvolvedores
rsicarelli
4
190
A importância de ter Lazy Clients - TDC 2016
rsicarelli
3
220
Acceptance test like a pro
rsicarelli
2
190
Erlang - Why?
rsicarelli
0
72
Android Support Library v23.2.0
rsicarelli
0
55
Other Decks in Technology
See All in Technology
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
14
82k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
2
170
AWS DMS で SQL Server を移行してみた/aws-dms-sql-server-migration
emiki
0
260
JSConf JPのwebsiteをGatsbyからNext.jsに移行した話 - Next.jsの多言語静的サイトと課題
leko
2
200
re:Inventに行くまでにやっておきたいこと
nagisa53
0
800
現場の壁を乗り越えて、 「計装注入」が拓く オブザーバビリティ / Beyond the Field Barriers: Instrumentation Injection and the Future of Observability
aoto
PRO
1
710
東京大学「Agile-X」のFPGA AIデザインハッカソンを制したソニーのAI最適化
sony
0
170
Okta Identity Governanceで実現する最小権限の原則
demaecan
0
210
DSPy入門
tomehirata
6
700
Dify on AWS 環境構築手順
yosse95ai
0
170
Kotlinで型安全にバイテンポラルデータを扱いたい! ReladomoラッパーをAIと実装してみた話
itohiro73
3
110
SOTA競争から人間を超える画像認識へ
shinya7y
0
640
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Building an army of robots
kneath
306
46k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
How to Think Like a Performance Engineer
csswizardry
27
2.2k
Automating Front-end Workflow
addyosmani
1371
200k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
How to Ace a Technical Interview
jacobian
280
24k
BBQ
matthewcrist
89
9.9k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Transcript
O que é e por que utilizar ProGuard
Android Developer @EasyTaxi +RodrigoSicarelli2 github.com/sicachester/weather-guard
None
Otimizando sua aplicação com o ProGuard O que é o
ProGuard? Como funciona Shrinker, Optimizer & Obfuscator Como utilizar em seu projeto
O que é o ProGuard? Genérico Para Java bytecode Shrinker,
optimizer & obfuscator Existe desde 2002 2010 se tornou parte do Android SDK
Como funciona Processed Code Shrink Optimize Obfuscate Android Runtime Application
code Libraries Android Runtime
Android builds Android Asset Packaging Tool Assets XML Res Application
Java source Libraries Java bytecode Assets Compiled XML Res Dalvik bytecode Application Java source Application Java bytecode Libraries Java bytecode Proguard
Por que utilizar? Redução do tamanho de sua aplicação Performance
Remover código de Log, Debug ou códigos de teste Proteção
Shrinking
Shrinking Também chamado de tree shaking, minimizing, shrouding
Shrinking Classe Classe
None
Entry points
getDefaultProguardfile('proguard-android.txt'),'my-rules.pro' Android Play services
Remoção de código morto Propagação de constantes Métodos "inline" Merging
de classes Remoção de logs Otimizações peephole Desvirtualização de métodos ... Optimization
None
None
None
Obfuscating
None
Obfuscating Renomeação: classes/métodos/atributos Remoção de informação de debug: número de
linha, variáveis locais, etc.
None
tamanho das classes.dex tamanho do .apk final Original ProGuard Redução
Original ProGuard Redução ApiDemos 716 kb 482 kb 33 % 2.6 mb 2.5 mb 4 % GoogleIO 3.4 mb 905 kb 75 % 1.9 mb 906 kb 53 % EasyTaxi Driver 7.5 mb 3.7 mb ~ 50 % 5.9 mb 4.5 mb ~ 24 % EasyTaxi Passenger 7.9 mb 2.9 mb ~ 64 % 8 mb 6.2 mb ~ 23 % Redução da aplicação
Original ProGuard Sieve score 6.833 6.666 Loop score 14.831 15.473
Logic score 19.038 47.840 String score 7.694 7.717 Float score 6.425 6.488 Method score 4.850 5.229 Score total 8.794 10.436 + 18% Performance
Como habilitar
Just do it!
Android Developer @EasyTaxi +RodrigoSicarelli2 github.com/sicachester/weather-guard
[email protected]
Obrigado!