Skip to content
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

whenClicked -> creates userFIle via same place it was opened at. #6

Closed
wants to merge 2 commits into from
Closed

Conversation

LarryTheFatCat
Copy link

@LarryTheFatCat LarryTheFatCat commented Feb 26, 2022

When the user clicks on Install button and then closes out of the app, it will create a json that stores the username and password, it will only create the info when you close the Jar.

edit: you can change the file type on line 108.

@ThnksCJ
Copy link

ThnksCJ commented Feb 27, 2022

im pretty sure tux wont update the repo with PR if you want u can add it to my fork instead as im going to contuin making parts of it to help myself learn java alot better

@LarryTheFatCat
Copy link
Author

im pretty sure tux wont update the repo with PR if you want u can add it to my fork instead as im going to contuin making parts of it to help myself learn java alot better

Well sure, but this is pretty useless considering that it only creates the file that displays the info, if you really wanted it to work then you could link it to an sql dataBase that would store the info and checkInfo when needed for login System. But yea for sure I'll make a pr for this.

@LarryTheFatCat
Copy link
Author

Just let me know what GitHub it is because you have 35 Github forks and I don't really know which lol.

@ThnksCJ
Copy link

ThnksCJ commented Feb 27, 2022

@ThnksCJ
Copy link

ThnksCJ commented Feb 27, 2022

im pretty sure tux wont update the repo with PR if you want u can add it to my fork instead as im going to contuin making parts of it to help myself learn java alot better

Well sure, but this is pretty useless considering that it only creates the file that displays the info, if you really wanted it to work then you could link it to an sql dataBase that would store the info and checkInfo when needed for login System. But yea for sure I'll make a pr for this.

Tbh something like this could be really cool like using pastbin or sm to hold credentials instead of it being inside the code

@LarryTheFatCat
Copy link
Author

I doubt you can make a Pastebin that holds info, you would most likely have to link it to an Sql DataBase.
Another thing, your Repo is a fork of the main repo making it impossible to make a pr on your end so I can't rlly make a pr but you can just copy the code lol, it's just 1 Action on object button and then at the bottom where it talks about creatUserFile()

@ThnksCJ
Copy link

ThnksCJ commented Feb 27, 2022

I doubt you can make a Pastebin that holds info, you would most likely have to link it to an Sql DataBase.
Another thing, your Repo is a fork of the main repo making it impossible to make a pr on your end so I can't rlly make a pr but you can just copy the code lol, it's just 1 Action on object button and then at the bottom where it talks about creatUserFile()

Well I recon you could use pastebin or something similar using sm like "username:password" and find the text before and after the colon as hwid auths on GitHub use a similar concept it would also be easier for the end user as not everyone has access to a SQL database but pastebin is a free resource. Also lol I forgot about that I'll make it a normal one tmr and make sure to give tux credit in the description or sm to make sure it's known it's a fork of his

@Tux8068
Copy link
Owner

Tux8068 commented Feb 27, 2022

hi guys

@ThnksCJ
Copy link

ThnksCJ commented Feb 27, 2022

Hi tux

@LarryTheFatCat
Copy link
Author

I doubt you can make a Pastebin that holds info, you would most likely have to link it to an Sql DataBase.
Another thing, your Repo is a fork of the main repo making it impossible to make a pr on your end so I can't rlly make a pr but you can just copy the code lol, it's just 1 Action on object button and then at the bottom where it talks about creatUserFile()

Well I recon you could use pastebin or something similar using sm like "username:password" and find the text before and after the colon as hwid auths on GitHub use a similar concept it would also be easier for the end user as not everyone has access to a SQL database but pastebin is a free resource. Also lol I forgot about that I'll make it a normal one tmr and make sure to give tux credit in the description or sm to make sure it's known it's a fork of his

