proguard

ShortcutBadgerDemo【安卓应用角标(badge)实现方案】

◇◆丶佛笑我妖孽 提交于 2021-01-07 00:57:25
版权声明:本文为 HaiyuKing 原创文章,转载请注明出处! 概述 本文主要使用的开源库是 leolin310148/ShortcutBadger ,但是在其基础上做了一些修改。 什么是应用角标? 1、角标,英文名badge,即桌面上显示未读消息的小数字,原ios功能,Android原生并没有该功能。(原生的Android系统,是不支持应用角标的) 应用角标最开始是在ios系统中出现的,大概长这样: 不知道从什么时候开始,国内各大安卓手机系统上,也慢慢出现了应用角标的身影,到现在几乎成为了安卓系统的标配。 2、目前被大部分android厂商所支持,但都是厂商自己支持,所以要考虑不同品牌的兼容问题。 3、应用角标是一个带有争议的设计,有些强迫症用户对应用角标咬牙切齿,有些用户看不到应用角标又浑身痒痒。 如何支持应用角标? 1、安卓应用的角标是由Launcher支持的,而原生的Android系统Launcher并没有提供角标支持,所以各大手机厂商只能自己定制Launcher来实现,然后提供接口给外部使用。 2、主流的做法都是通过广播Intent的形式来提供接口,不同的手机系统所支持的广播Intent也不太一样,所以需要针对不同的手机系统来做适配(恭喜你又成功跳入一个系统适配的坑!)。 3、添加角标的原理就是发送一个Broadcast(广播)

Can we shrink all classes but only obfuscate some with proguard?

泪湿孤枕 提交于 2021-01-03 14:46:57
问题 Typically, excluding a class with -keep prevents the class from being obfuscated However it also prevents it from being shrunk. Is it possible to define a proguard-project.txt that will shrink all classes except those that are excluded with -keep, but also obfuscate only a specific subset of the classes? The aim is to use proguard to keep below the android 65k method limit, while also obfuscating first party code ONLY within the APK. Thanks 回答1: Yes, you can add the modifier allowshrinking to

Can we shrink all classes but only obfuscate some with proguard?

ε祈祈猫儿з 提交于 2021-01-03 14:40:48
问题 Typically, excluding a class with -keep prevents the class from being obfuscated However it also prevents it from being shrunk. Is it possible to define a proguard-project.txt that will shrink all classes except those that are excluded with -keep, but also obfuscate only a specific subset of the classes? The aim is to use proguard to keep below the android 65k method limit, while also obfuscating first party code ONLY within the APK. Thanks 回答1: Yes, you can add the modifier allowshrinking to

Can we shrink all classes but only obfuscate some with proguard?

百般思念 提交于 2021-01-03 14:39:36
问题 Typically, excluding a class with -keep prevents the class from being obfuscated However it also prevents it from being shrunk. Is it possible to define a proguard-project.txt that will shrink all classes except those that are excluded with -keep, but also obfuscate only a specific subset of the classes? The aim is to use proguard to keep below the android 65k method limit, while also obfuscating first party code ONLY within the APK. Thanks 回答1: Yes, you can add the modifier allowshrinking to

Proguard and Netty 5 on Android

别等时光非礼了梦想. 提交于 2021-01-03 08:38:12
问题 I've seen a couple questions regarding this issue, but they are for older versions of Netty. I have tried their answers, switching org.jboss.netty out with io.netty, but the same error occurs. I'm trying to compile an Android app that uses Netty 5.0.0Alpha2 (build #16) with Proguard enabled. Without Proguard, the app runs fine. As soon as I enable Proguard, I get this exception when it tries to use Netty: java.lang.IllegalStateException: unknown type parameter 'I': class io.netty.channel

How to keep original line numbers in stack traces with R8?

十年热恋 提交于 2020-12-26 11:06:27
问题 I'm trying to figure out how to keep original line numbers with R8. Doing an app with current AndroidStudio and obfuscating it with R8, and even uploading mapping.txt file to Google Play Console, the Stack Traces of the users are useless in some cases, because the lines of the crash are not the same as in the real non obfuscated file. This is a sample, my class doesn't have 3000 lines, but the error is reported in line 3052 ( com.mypackage.activities.ManagerActivity.onCreate (ManagerActivity

Obfuscate Java Jar with dependencies using Maven Proguard Plugin in a Hello World project

久未见 提交于 2020-12-15 06:33:16
问题 I started from the most simple Maven generated project and added a class that should be ofuscated There is no obfuscation after mvn clean install I attached an archive with the whole Maven / Intellij project https://drive.google.com/file/d/1D0G5LGsJmhIAP8dEx0WtxXEx5pTe3VNM/view?usp=sharing pom is <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0

Obfuscate Java Jar with dependencies using Maven Proguard Plugin in a Hello World project

℡╲_俬逩灬. 提交于 2020-12-15 06:31:28
问题 I started from the most simple Maven generated project and added a class that should be ofuscated There is no obfuscation after mvn clean install I attached an archive with the whole Maven / Intellij project https://drive.google.com/file/d/1D0G5LGsJmhIAP8dEx0WtxXEx5pTe3VNM/view?usp=sharing pom is <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0

Google Play Console: incorrect line numbers in pre-launch crash report using mapping.txt / proguard-rules.pro

徘徊边缘 提交于 2020-12-15 05:32:14
问题 My Android release build uses the following proguard-rules.pro -keepattributes Signature -keepattributes *Annotation* -keepattributes EnclosingMethod -keepattributes InnerClasses -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable -keepnames class com.mypackage.** { *; } -keepclassmembers class com.mypackage.** { *; } ... I'm uploading mapping.txt along with the build when performing the Google Play console pre-launch testing. Any crashes during testing have the

Google Play Console: incorrect line numbers in pre-launch crash report using mapping.txt / proguard-rules.pro

可紊 提交于 2020-12-15 05:30:54
问题 My Android release build uses the following proguard-rules.pro -keepattributes Signature -keepattributes *Annotation* -keepattributes EnclosingMethod -keepattributes InnerClasses -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable -keepnames class com.mypackage.** { *; } -keepclassmembers class com.mypackage.** { *; } ... I'm uploading mapping.txt along with the build when performing the Google Play console pre-launch testing. Any crashes during testing have the