fix(deobf): update TLDs (PR#2320)

This commit is contained in:
pubiqq 2024-10-25 18:44:07 +03:00 committed by GitHub
parent c0815b12bc
commit 688dea0c50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1458 additions and 477 deletions

View File

@ -9,8 +9,7 @@ import jadx.core.dex.nodes.PackageNode;
import jadx.core.utils.exceptions.JadxRuntimeException;
/**
* Provides a list of all top level domains with 3 characters and less,
* so we can exclude them from deobfuscation.
* Provides a list of all top level domains, so we can exclude them from deobfuscation.
*/
public class ExcludePackageWithTLDNames extends AbstractDeobfCondition {
@ -18,23 +17,22 @@ public class ExcludePackageWithTLDNames extends AbstractDeobfCondition {
* Lazy load TLD set
*/
private static class TldHolder {
private static final Set<String> TLD_SET = loadTldFile();
private static final Set<String> TLD_SET = loadTldSet();
}
private static Set<String> loadTldFile() {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(TldHolder.class.getResourceAsStream("tld_3.txt")))) {
private static Set<String> loadTldSet() {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(TldHolder.class.getResourceAsStream("tlds.txt")))) {
return reader.lines()
.map(String::trim)
.filter(line -> !line.startsWith("#") && !line.isEmpty())
.collect(Collectors.toSet());
} catch (Exception e) {
throw new JadxRuntimeException("Failed to load top level domain list file: tld_3.txt", e);
throw new JadxRuntimeException("Failed to load top level domain list file: tlds.txt", e);
}
}
@Override
public Action check(PackageNode pkg) {
if (TldHolder.TLD_SET.contains(pkg.getName())) {
if (pkg.isRoot() && TldHolder.TLD_SET.contains(pkg.getName())) {
return Action.FORBID_RENAME;
}
return Action.NO_ACTION;

View File

@ -1,469 +0,0 @@
# All tld domains with 3 or less characters
# Created from https://data.iana.org/TLD/tlds-alpha-by-domain.txt version 2022020500
aaa
abb
abc
ac
aco
ad
ads
ae
aeg
af
afl
ag
ai
aig
al
am
anz
ao
aol
app
aq
ar
art
as
at
au
aw
aws
ax
axa
az
ba
bar
bb
bbc
bbt
bcg
bcn
bd
be
bet
bf
bg
bh
bi
bid
bio
biz
bj
bm
bms
bmw
bn
bo
bom
boo
bot
box
br
bs
bt
buy
bv
bw
by
bz
bzh
ca
cab
cal
cam
car
cat
cba
cbn
cbs
cc
cd
ceo
cf
cfa
cfd
cg
ch
ci
ck
cl
cm
cn
co
com
cpa
cr
crs
cu
cv
cw
cx
cy
cz
dad
day
dds
de
dev
dhl
diy
dj
dk
dm
dnp
do
dog
dot
dtv
dvr
dz
eat
ec
eco
edu
ee
eg
er
es
esq
et
eu
eus
fan
fi
fit
fj
fk
fly
fm
fo
foo
fox
fr
frl
ftr
fun
fyi
ga
gal
gap
gay
gb
gd
gdn
ge
gea
gf
gg
gh
gi
gl
gle
gm
gmo
gmx
gn
goo
gop
got
gov
gp
gq
gr
gs
gt
gu
gw
gy
hbo
hiv
hk
hkt
hm
hn
hot
how
hr
ht
hu
ibm
ice
icu
id
ie
ifm
il
im
in
inc
ing
ink
int
io
iq
ir
is
ist
it
itv
jcb
je
jio
jll
jm
jmp
jnj
jo
jot
joy
jp
ke
kfh
kg
kh
ki
kia
kim
km
kn
kp
kpn
kr
krd
kw
ky
kz
la
lat
law
lb
lc
lds
li
lk
llc
llp
lol
lpl
lr
ls
lt
ltd
lu
lv
ly
ma
man
map
mba
mc
md
me
med
men
mg
mh
mil
mit
mk
ml
mlb
mls
mm
mma
mn
mo
moe
moi
mom
mov
mp
mq
mr
ms
msd
mt
mtn
mtr
mu
mv
mw
mx
my
mz
na
nab
nba
nc
ne
nec
net
new
nf
nfl
ng
ngo
nhk
ni
nl
no
now
np
nr
nra
nrw
ntt
nu
nyc
nz
obi
om
one
ong
onl
ooo
org
ott
ovh
pa
pay
pe
pet
pf
pg
ph
phd
pid
pin
pk
pl
pm
pn
pnc
pr
pro
pru
ps
pt
pub
pw
pwc
py
qa
re
red
ren
ril
rio
rip
ro
rs
ru
run
rw
rwe
sa
sap
sas
sb
sbi
sbs
sc
sca
scb
sd
se
ses
sew
sex
sfr
sg
sh
si
sj
sk
ski
sky
sl
sm
sn
so
soy
spa
sr
srl
ss
st
stc
su
sv
sx
sy
sz
tab
tax
tc
tci
td
tdk
tel
tf
tg
th
thd
tj
tjx
tk
tl
tm
tn
to
top
tr
trv
tt
tui
tv
tvs
tw
tz
ua
ubs
ug
uk
uno
uol
ups
us
uy
uz
va
vc
ve
vet
vg
vi
vig
vin
vip
vn
vu
wed
wf
win
wme
wow
ws
wtc
wtf
xin
xxx
xyz
ye
you
yt
yun
za
zip
zm
zw

File diff suppressed because it is too large Load Diff