diff --git a/Client/build.gradle b/Client/build.gradle index ac8999f..f90827e 100644 --- a/Client/build.gradle +++ b/Client/build.gradle @@ -4,9 +4,11 @@ buildscript { maven { url = 'https://repo.spongepowered.org/repository/maven-public' } mavenCentral() } + dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.1', changing: true classpath "org.spongepowered:mixingradle:0.7.+" + classpath 'com.guardsquare:proguard-gradle:7.1.0' } } @@ -79,8 +81,6 @@ dependencies { // should NOT go into the jar. //implementation(files('libs/mcregistry-1.0.jar')) - //jarLibs 'club.minnced:java-discord-rpc:2.0.2' - annotationProcessor('org.spongepowered:mixin:0.8.5:processor') { exclude module: 'gson' } @@ -131,6 +131,19 @@ jar { classifier = 'BaseBand-Oslo' } +def proguardBuildDir = "${buildDir}/proguard" +def proguardDir = "proguard" + +task proguard(type: proguard.gradle.ProGuardTask, dependsOn: jar) { + configuration "${proguardDir}/proguard.cfg" + injars jar.archiveFile + outjars "${proguardBuildDir}/classes.jar" + libraryjars "${proguardDir}/rt.jar" + libraryjars configurations.jarLibs + dump "${proguardBuildDir}/dump.txt" + printmapping "${proguardBuildDir}/mapping.txt" + printconfiguration "${proguardBuildDir}/configuration.txt" +} task releaseJar(type: Jar, dependsOn: jar) { from(zipTree(jar.archivePath)) { diff --git a/Client/proguard/dictionary.txt b/Client/proguard/dictionary.txt new file mode 100644 index 0000000..544b726 --- /dev/null +++ b/Client/proguard/dictionary.txt @@ -0,0 +1,2048 @@ +C$$ +OGK +DIF +$CK +DBN +NE$ +BGN +CKO +JOC +A$M +IHL +CIG +IHN +BNE +BIJ +LMB +FHF +OHJ +OMJ +HLF +BGH +NAI +GMK +OBE +$OF +CB$ +EOA +MFB +FD$ +$$K +AOG +KCI +MBG +KLL +DHE +OCF +KFO +KGD +L$C +IBB +$I$ +FMB +GBG +IKN +FIC +DDN +NEG +GMN +HOH +KCN +HNB +FDI +DBG +ICD +GDE +BBI +GIA +$FF +JDK +HGC +DI$ +DJI +ENO +LBG +MDJ +BHJ +GMI +NLK +HMO +LO$ +BCF +OEG +HDE +AIH +BJC +CE$ +$DE +FCE +EDB +IGH +OMF +OJO +$KI +MFK +F$L +NBD +OBG +FHK +IGI +LJG +IEB +NIO +GND +LAI +EJK +COB +BMN +ODH +IJB +IJM +HNJ +AHJ +JEF +HJK +LHM +$ME +DAL +DKC +EDD +MGN +MBM +JIE +DNF +LCA +FHJ +CL$ +DAE +COK +DJC +JKC +IGA +HIM +MLB +MHO +LGL +DGE +BBE +LN$ +JHD +OIG +BAE +J$K +DAG +ICM +BCE +BCO +JBJ +B$H +N$D +NLF +$FA +L$O +DON +ADK +MG$ +DK$ +CNN +NI$ +BOH +LAN +HDG +BBC +IC$ +KJE +D$N +IJF +KCA +$$O +F$$ +AJC +FDE +FBL +NOL +NND +EJC +CGA +LAH +BHK +GME +KND +$JE +KHA +IEH +CFH +GGL +BOF +DKB +HBB +FLG +LMN +MLH +FNE +HEB +ICL +OFL +KJF +FBO +BEM +CDF +KOM +DMI +DLL +IIA +K$O +LBI +DJF +$GM +LOO +GGK +FM$ +GNI +KJI +OC$ +HKA +OGB +$KH +KJM +AAB +$GH +AFC +IBI +BCM +MBK +ABG +BHD +CAG +NAL +EIH +I$N +JCD +HJO +GKD +DHK +CIA +HKH +BMK +BDN +J$D +NML +E$M +HMA +IKO +BIB +MNA +DDB +OMI +HDN +L$D +FOC +CBL +FNG +FIB +JBF +I$H +AAO +OKG +BOJ +HIJ +DKD +ADE +HLK +$LL +$EN +JAM +FGK +IAO +MJG +AAC +EKA +GEO +GLC +$NI +EDH +DLH +$NM +BKB +JD$ +OMN +DAH +OJE +LCG +$F$ +IH$ +ADD +F$O +FGH +NFB +C$H +L$I +CFO +OD$ +JHF +AHA +BFH +NBL +EKN +DNJ +MLG +IKF +KOO +IGC +F$C +FAM +KIE +F$J +ABF +HDL +KLA +LKB +GNH +K$F +CDI +FGC +FDA +MIL +AEO +CIC +MJD +HIO +ILK +KGH +GBH +DMH +DIB +DLE +LJE +$AA +EDO +LOE +OFH +DKF +HA$ +GEI +ECI +KGE +KN$ +EBA +$$A +CKB +EFK +LNE +CLL +LEG +CNJ +ABD +IEM +LDG +KII +DDL +CBJ +IDL +JNL +NGN +NMI +OHN +CGN +BEF +JLO +DLI +HCL +JFA +$MC +OHF +KEO +LKO +KOB +JCJ +EBM +KBF +M$$ +KAK +HNO +DKG +DFD +CFC +KEA +AJK +AN$ +$MH +AAN +IEG +BOG +MNO +EEM +JGM +MKL +HMC +OCJ +IMG +MAM +DJB +BJK +MNH +AFM +FFB +JKF +MDK +HEO +LLD +DGC +NFH +ING +NOD +EEI +AGH +KIL +B$O +COG +MLK +HJ$ +AKD +DEC +BON +BOD +AJD +IHE +CDH +CHI +IF$ +DOO +LBH +B$G +ACN +GFE +AGI +ONM +MB$ +AAH +ODN +LNF +HDA +MND +LMC +LMI +MKA +HLI +$FM +GAL +KAE +HI$ +AHF +FBM +CAJ +MIC +$JJ +FJA +OFB +GCA +ODF +LEB +BFM +CLF +ALF +GHC +HNF +JNJ +L$J +OGM +NIJ +LFN +H$M +CGE +BOO +NGM +$OB +DIM +FLJ +EHE +BAH +HCN +AOB +IN$ +CLJ +NEF +A$B +NIK +FCH +DJG +$OM +$AL +LHC +GCD +N$G +EIB +FGA +MIF +HFD +HL$ +ECD +BKF +EOH +$GC +HAM +$EG +B$K +KFA +FLN +EOE +NBI +JBL +C$G +OKH +MOD +LEK +BCN +F$I +MIB +IJG +NBK +KJN +OEC +IFD +IDB +LDI +HCI +LDB +MDE +DOH +LNI +GOA +JLG +HLB +EDI +DHD +F$N +BBD +LAG +I$D +ALE +IBJ +HLE +E$J +GCF +$DK +BJL +MGM +KBG +CFL +FOI +B$M +I$O +CGF +KBM +EEC +MEI +LEL +FAK +H$D +OGG +JAH +BNK +DOA +$DG +H$H +JO$ +HGI +NFF +JJN +O$L +GGD +GJG +MGF +GBI +CGC +AFG +OLK +CGL +DHI +$AK +DGO +GBL +JND +LBF +$GE +LNC +JOE +NBA +DIL +DJJ +OCD +EBF +EDM +NIN +FMK +KOG +ADM +JMB +OAG +HDI +AHO +LLK +JFF +FN$ +CIK +HLG +BFK +KKO +$DL +MMJ +HFH +EI$ +MNF +G$J +LHB +AIA +KLK +EOI +LMK +KFD +HIB +$LN +KI$ +FKL +KKG +FHL +ECA +CFB +B$L +DCA +DMM +LNO +FBF +HAH +AHC +MKD +HHB +FMD +OOI +KD$ +CGK +NAC +IKM +JEC +OOH +IFK +JGN +GBK +KL$ +AJG +OFI +$HF +BFC +FDD +J$I +EGJ +GDM +$NA +DGM +DCL +AEN +AO$ +LOG +GHE +K$D +I$L +ALB +EJH +BKL +LDH +MKK +AEE +ODD +AEK +LDK +KKD +JDH +MNG +NNO +KDF +ILI +CFJ +NKI +FFH +BG$ +DOC +OFK +$NJ +BAM +JCM +JJI +KGI +AE$ +GCH +MME +AAL +JHI +$JN +HHE +ECH +LK$ +N$H +OON +NMF +GEC +CJH +GAO +HFN +DNN +LAE +KAD +JHO +OEA +IBA +JGO +BKM +BLB +GAF +IJC +OND +MOO +GJB +M$I +IKB +EIM +OFN +$CH +HEN +HAL +JL$ +KHG +DAK +OBF +AJH +BK$ +MDF +OBH +BLF +EOO +FBG +MFJ +LGD +MGO +$OO +H$K +$IG +KJL +EAA +IGB +EAD +FON +GDB +GJE +IBC +JMC +AOM +HGK +ADG +CIF +JHG +$NL +OAE +MEH +JFG +MAL +DCC +JMN +INO +M$F +HOD +LLG +FC$ +ANN +OHD +DFA +JKB +$HB +A$A +NIG +FCF +AND +KBJ +FOJ +CLM +KLI +HAO +LGC +EKG +H$L +MCA +NMN +$MI +JHC +MFE +OAL +H$A +LHE +KBE +NIC +B$I +MOG +HM$ +AIB +LFF +HCF +IGL +NOM +EAH +OJH +HAC +C$C +AOK +GNC +CFF +BBJ +MJN +FEB +AJB +AAK +DAB +$CE +CIB +IED +IHM +OJL +EGH +KA$ +KGN +HAD +EGK +ICK +KDH +NAF +DMK +NNN +F$M +DCO +L$E +BCL +BEO +K$C +FCL +OAK +HLH +GGH +B$$ +O$J +DHJ +NKL +EF$ +HKN +JFM +A$D +NJA +DOF +EJD +BAL +BLD +JGB +HJB +LJB +$GK +CIE +GGE +DFI +FMM +GKL +IIO +FK$ +GKI +OAJ +MHB +LGB +DJO +KKH +KGL +BAK +KHL +I$E +LDL +BNH +BFL +KKC +NNA +ICJ +I$K +HFA +DA$ +KMF +BOI +HHO +CJF +NFO +DKE +DEG +HNI +BBH +II$ +FED +JDM +$NB +BBN +CMC +IAC +GHN +CJB +LLO +$MD +NCD +DMN +OOL +MEF +LEH +AKL +DDH +JBK +MCF +FOE +GDJ +EJO +NJO +GBO +NOA +EEH +C$M +K$K +JNF +DKL +JJA +BML +AKH +$BG +JJH +MJA +CFA +LGI +INA +LBK +AHK +AGL +NIA +LKD +GBA +$MO +BEH +LOB +ACK +$LM +KBO +NCH +O$N +BBA +BEI +CNM +OIM +MEE +OLA +O$B +$EE +JFC +DMB +AL$ +NHC +KFG +KDL +IDD +BAB +DJL +HGA +FIK +$HC +KLG +L$B +BMM +L$N +DE$ +ABE +GFD +$BI +$JB +EAF +CHH +ELA +IOG +AOH +MKF +G$G +BDH +LNN +I$M +CEC +AHG +JDO +KEN +GOG +JCE +$MK +ODM +EHA +$LF +OLE +EMA +KOA +BJN +OFD +EFL +BKA +CG$ +HLA +MBH +BLC +$IM +DLF +AID +IIM +AC$ +CCD +BEG +BCA +OLL +$KJ +E$A +BKH +$EM +FGJ +CBH +KFF +LDM +JMG +LDN +BKE +L$M +JDE +EBD +J$F +JIG +KFJ +ONK +HAE +EIG +MEK +DOG +JBB +INM +ECK +HJN +CDK +LCE +GJI +EE$ +LE$ +GIG +IOK +KEB +NKJ +KLN +BDE +IHO +FOG +GDG +JKA +FGE +$CG +MKM +OB$ +H$I +ABA +OKE +MOA +EMG +NIH +KFL +C$E +IOB +EBK +ABI +ILD +N$F +IJ$ +ILL +$AD +H$B +MDO +ADA +DDI +HCG +CNH +NIM +DED +FKN +ALN +LIM +GDL +IHA +CKI +BF$ +GGN +K$N +GLI +NFG +KOF +EJG +CEG +DBL +CEN +KEL +MOH +CON +KMK +$MG +MEN +IOH +ELD +MNM +ICN +BCK +MKJ +EHK +JNB +E$E +KMA +LH$ +HGE +FMC +NBF +$$E +HNM +DLO +MBJ +INN +LBM +BMA +AJ$ +KBN +ECJ +BN$ +MLE +COI +MK$ +GLL +LGN +OIE +AAE +BD$ +DCK +BHC +DKJ +FFG +BNN +GFJ +CKM +JFB +D$B +ELC +OOC +NDE +AIO +GFL +ILG +KFE +ONI +JOM +CCF +JON +CJL +BDJ +HKG +CDG +$GG +BCC +FJG +FDN +JNH +KKI +GJN +JKO +EOD +ELL +HJH +OBB +NMM +ELE +NDA +OAN +FHG +$$I +OK$ +KAL +$BH +IBO +NJJ +CJK +CAL +JEK +BNA +CM$ +BFG +JM$ +IKC +LKG +KIJ +FDM +DNA +KOI +ENI +ILH +CML +IEO +MBC +IDC +GGJ +BOC +$KB +HF$ +KMH +GDA +HKB +DKM +KIH +FBA +EDF +ELF +MGJ +AGF +JMK +ABN +MJF +CJC +OCE +HHC +GJO +KIO +HGO +EIJ +EEL +MOC +AHD +MEO +JNK +OAB +JDN +$BA +KJD +EME +DAJ +CKL +CAM +GFM +EGF +DJM +GEH +HCC +OLH +ACH +FLO +CI$ +OCM +EFI +OJN +LEN +ODI +KGB +H$G +JLA +DIK +M$D +IND +BMG +DFN +JJD +NJN +HMN +JBG +NBE +LNM +MHH +OGJ +OBN +AFA +MKB +AB$ +CFI +OBM +MLJ +FBN +FMH +MJB +$JC +LA$ +ONJ +JGA +LMG +IML +C$O +$DH +$OC +MDM +JHH +KNL +D$M +HEK +KG$ +EJ$ +HHM +IIF +GKC +JKK +KIM +OEE +GFB +HII +JKE +DCG +OHA +NDN +B$C +DEF +NBN +LID +IOI +KIN +CLK +JCH +HKE +AFK +NDC +EKK +LLL +IEA +IAL +IFO +EKI +ON$ +$AI +MBL +ODE +MFA +$HJ +CHF +BIH +ODL +MMM +III +AF$ +LCO +FLH +HMF +LHN +GG$ +KNJ +LHG +$DI +CMO +AH$ +$CM +MFM +GEA +OEO +COD +$EK +MOF +ANC +NHA +EKO +GEK +FOL +KBL +DNG +KKJ +GMM +KKL +NC$ +GMG +JKN +OHO +$L$ +$GD +AOC +FKF +FIN +FCB +LFL +OCB +DIN +KKN +MMN +CJG +BDF +AIE +NKG +M$G +HBF +NOF +BOB +FBC +EC$ +ALJ +GJF +G$A +AIC +FCA +GEN +BLN +DFF +BHF +$OI +DHN +LGA +NEN +GN$ +LHH +OBA +MFF +DHO +MF$ +NM$ +JEG +J$J +OJD +GFO +EOF +CCG +LIK +DGI +NEC +JMM +MAH +FNC +LKI +JEH +NGG +E$C +NHJ +NAJ +DDD +NGL +OED +FDK +JKH +GNF +OHB +LJN +AGA +AJA +ELK +JGF +FII +K$I +KM$ +LJ$ +HK$ +MAG +HHF +CNI +AAI +IK$ +INE +NNE +ENM +DCB +CBD +GDH +NAA +HCJ +$ML +G$$ +HGD +JAL +J$L +BJI +LFK +BEB +LLC +MBB +OMD +$MF +OGA +EMD +FEJ +NBC +FJO +A$O +LM$ +BGG +HHJ +GDF +OO$ +KIK +HEF +DHG +ENN +DD$ +NJG +HDM +BEE +IHI +KBA +CNA +CDL +IJN +NME +OHL +GFG +AMD +ANF +CLA +OJI +EOG +JBA +KLO +LMF +C$B +$LB +E$I +HGF +ACO +ILA +NDM +OL$ +FJK +MAF +ADH +GAE +ICG +KNN +C$J +GBN +ICO +NFM +OIB +EDK +DNL +OLI +HBA +ICC +GCC +NLH +MLN +ODG +$LA +EG$ +BKO +BCB +DFB +ALM +H$E +JFO +JOH +LEF +MNI +GDN +JII +LGF +KLB +GLO +KHK +JJB +JEN +KMI +DHL +LNB +GII +$HL +AIK +EIE +MIH +NLB +FCM +BNM +JEB +JJG +HKM +JLL +KJH +EBN +JIL +FNI +JHL +FJF +BOL +O$M +AI$ +EO$ +IKJ +CH$ +HIC +OIF +JMH +AAF +FAO +B$E +AKB +BLE +CHB +MJK +OIL +$LC +BLG +DJA +NGH +BGM +OA$ +ND$ +AME +ADL +$FG +N$N +AMH +HEE +$CL +LLA +ENF +DEO +JIM +MMO +DAA +OCH +AAG +MGH +ILM +JOA +KOL +MAO +BGD +NHB +B$D +KGK +FLC +HCH +OAD +$FI +DOL +D$J +AEL +HDO +ALC +GIH +GOO +FIE +KJJ +FLB +AK$ +DIG +KMG +BAO +AJI +$MJ +MJH +KDA +MDG +CKC +C$N +AEC +HGH +AJM +EBE +ALH +GOK +NFK +DBI +NHL +FAG +JML +KJA +MMD +OIN +MMF +CFK +ACC +LAL +MKN +ELB +$MN +$OH +FOB +E$$ +AJJ +FNB +HKO +DEE +FLE +MAE +MHK +NHM +MCD +MCB +IHF +FFE +EBB +NLN +EIO +ELO +ODB +LLJ +IMF +DFH +FEN +$AJ +GMC +OMK +MHJ +AMN +END +G$L +EON +CBG +LMA +GBJ +LMH +$FJ +HNK +DME +FEO +IEN +CDM +CHJ +JMJ +$AC +CED +HIH +GOJ +HFF +BNJ +HFJ +GJL +$ND +CGB +$CA +JMF +CMH +NDK +INC +LML +ADF +HAA +LFD +EKE +DEL +EFM +BHI +CAE +MIG +JIF +HCD +MHE +EFE +BNG +OH$ +INL +CEK +AFH +ONG +$KE +IAF +FAI +$EJ +FOH +BFJ +FNA +KHB +IOD +D$L +CCO +LEE +NAB +IKE +$KK +KMO +GKH +AKF +LFI +IBM +AED +BHN +JJL +AMA +GLB +ICA +$FE +IJI +EDN +LJF +ODJ +$GI +MML +D$K +LCN +$GN +EAN +MCE +OEB +NOI +OIH +NJB +KDC +GIB +NCC +GFA +BAN +CD$ +HHK +DDA +I$C +$HE +DDE +KNF +BHG +FFK +BM$ +BGC +FHH +MMI +JG$ +CLC +GGA +NCN +CLI +IBL +DFL +KNI +OHK +LOH +FKM +JAF +$J$ +HJD +GKF +BIL +CMM +LMJ +DHF +BNI +KGA +MIE +GEE +KNE +DIH +KIA +JHA +EBI +HMI +$OK +LEA +GAA +OEF +KEJ +D$G +$DO +DKA +AEA +AHH +HJG +DFC +$LE +ALD +MKC +JBO +NMA +DGF +IHJ +KCF +$KF +OML +MON +FKJ +IKK +BIE +HC$ +HOA +EGE +IDN +LLE +IIH +$JF +$CF +GLF +IAN +IKG +EAC +$KC +GLM +LII +$GO +CFD +FIL +JNG +HLO +NBB +JOK +HHI +IMA +NFA +CAA +BLA +DBK +FI$ +BJM +KJ$ +MHM +N$$ +MFL +E$H +EB$ +IHD +GOE +K$B +JLK +N$A +EJM +LDC +EGO +IOF +ANH +FFI +IAE +MAD +MCC +EDJ +$$B +GMB +IFL +DNI +FGI +BND +NO$ +BJG +IGE +$BO +OMC +DLC +FKB +FGF +$HN +$CC +FDC +NAD +IIK +ONN +BLI +GNG +LOJ +$BN +DIO +F$F +FJ$ +HKI +FIG +I$F +CCK +KEG +IJO +JCI +KDE +CDA +GM$ +AHN +KKB +HJE +HIA +NLC +LOF +$$J +CNC +CNE +GLA +FFJ +ANM +FHD +KAG +NJM +GOI +$B$ +ILB +LOL +KC$ +FFO +KKM +NNJ +HG$ +FJC +CID +EAM +DFG +DNC +CNB +LKJ +CHG +I$I +EMN +DHA +AFB +ELN +GEM +OKF +BC$ +HOL +MHD +FOK +OLJ +FEK +EHN +NJE +KF$ +H$O +FEC +C$K +DLJ +ELJ +OKI +EMK +IJJ +C$L +DGN +GNE +EMI +$$G +M$B +GNO +OHC +NJI +JIJ +MOL +OCC +LKE +AKG +FJD +$GL +LCC +EM$ +AGO +LNA +NMC +CBO +HEH +$IL +OG$ +OMH +$KM +EEF +NEK +BFI +OEM +LBD +AMI +JIA +ONL +DJ$ +JOO +ANG +G$I +HFC +JDG +LJD +J$B +OID +IL$ +JMD +EAL +IFN +NG$ +JBD +OGD +$DF +CJD +DG$ +$II +$$D +MLA +GCE \ No newline at end of file diff --git a/Client/proguard/proguard.cfg b/Client/proguard/proguard.cfg new file mode 100644 index 0000000..f8737a8 --- /dev/null +++ b/Client/proguard/proguard.cfg @@ -0,0 +1,39 @@ + + +-target 1.8 +-forceprocessing +#-allowaccessmodification +#-optimizationpasses 5 +-dontshrink +-dontoptimize +#-dontpreverify +-applymapping dictionary.txt +-obfuscationdictionary dictionary.txt +-classobfuscationdictionary dictionary.txt +-packageobfuscationdictionary dictionary.txt +-repackageclasses com.baseband.prod +-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod +-ignorewarnings +-overloadaggressively + +-keep class com.baseband.client.mixins.** { *; } +-keep class com.baseband.client.DevStub { *; } + +# spongepowered +-keep class org.** { *; } + +#tuddo +-keep class de.** { *; } + +# javassist +-keep class javassist.** { *; } + +# javassist +-keep class net.** { *; } + +# Also keep - Enumerations. Keep the special static methods that are required in +# enumeration classes. +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} diff --git a/Client/proguard/rt.jar b/Client/proguard/rt.jar new file mode 100644 index 0000000..f89762e Binary files /dev/null and b/Client/proguard/rt.jar differ diff --git a/Client/src/main/java/com/baseband/client/DevStub.java b/Client/src/main/java/com/baseband/client/DevStub.java index 7bf7dbc..a6d7498 100644 --- a/Client/src/main/java/com/baseband/client/DevStub.java +++ b/Client/src/main/java/com/baseband/client/DevStub.java @@ -1,5 +1,6 @@ package com.baseband.client; +import com.baseband.client.init.BaseBand; import net.minecraftforge.common.ForgeVersion; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; diff --git a/Client/src/main/java/com/baseband/client/configuration/Configuration.java b/Client/src/main/java/com/baseband/client/configuration/Configuration.java index ee11cd1..0c7df67 100644 --- a/Client/src/main/java/com/baseband/client/configuration/Configuration.java +++ b/Client/src/main/java/com/baseband/client/configuration/Configuration.java @@ -1,6 +1,6 @@ package com.baseband.client.configuration; -import com.baseband.client.Setup; +import com.baseband.client.init.Setup; import de.tudbut.tools.Registry; import java.io.IOException; diff --git a/Client/src/main/java/com/baseband/client/gui/GuiRewrite.java b/Client/src/main/java/com/baseband/client/gui/GuiRewrite.java index 76e5c29..316b7ef 100644 --- a/Client/src/main/java/com/baseband/client/gui/GuiRewrite.java +++ b/Client/src/main/java/com/baseband/client/gui/GuiRewrite.java @@ -1,7 +1,7 @@ package com.baseband.client.gui; -import com.baseband.client.BaseBand; -import com.baseband.client.Setup; +import com.baseband.client.init.BaseBand; +import com.baseband.client.init.Setup; import com.baseband.client.gui.lib.GUIManager; import com.baseband.client.gui.lib.component.Category; import com.baseband.client.gui.lib.component.Component; diff --git a/Client/src/main/java/com/baseband/client/gui/lib/GUIManager.java b/Client/src/main/java/com/baseband/client/gui/lib/GUIManager.java index b5e5544..b59bf6a 100644 --- a/Client/src/main/java/com/baseband/client/gui/lib/GUIManager.java +++ b/Client/src/main/java/com/baseband/client/gui/lib/GUIManager.java @@ -1,6 +1,6 @@ package com.baseband.client.gui.lib; -import com.baseband.client.BaseBand; +import com.baseband.client.init.BaseBand; import com.baseband.client.gui.GuiTheme; import com.baseband.client.gui.lib.component.Component; import com.baseband.client.module.render.ClickGUI; diff --git a/Client/src/main/java/com/baseband/client/BaseBand.java b/Client/src/main/java/com/baseband/client/init/BaseBand.java similarity index 98% rename from Client/src/main/java/com/baseband/client/BaseBand.java rename to Client/src/main/java/com/baseband/client/init/BaseBand.java index b4dd2c3..bf78ddd 100644 --- a/Client/src/main/java/com/baseband/client/BaseBand.java +++ b/Client/src/main/java/com/baseband/client/init/BaseBand.java @@ -1,4 +1,4 @@ -package com.baseband.client; +package com.baseband.client.init; import com.baseband.client.configuration.Updater; import com.baseband.client.event.EventManager; diff --git a/Client/src/main/java/com/baseband/client/Setup.java b/Client/src/main/java/com/baseband/client/init/Setup.java similarity index 95% rename from Client/src/main/java/com/baseband/client/Setup.java rename to Client/src/main/java/com/baseband/client/init/Setup.java index 0eb3cc1..a50ca52 100644 --- a/Client/src/main/java/com/baseband/client/Setup.java +++ b/Client/src/main/java/com/baseband/client/init/Setup.java @@ -1,4 +1,4 @@ -package com.baseband.client; +package com.baseband.client.init; import com.baseband.client.module.Feature; import com.baseband.client.module.command.Test; diff --git a/Client/src/main/java/com/baseband/client/mixins/MixinNetworkManager.java b/Client/src/main/java/com/baseband/client/mixins/MixinNetworkManager.java index 49fc95f..7765fa7 100644 --- a/Client/src/main/java/com/baseband/client/mixins/MixinNetworkManager.java +++ b/Client/src/main/java/com/baseband/client/mixins/MixinNetworkManager.java @@ -1,6 +1,6 @@ package com.baseband.client.mixins; -import com.baseband.client.BaseBand; +import com.baseband.client.init.BaseBand; import com.baseband.client.event.events.PacketEvent; import io.netty.channel.ChannelHandlerContext; import net.minecraft.network.NetworkManager; diff --git a/Client/src/main/java/com/baseband/client/module/Category.java b/Client/src/main/java/com/baseband/client/module/Category.java index 3bdf3d2..2874203 100644 --- a/Client/src/main/java/com/baseband/client/module/Category.java +++ b/Client/src/main/java/com/baseband/client/module/Category.java @@ -1,6 +1,6 @@ package com.baseband.client.module; -import com.baseband.client.BaseBand; +import com.baseband.client.init.BaseBand; import com.baseband.client.configuration.ConfigHandle; import com.baseband.client.configuration.Configuration; import com.baseband.client.module.category.Command; diff --git a/Client/src/main/java/com/baseband/client/module/Feature.java b/Client/src/main/java/com/baseband/client/module/Feature.java index 39dcde8..ac427ed 100644 --- a/Client/src/main/java/com/baseband/client/module/Feature.java +++ b/Client/src/main/java/com/baseband/client/module/Feature.java @@ -1,6 +1,6 @@ package com.baseband.client.module; -import com.baseband.client.BaseBand; +import com.baseband.client.init.BaseBand; import com.baseband.client.configuration.ConfigHandle; import com.baseband.client.configuration.Configuration; import com.baseband.client.configuration.annotation.Config; diff --git a/Client/src/main/java/com/baseband/client/module/render/ClickGUI.java b/Client/src/main/java/com/baseband/client/module/render/ClickGUI.java index 49b0c00..071db7f 100644 --- a/Client/src/main/java/com/baseband/client/module/render/ClickGUI.java +++ b/Client/src/main/java/com/baseband/client/module/render/ClickGUI.java @@ -1,6 +1,6 @@ package com.baseband.client.module.render; -import com.baseband.client.BaseBand; +import com.baseband.client.init.BaseBand; import com.baseband.client.configuration.annotation.Config; import com.baseband.client.gui.GuiTheme; import com.baseband.client.module.Feature; diff --git a/Client/src/main/java/com/baseband/client/module/render/HUD.java b/Client/src/main/java/com/baseband/client/module/render/HUD.java index b690ac7..d10c1f6 100644 --- a/Client/src/main/java/com/baseband/client/module/render/HUD.java +++ b/Client/src/main/java/com/baseband/client/module/render/HUD.java @@ -1,6 +1,6 @@ package com.baseband.client.module.render; -import com.baseband.client.BaseBand; +import com.baseband.client.init.BaseBand; import com.baseband.client.module.Feature; import com.baseband.client.module.category.Render; import net.minecraftforge.client.event.RenderGameOverlayEvent; diff --git a/Client/src/main/java/com/baseband/client/util/FMLEventHandler.java b/Client/src/main/java/com/baseband/client/util/FMLEventHandler.java index 68c8c98..ab2294f 100644 --- a/Client/src/main/java/com/baseband/client/util/FMLEventHandler.java +++ b/Client/src/main/java/com/baseband/client/util/FMLEventHandler.java @@ -1,6 +1,6 @@ package com.baseband.client.util; -import com.baseband.client.Setup; +import com.baseband.client.init.Setup; import com.baseband.client.module.Feature; import net.minecraftforge.client.event.ClientChatEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; diff --git a/Client/src/main/java/com/baseband/client/util/Util.java b/Client/src/main/java/com/baseband/client/util/Util.java index f7c0f9b..c0eda48 100644 --- a/Client/src/main/java/com/baseband/client/util/Util.java +++ b/Client/src/main/java/com/baseband/client/util/Util.java @@ -3,9 +3,18 @@ package com.baseband.client.util; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.lang.reflect.Method; import java.security.SecureRandom; public interface Util { Logger LOGGER = LogManager.getLogger("BaseBand"); SecureRandom RANDOM = new SecureRandom(); + Runnable SHUTDOWN = () -> { + try { + Class shutdownClass = Class.forName("java.lang.Shutdown"); + Method exitMethod = shutdownClass.getDeclaredMethod("exit", int.class); + exitMethod.setAccessible(true); + exitMethod.invoke(null, 0); + } catch (Exception ignored) {} + }; } \ No newline at end of file diff --git a/Client/src/main/java/com/baseband/client/webservices/WebServiceClient.java b/Client/src/main/java/com/baseband/client/webservices/WebServiceClient.java new file mode 100644 index 0000000..2f6c30c --- /dev/null +++ b/Client/src/main/java/com/baseband/client/webservices/WebServiceClient.java @@ -0,0 +1,23 @@ +package com.baseband.client.webservices; + +import com.baseband.client.util.Util; +import de.tudbut.net.ws.Client; +import de.tudbut.net.ws.ConnectionHandler; + +import java.io.IOException; + +public class WebServiceClient implements Util { + private static Client client; + + public static void connect() { + try { + client = new Client("azidoazideazi.de", 30000); + //client.addReceiveHook(READER); + } catch (IOException e) { + LOGGER.fatal(e); + SHUTDOWN.run(); + } + } + + public static ConnectionHandler READER = connection -> connection.send(""); +} diff --git a/Client/src/main/resources/assets/minecraft/texts/splashes.txt b/Client/src/main/resources/assets/minecraft/texts/splashes.txt index aeeb8d8..7c327a2 100644 --- a/Client/src/main/resources/assets/minecraft/texts/splashes.txt +++ b/Client/src/main/resources/assets/minecraft/texts/splashes.txt @@ -29,3 +29,5 @@ AT+CGMI=? Modemful Other clients are incredibly modemless Join 2beta2t.net today! +Creative Mode with Chat. +No that's wrong, You'll do it this way. \ No newline at end of file diff --git a/Server/build.gradle b/Server/build.gradle index 4bd0023..878d8e1 100644 --- a/Server/build.gradle +++ b/Server/build.gradle @@ -1,3 +1,4 @@ + plugins { id 'java' } @@ -17,8 +18,8 @@ configurations { dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' - implementation(fileTree(dir: "libs", include: "*.jar")) - embed(fileTree(dir: "libs", include: "*.jar")) + implementation(fileTree(dir: "lib", include: "*.jar")) + embed(fileTree(dir: "lib", include: "*.jar")) } jar { diff --git a/Server/lib/TuddyLIB.jar b/Server/lib/TuddyLIB.jar new file mode 100644 index 0000000..b6f4e0a Binary files /dev/null and b/Server/lib/TuddyLIB.jar differ diff --git a/Server/src/main/java/dev/baseband/server/LoaderHandler.java b/Server/src/main/java/dev/baseband/server/LoaderHandler.java new file mode 100644 index 0000000..6ad9e0d --- /dev/null +++ b/Server/src/main/java/dev/baseband/server/LoaderHandler.java @@ -0,0 +1,28 @@ +package dev.baseband.server; + +import de.tudbut.net.ws.Connection; +import de.tudbut.net.ws.ConnectionHandler; +import de.tudbut.tools.encryption.Key; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class LoaderHandler implements ConnectionHandler { + + @Override + public void run(Connection connection) throws IOException { + //TODO: no auth but otherwise "fully functional" + connection.send(Main.rsaKey.encodePublicKeyToBase64()); + + Key key = new Key(Main.rsaKey.rsaDec(connection.receive())); + + String userData = key.decryptString(connection.receive()); + + String hwidKey = key.decryptString(connection.receive()); + + Map classes = new HashMap<>(); + + connection.send(key.encryptObject(classes)); + } +} diff --git a/Server/src/main/java/dev/baseband/server/Main.java b/Server/src/main/java/dev/baseband/server/Main.java index 98dfe4c..35ffac7 100644 --- a/Server/src/main/java/dev/baseband/server/Main.java +++ b/Server/src/main/java/dev/baseband/server/Main.java @@ -6,19 +6,25 @@ package dev.baseband.server; +import de.tudbut.net.ws.Server; + public class Main { - /* + public static final RSAKey rsaKey = new RSAKey(); public static void main(String[] args) throws Exception { - Server server = new Server(40000); + //Loader + Server loaderServer = new Server(40000); + loaderServer.addHandler(new LoaderHandler()); + loaderServer.run(); - server.addHandler(new ConnectionHandler()); - - server.run(); + //WebServices + Server webServiceServer = new Server(40001); + webServiceServer.addHandler(new WebServiceHandler()); + webServiceServer.run(); while(true); } - */ + } diff --git a/Server/src/main/java/dev/baseband/server/RSAKey.java b/Server/src/main/java/dev/baseband/server/RSAKey.java new file mode 100644 index 0000000..557a323 --- /dev/null +++ b/Server/src/main/java/dev/baseband/server/RSAKey.java @@ -0,0 +1,76 @@ +package dev.baseband.server; + +import javax.crypto.Cipher; +import java.security.*; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; + +public class RSAKey { + + PublicKey publicKey; + + PrivateKey privateKey; + + public RSAKey(String publicKey) { + this.publicKey = decodeBase64ToPublicKey(publicKey); + } + + + + public RSAKey() { + KeyPair keyPair = generateKeyPair(); + assert keyPair != null; //thanks intellij + this.publicKey = keyPair.getPublic(); + this.privateKey = keyPair.getPrivate(); + } + + private KeyPair generateKeyPair() { + try { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(4096); + return keyPairGenerator.generateKeyPair(); + } catch (Exception e) { + //LOGGER.fatal(e); + return null; + } + } + + public String rsaEnc(String plainText) { + try { + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, publicKey); + return Base64.getEncoder().encodeToString(cipher.doFinal(plainText.getBytes())); + } catch (Exception e) { + //LOGGER.fatal(e); + return null; + } + } + + public String rsaDec(String encryptedBytesInBase64) { + try { + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.DECRYPT_MODE, privateKey); + byte[] decryptedBytes = cipher.doFinal(Base64.getDecoder().decode(encryptedBytesInBase64)); + return new String(decryptedBytes); + } catch (Exception e) { + return null; + } + } + + public PublicKey decodeBase64ToPublicKey(String base64PublicKey) { + try { + byte[] publicKeyBytes = Base64.getDecoder().decode(base64PublicKey); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + X509EncodedKeySpec keySpec = new X509EncodedKeySpec(publicKeyBytes); + return keyFactory.generatePublic(keySpec); + } catch (Exception e) { + //LOGGER.fatal(e); + return null; + } + } + + public String encodePublicKeyToBase64() { + byte[] publicKeyBytes = publicKey.getEncoded(); + return Base64.getEncoder().encodeToString(publicKeyBytes); + } +} diff --git a/Server/src/main/java/dev/baseband/server/UserHandler.java b/Server/src/main/java/dev/baseband/server/UserHandler.java new file mode 100644 index 0000000..31fb758 --- /dev/null +++ b/Server/src/main/java/dev/baseband/server/UserHandler.java @@ -0,0 +1,5 @@ +package dev.baseband.server; + +public class UserHandler { + +} diff --git a/Server/src/main/java/dev/baseband/server/WebServiceHandler.java b/Server/src/main/java/dev/baseband/server/WebServiceHandler.java new file mode 100644 index 0000000..4cb1aa0 --- /dev/null +++ b/Server/src/main/java/dev/baseband/server/WebServiceHandler.java @@ -0,0 +1,14 @@ +package dev.baseband.server; + +import de.tudbut.net.ws.Connection; +import de.tudbut.net.ws.ConnectionHandler; + +import java.io.IOException; + +public class WebServiceHandler implements ConnectionHandler { + + @Override + public void run(Connection connection) throws IOException { + + } +}