-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensitive api #20
Open
luisamaralh
wants to merge
26
commits into
master
Choose a base branch
from
sensitive-API
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Sensitive api #20
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b5b5ef3
first test, create numberOfInterface
FHandrick 01ce561
add jar file
FHandrick 50d4459
add new method classIdentification
FHandrick fd05310
add new method methodsName
FHandrick 763c325
add new method methodSignatureList
FHandrick cef007f
Merge remote-tracking branch 'origin' into sensitive-API
FHandrick 9f8fe89
return method adapted to string
FHandrick c50a194
transform file format
FHandrick dd349e0
transform file format
FHandrick e284708
Merge branch 'master' of https://github.com/PAMunb/JimpleFramework in…
leomarcamargo 3f4ad22
Merge branch 'master' into sensitive-API
luisamaralh f0b8ef0
Merge branch 'master' into sensitive-API
luisamaralh 0ccac78
Merge branch 'master' of https://github.com/PAMunb/JimpleFramework in…
leomarcamargo c103971
new SensitiveAPI module
FHandrick dfe89fc
Merge branch 'sensitive-API' of https://github.com/PAMunb/JimpleFrame…
leomarcamargo 3d478a2
add file.txt
FHandrick b762690
Criando módulo sensitivo
leomarcamargo 12a13c6
Merge branch 'sensitive-API' of https://github.com/PAMunb/JimpleFrame…
leomarcamargo 98d3f73
Renomeando arquivo
leomarcamargo e2a7504
Merge pull request #18 from leomarcamargo/sensitive-API
luisamaralh 4f81782
testing sensitive-method
FHandrick ebafd9e
sensitiveAPI witout refectore
FHandrick 35abd0a
Merge branch 'master' into sensitive-API
luisamaralh b04ceaa
merged sensitive-api to the new archtecture
luisamaralh 2b01730
remove 2 tests methods
FHandrick 10b2326
Merge branch 'master' into sensitive-API
FHandrick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
module lang::jimple::toolkit::SensitiveAPI | ||
|
||
import lang::jimple::core::Context; | ||
import lang::jimple::Syntax; | ||
import lang::jimple::core::Context; | ||
import lang::jimple::util::Converters; | ||
import IO; | ||
import List; | ||
import String; | ||
|
||
|
||
public list[str] sensitiveFind(loc fileSensitive){ | ||
es = []; | ||
list[str] listSignature = execute([|project://JimpleFramework/src/test/resources|], es, Analysis(methodSignatureList)); | ||
list[str] listFileSensitive = readFiles(fileSensitive); | ||
list[str] listResult = listFileSensitive & listSignature; | ||
return listResult; | ||
} | ||
|
||
|
||
public list[str] methodSignatureList(ExecutionContext ctx){ | ||
list[str] mS = []; | ||
top-down visit(ctx) { | ||
case invokeStmt(specialInvoke(_,methodS,_)): mS = mS+signature(methodS); | ||
case invokeStmt(virtualInvoke(_,methodS,_)): mS = mS+signature(methodS); | ||
case invokeStmt(interfaceInvoke(_,methodS,_)): mS = mS+signature(methodS); | ||
case invokeStmt(staticMethodInvoke(methodS,_)): mS = mS+signature(methodS); | ||
case invokeStmt(dynamicInvoke(methodS,_,_,_)): mS = mS+signature(methodS); | ||
} | ||
return mS; | ||
} | ||
|
||
public list[str] readFiles(loc location){ | ||
res = []; | ||
list[str] lines = readFileLines(location); | ||
for (str l <- lines){ | ||
res = res + changeLine(l); | ||
}; | ||
return res; | ||
} | ||
|
||
public str changeLine(str s){ | ||
str stringFinal = replaceAll(s, "\<", ""); | ||
stringFinal = replaceAll(stringFinal, "\>", ""); | ||
|
||
list[str] partes = split(" ", stringFinal); | ||
|
||
if (size(partes) >=3) { | ||
str caminho = replaceAll(partes[0], ":", ""); | ||
caminho = replaceAll(caminho, ".", "/"); | ||
str retorno = partes[1]; | ||
retorno = replaceAll(retorno, ".", "/"); | ||
str metodo = partes[2]; | ||
return caminho + "." + metodo; | ||
}; | ||
|
||
return ""; | ||
} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss again this implementation. IMO, we should simplify the interface of the
sensitiveFind
function. Actually, even the name is not really good. It should receive two arguments: a list of strings with the signature of sensitive methods and an ExecutionContext. Only in this way I could use this implementation in a pipeline with a set of analyzes. This is a bit tough to explain here.