Yes well, I get that you can store the user:password like a HWID-Lock but the only reason why I don't agree is "how" you could make it. You could make it act like a HWID-System where it's an actionListener onClick -> { <- method starts but not too sure how it would really work unless you hard code it. Let me know if you can figure it out.

@LarryTheFatCat
Copy link
Author

LarryTheFatCat commented Feb 28, 2022

I believe that it is possible to not do any of these but checkUserFile <- when login is pressed and searches for the file via desktop for a specific folder and checks the file for the creds.

because, the method I created creatUserFIle when the loginButton is pressed creates a userfile in the same area the file was opened in meaning if we just have a system to check when it's pressed and determine whether the info checks out or not. Unless we would need a dataBase to store the info which should be really easy as we can just create a google spread sheet that is called DataBase.imd and then link it with the sql connecter and then once it's connected have it check the file in the desktop or create a specific file path. If we create a specific file path and the database check for it then that would make a easier solution then all of this.

@ThnksCJ
Copy link

ThnksCJ commented Feb 28, 2022

I believe that it is possible to not do any of these but checkUserFile <- when login is pressed and searches for the file via desktop for a specific folder and checks the file for the creds.

because, the method I created creatUserFIle when the loginButton is pressed creates a userfile in the same area the file was opened in meaning if we just have a system to check when it's pressed and determine whether the info checks out or not. Unless we would need a dataBase to store the info which should be really easy as we can just create a google spread sheet that is called DataBase.imd and then link it with the sql connecter and then once it's connected have it check the file in the desktop or create a specific file path. If we create a specific file path and the database check for it then that would make a easier solution then all of this.

this would probs work but its all about ease for the end user tbh i reccon its kinda over compilcating it using sql. also whta would be the point in having a username printing to a file because this would just be a one time install?

@ThnksCJ
Copy link

ThnksCJ commented Feb 28, 2022

Lol ye https://github.com/ThnksCJ/InstallerForJava

ive also updated this to a one you can pr now

@LarryTheFatCat
Copy link
Author

I believe that it is possible to not do any of these but checkUserFile <- when login is pressed and searches for the file via desktop for a specific folder and checks the file for the creds.
because the method I created creature file when the login button is pressed creates a user file in the same area the file was opened in meaning if we just have a system to check when it's pressed and determine whether the info checks out or not. Unless we would need a database to store the info which should be easy as we can just create a google spreadsheet that is called DataBase.imd and then link it with the SQL connecter and then once it's connected have it check the file on the desktop or create a specific file path. If we create a specific file path and the database check for it, that would make an easier solution.

this would probably work but it's all about ease for the end user tbh I reckon it's kind of overcomplicating it using SQL. also, what would be the point in having a username printing to a file because this would just be a one-time install?

That is true, but SQL would most likely be the easiest option. If we link to a spread sheet that anyone can edit and stuff like that, we would have to have knowledge in JSON and HTTP and some other stuff. It's too complicated in my opinion.

private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {
// Load client secrets.
InputStream in = SheetsQuickstart.class.getResourceAsStream(CREDENTIALS_FILE_PATH);
if (in == null) {
throw new FileNotFoundException("Resource not found: " + CREDENTIALS_FILE_PATH);
}
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));

    // Build flow and trigger user authorization request.
    GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
            HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)
            .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))
            .setAccessType("offline")
            .build();
    LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();
    return new AuthorizationCodeInstalledApp(flow, receiver).authorize("user");
}   

// pom.xml dependency.

com.google.oauth-client
google-oauth-client-jetty
1.22.0

    <!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client-extensions -->
    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client-extensions</artifactId>
        <version>1.6.0-beta</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client</artifactId>
        <version>1.33.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-sheets -->
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-sheets</artifactId>
        <version>v4-rev614-1.18.0-rc</version>
    </dependency>

final NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
final String spreadsheetId = "Spreadsheet token";
final String range = "Class Data!A2:E";
Sheets service = new Sheets.Builder(HTTP_TRANSPORT, JSON_FACTORY, getCredentials(HTTP_TRANSPORT))
.setApplicationName(APPLICATION_NAME)
.build();
ValueRange response = service.spreadsheets().values()
.get(spreadsheetId, range)
.execute();
List<List> values = response.getValues();
then in our main method. ^
As you can see it's too complicated. I believe using SQL would make it a lot easier for users to understand the code as this would be the best reference to use for future development.

@ThnksCJ
Copy link

ThnksCJ commented Mar 3, 2022

I think we should make 2 versions one over compilacted one and one for less savy coders to understand and user,

@LarryTheFatCat
Copy link
Author

Mayb, but I just installed MySQL and installed a working dataBase via NetBeans. Im gonna link it to netBeans when I finish work today.

@LarryTheFatCat
Copy link
Author

I also realized this thread has been going on for so long lmfao

@ThnksCJ
Copy link

ThnksCJ commented Mar 4, 2022

Ikr what's ur discord????

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants