mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-29 22:04:25 +02:00
clean unused methods
This commit is contained in:
parent
01ffe761fe
commit
6235d1f3ad
@ -28,13 +28,12 @@
|
||||
import com.reandroid.arsc.util.ResNameMap;
|
||||
import com.reandroid.arsc.value.Entry;
|
||||
import com.reandroid.common.Frameworks;
|
||||
import com.reandroid.common.ResourceResolver;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
public class EncodeMaterials implements ResourceResolver {
|
||||
public class EncodeMaterials {
|
||||
private final Set<ResourceIds.Table.Package> packageIdSet = new HashSet<>();
|
||||
private PackageBlock currentPackage;
|
||||
private final Set<FrameworkTable> frameworkTables = new HashSet<>();
|
||||
@ -304,20 +303,6 @@
|
||||
return currentPackage.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int resolveResourceId(String packageName, String type, String name) {
|
||||
if(!isFrameworkPackageName(packageName)){
|
||||
return resolveLocalResourceId(type, name);
|
||||
}
|
||||
return resolveFrameworkResourceId(packageName, type, name);
|
||||
}
|
||||
@Override
|
||||
public int resolveResourceId(int packageId, String type, String name) {
|
||||
if(packageId==getCurrentPackageId()){
|
||||
return resolveLocalResourceId(type, name);
|
||||
}
|
||||
return resolveFrameworkResourceId(packageId, type, name);
|
||||
}
|
||||
public void logMessage(String msg) {
|
||||
if(apkLogger!=null){
|
||||
apkLogger.logMessage(msg);
|
||||
|
@ -506,7 +506,8 @@ import java.util.regex.Pattern;
|
||||
if(pkgId==0){
|
||||
pkgId=packageOrResourceId;
|
||||
}
|
||||
Collection<PackageBlock> allPkg = entryStore.getPackageBlocks((byte) pkgId);
|
||||
pkgId = pkgId & 0xff;
|
||||
Collection<PackageBlock> allPkg = entryStore.getPackageBlocks(pkgId);
|
||||
if(allPkg==null){
|
||||
return null;
|
||||
}
|
||||
|
@ -22,12 +22,7 @@ import com.reandroid.arsc.item.TableString;
|
||||
import java.util.Collection;
|
||||
|
||||
public interface EntryStore {
|
||||
EntryGroup searchEntryGroup(String packageName, String type, String name);
|
||||
Collection<EntryGroup> getEntryGroups(int resourceId);
|
||||
|
||||
EntryGroup getEntryGroup(int resourceId);
|
||||
|
||||
Collection<PackageBlock> getPackageBlocks(byte packageId);
|
||||
|
||||
Collection<TableString> getTableStrings(byte packageId, int stringReference);
|
||||
Collection<PackageBlock> getPackageBlocks(int packageId);
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 github.com/REAndroid
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.reandroid.common;
|
||||
|
||||
public interface ResourceResolver {
|
||||
int resolveResourceId(String packageName, String type, String name);
|
||||
int resolveResourceId(int packageId, String type, String name);
|
||||
}
|
@ -75,21 +75,6 @@ public class TableEntryStore implements EntryStore{
|
||||
return packageBlockSet;
|
||||
}
|
||||
@Override
|
||||
public EntryGroup searchEntryGroup(String packageName, String type, String name) {
|
||||
return null;
|
||||
}
|
||||
private Set<TableBlock> getTableBlocks(int packageId) {
|
||||
Set<TableBlock> results=new HashSet<>();
|
||||
Set<PackageBlock> packageBlockSet = mPackagesMap.get(packageId);
|
||||
if(packageBlockSet!=null){
|
||||
for(PackageBlock packageBlock:packageBlockSet){
|
||||
TableBlock tableBlock=packageBlock.getTableBlock();
|
||||
results.add(tableBlock);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
@Override
|
||||
public List<EntryGroup> getEntryGroups(int resourceId) {
|
||||
List<EntryGroup> results = searchEntryGroups(resourceId);
|
||||
if(results.size()>0){
|
||||
@ -106,7 +91,7 @@ public class TableEntryStore implements EntryStore{
|
||||
return searchEntryGroup(searchIdAlias(resourceId));
|
||||
}
|
||||
@Override
|
||||
public List<PackageBlock> getPackageBlocks(byte packageId) {
|
||||
public List<PackageBlock> getPackageBlocks(int packageId) {
|
||||
List<PackageBlock> results=new ArrayList<>();
|
||||
Set<PackageBlock> packageBlockSet = mPackagesMap.get(0xff & packageId);
|
||||
if(packageBlockSet!=null){
|
||||
@ -114,18 +99,6 @@ public class TableEntryStore implements EntryStore{
|
||||
}
|
||||
return results;
|
||||
}
|
||||
@Override
|
||||
public List<TableString> getTableStrings(byte packageId, int stringReference) {
|
||||
List<TableString> results=new ArrayList<>();
|
||||
Set<TableBlock> tableBlockSet=getTableBlocks(0xff & packageId);
|
||||
for(TableBlock tableBlock:tableBlockSet){
|
||||
TableString tableString=tableBlock.getTableStringPool().get(stringReference);
|
||||
if(tableString!=null){
|
||||
results.add(tableString);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
private List<EntryGroup> searchEntryGroups(int resourceId) {
|
||||
if(resourceId==0){
|
||||
return new ArrayList<>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user