Jump to content

5 posts in this topic

Recommended Posts

Posted

Hey, im looking for NIC v1.0 :) I am currently on v2.0

 

 

What im looking for  (I think i overwrote the file ages back)

NIC 1.0 - New Instance Creator
——————————
  [1.] iphone/application
  [2.] iphone/library
  [3.] iphone/preference_bundle
  [4.] iphone/tool
  [5.] iphone/tweak
Posted (edited)

 

 

#!/usr/bin/perl
 
my $VER = "1.0";
 
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";
 
use Getopt::Long;
use Cwd 'abs_path';
use File::Spec;
use File::Find;
use File::Copy;
use User::pwent;
use POSIX qw(getuid);
use Module::Load::Conditional 'can_load';
 
my @[member=edirsito] = File::Spec->splitdir(abs_path($FindBin::Bin));
$_dirs[$#_dirs]="templates";
my $_templatepath = File::Spec->catdir(@[member=edirsito]);
$#_dirs--;
my $_theospath = File::Spec->catdir(@[member=edirsito]);
 
my @templates = getTemplates();
 
my %CONFIG = ();
loadConfig();
 
my $clean_project_name = "";
my $project_name = "";
my $package_prefix = $CONFIG{'package_prefix'};
$package_prefix = "com.yourcompany" if !$package_prefix;
my $package_name = "";
my $username = $CONFIG{'username'};
$username = "" if !$username;
my $template;
 
my $nicfile = "";
 
Getopt::Long::Configure("bundling");
 
GetOptions( "packagename|p=s" => \$package_name,
"name|n=s" => \$project_name,
"user|u=s" => \$username,
"nic=s" => \$nicfile,
"template|t=s" => \$template);
 
$project_name = $ARGV[0] if($ARGV[0]);
 
my $_versionstring = "NIC $VER - New Instance Creator";
print $_versionstring,$/;
print "-" x length($_versionstring),$/;
 
$template = $nicfile if $nicfile ne "";
if(!$template) {
$template = promptList(undef, "Choose a Template (required)", @templates);
}
$nicfile = "$_templatepath/$template.nic" if $nicfile eq "";
exitWithError("Couldn't open template at path $nicfile") if(! -f $nicfile);
 
### LOAD THE NICFILE! ###
open(my $nichandle, "<", $nicfile);
my $line = <$nichandle>;
my $nicversion = 1;
if($line =~ /^nic (\w+)$/) {
$nicversion = $1;
}
seek($nichandle, 0, 0);
 
my $NICPackage = "NIC$nicversion";
exitWithError("I don't understand NIC version $nicversion!") if(!can_load(modules => {"NIC::Formats::$NICPackage" => undef}));
my $NIC = $NICPackage->new();
$NIC->load($nichandle);
close($nichandle);
### YAY! ###
 
promptIfMissing(\$project_name, undef, "Project Name (required)");
exitWithError("I can't live without a project name! Aieeee!") if !$project_name;
$clean_project_name = cleanProjectName($project_name);
 
$package_name = $package_prefix.".".packageNameIze($project_name) if $CONFIG{'skip_package_name'};
promptIfMissing(\$package_name, $package_prefix.".".packageNameIze($project_name), "Package Name");
 
promptIfMissing(\$username, getUserName(), "Author/Maintainer Name");
 
my $directory = lc($clean_project_name);
if(-d $directory) {
my $response;
promptIfMissing(\$response, "N", "There's already something in $directory. Continue");
exit 1 if(uc($response) eq "N");
}
 
$NIC->set("FULLPROJECTNAME", $project_name);
$NIC->set("PROJECTNAME", $clean_project_name);
$NIC->set("PACKAGENAME", $package_name);
$NIC->set("USER", $username);
 
$NIC->addConstraint("package");
 
foreach $prompt ($NIC->prompts) {
# Do we want to import these variables into the NIC automatically? In the format name.VARIABLE?
# If so, this could become awesome. We could $NIC->get($prompt->{name})
# and have loaded the variables in a loop beforehand.
# This would also allow the user to set certain variables (package prefix, username) for different templates.
my $response = $CONFIG{$NIC->name().".".$prompt->{name}} || undef;
promptIfMissing(\$response, $prompt->{default}, $prompt->{prompt});
$NIC->set($prompt->{name}, $response);
}
 
print "Instantiating $template in ".lc($clean_project_name)."/...",$/;
my $dirname = lc($clean_project_name);
$NIC->build($dirname);
symlink($_theospath, "theos");
print "Done.",$/;
 
sub promptIfMissing {
my $vref = shift;
return if(${$vref});
 
my $default = shift;
my $prompt = shift;
 
if($default) {
print $prompt, " [$default]: ";
} else {
print $prompt, ": ";
}
 
$| = 1; $_ = <STDIN>;
chomp;
 
if($default) {
${$vref} = $_ ? $_ : $default;
} else {
${$vref} = $_;
}
}
 
sub promptList {
my $default = shift;
my $prompt = shift;
my @list = @_;
 
$default = -1 if(!defined $default);
 
map { print " ".($_==$default?">":" ")."[".($_+1).".] ",$list[$_],$/; } (0..$#list);
print $prompt,": ";
$| = 1;
my $idx = -1;
while(<STDIN>) {
chomp;
if($default > -1 && $_ eq "") {
$idx = $default;
last;
}
if($_ < 1 || $_ > $#list+1) {
print "Invalid value.",$/,$prompt,": ";
next; 
}
$idx = $_-1;
last;
}
return $list[$idx];
}
 
sub exitWithError {
my $error = shift;
print STDERR "[error] ", $error, $/;
exit 1;
}
 
sub getTemplates {
our @templates = ();
find({wanted => \&templateWanted, no_chdir => 1}, $_templatepath);
sub templateWanted {
if(-f && /\.nic$/) {
my $template = substr($_,length($_templatepath)+1);
$template =~ s/\.nic$//;
push(@templates, $template);
}
}
return sort @templates;
}
 
sub packageNameIze {
my $name = shift;
$name =~ s/ //g;
$name =~ s/[^\w\+-.]//g;
return lc($name);
}
 
sub cleanProjectName {
my $name = shift;
$name =~ s/ //g;
$name =~ s/\W//g;
return $name;
}
 
sub getUserName {
my $pw = getpw(getuid());
my ($fullname) = split(/\s*,\s*/, $pw->gecos);
return $fullname ? $fullname : $pw->name;
}
 
sub getHomeDir {
my $pw = getpw(getuid());
return $pw->dir;
}
 
sub loadConfig {
open(my $cfh, "<", getHomeDir()."/.nicrc") or return;
while(<$cfh>) {
if(/^(.+?)\s*=\s*\"(.*)\"$/) {
my $key = $1;
my $value = $2;
$CONFIG{$key} = $value;
}
}
}

 

 

 

Not sure if that's what you were looking for, but I found that on GitHub. If it is, just overwrite your current one again :p

Updated by Pro
Posted

are you looking for the templates? or NIC

probably the template, but i may have a theos error

 

 

#!/usr/bin/perl
 
my $VER = "1.0";
 
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";
 
use Getopt::Long;
use Cwd 'abs_path';
use File::Spec;
use File::Find;
use File::Copy;
use User::pwent;
use POSIX qw(getuid);
use Module::Load::Conditional 'can_load';
 
my @[member='edirsito'] = File::Spec->splitdir(abs_path($FindBin::Bin));
$_dirs[$#_dirs]="templates";
my $_templatepath = File::Spec->catdir(@[member='edirsito']);
$#_dirs--;
my $_theospath = File::Spec->catdir(@[member='edirsito']);
 
my @templates = getTemplates();
 
my %CONFIG = ();
loadConfig();
 
my $clean_project_name = "";
my $project_name = "";
my $package_prefix = $CONFIG{'package_prefix'};
$package_prefix = "com.yourcompany" if !$package_prefix;
my $package_name = "";
my $username = $CONFIG{'username'};
$username = "" if !$username;
my $template;
 
my $nicfile = "";
 
Getopt::Long::Configure("bundling");
 
GetOptions( "packagename|p=s" => \$package_name,
"name|n=s" => \$project_name,
"user|u=s" => \$username,
"nic=s" => \$nicfile,
"template|t=s" => \$template);
 
$project_name = $ARGV[0] if($ARGV[0]);
 
my $_versionstring = "NIC $VER - New Instance Creator";
print $_versionstring,$/;
print "-" x length($_versionstring),$/;
 
$template = $nicfile if $nicfile ne "";
if(!$template) {
$template = promptList(undef, "Choose a Template (required)", @templates);
}
$nicfile = "$_templatepath/$template.nic" if $nicfile eq "";
exitWithError("Couldn't open template at path $nicfile") if(! -f $nicfile);
 
### LOAD THE NICFILE! ###
open(my $nichandle, "<", $nicfile);
my $line = <$nichandle>;
my $nicversion = 1;
if($line =~ /^nic (\w+)$/) {
$nicversion = $1;
}
seek($nichandle, 0, 0);
 
my $NICPackage = "NIC$nicversion";
exitWithError("I don't understand NIC version $nicversion!") if(!can_load(modules => {"NIC::Formats::$NICPackage" => undef}));
my $NIC = $NICPackage->new();
$NIC->load($nichandle);
close($nichandle);
### YAY! ###
 
promptIfMissing(\$project_name, undef, "Project Name (required)");
exitWithError("I can't live without a project name! Aieeee!") if !$project_name;
$clean_project_name = cleanProjectName($project_name);
 
$package_name = $package_prefix.".".packageNameIze($project_name) if $CONFIG{'skip_package_name'};
promptIfMissing(\$package_name, $package_prefix.".".packageNameIze($project_name), "Package Name");
 
promptIfMissing(\$username, getUserName(), "Author/Maintainer Name");
 
my $directory = lc($clean_project_name);
if(-d $directory) {
my $response;
promptIfMissing(\$response, "N", "There's already something in $directory. Continue");
exit 1 if(uc($response) eq "N");
}
 
$NIC->set("FULLPROJECTNAME", $project_name);
$NIC->set("PROJECTNAME", $clean_project_name);
$NIC->set("PACKAGENAME", $package_name);
$NIC->set("USER", $username);
 
$NIC->addConstraint("package");
 
foreach $prompt ($NIC->prompts) {
# Do we want to import these variables into the NIC automatically? In the format name.VARIABLE?
# If so, this could become awesome. We could $NIC->get($prompt->{name})
# and have loaded the variables in a loop beforehand.
# This would also allow the user to set certain variables (package prefix, username) for different templates.
my $response = $CONFIG{$NIC->name().".".$prompt->{name}} || undef;
promptIfMissing(\$response, $prompt->{default}, $prompt->{prompt});
$NIC->set($prompt->{name}, $response);
}
 
print "Instantiating $template in ".lc($clean_project_name)."/...",$/;
my $dirname = lc($clean_project_name);
$NIC->build($dirname);
symlink($_theospath, "theos");
print "Done.",$/;
 
sub promptIfMissing {
my $vref = shift;
return if(${$vref});
 
my $default = shift;
my $prompt = shift;
 
if($default) {
print $prompt, " [$default]: ";
} else {
print $prompt, ": ";
}
 
$| = 1; $_ = <STDIN>;
chomp;
 
if($default) {
${$vref} = $_ ? $_ : $default;
} else {
${$vref} = $_;
}
}
 
sub promptList {
my $default = shift;
my $prompt = shift;
my @list = @_;
 
$default = -1 if(!defined $default);
 
map { print " ".($_==$default?">":" ")."[".($_+1).".] ",$list[$_],$/; } (0..$#list);
print $prompt,": ";
$| = 1;
my $idx = -1;
while(<STDIN>) {
chomp;
if($default > -1 && $_ eq "") {
$idx = $default;
last;
}
if($_ < 1 || $_ > $#list+1) {
print "Invalid value.",$/,$prompt,": ";
next; 
}
$idx = $_-1;
last;
}
return $list[$idx];
}
 
sub exitWithError {
my $error = shift;
print STDERR "[error] ", $error, $/;
exit 1;
}
 
sub getTemplates {
our @templates = ();
find({wanted => \&templateWanted, no_chdir => 1}, $_templatepath);
sub templateWanted {
if(-f && /\.nic$/) {
my $template = substr($_,length($_templatepath)+1);
$template =~ s/\.nic$//;
push(@templates, $template);
}
}
return sort @templates;
}
 
sub packageNameIze {
my $name = shift;
$name =~ s/ //g;
$name =~ s/[^\w\+-.]//g;
return lc($name);
}
 
sub cleanProjectName {
my $name = shift;
$name =~ s/ //g;
$name =~ s/\W//g;
return $name;
}
 
sub getUserName {
my $pw = getpw(getuid());
my ($fullname) = split(/\s*,\s*/, $pw->gecos);
return $fullname ? $fullname : $pw->name;
}
 
sub getHomeDir {
my $pw = getpw(getuid());
return $pw->dir;
}
 
sub loadConfig {
open(my $cfh, "<", getHomeDir()."/.nicrc") or return;
while(<$cfh>) {
if(/^(.+?)\s*=\s*\"(.*)\"$/) {
my $key = $1;
my $value = $2;
$CONFIG{$key} = $value;
}
}
}

 

 

 

Not sure if that's what you were looking for, but I found that on GitHub. If it is, just overwrite your current one again :p

 

thank you :) ill try it now!

Posted (edited)

probably the template, but i may have a theos error

 

thank you :) ill try it now!

Just noticed something. There are member tags in there for some reason, so if you find one that says "edirsito" or something like that, replace it with _dirs

Updated by Pro

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Mob Empire: City Gang Wars v2.4.0 [ +3 Cheats ] Currency Max
      Modded/Hacked App: Mob Empire: City Gang Wars By Atari, Interactive
      Bundle ID: com.atari.mobile.krys
      App Store Link: https://apps.apple.com/ph/app/mob-empire-city-gang-wars/id1488481638?uo=4

      🤩 Hack Features

      - Cash (Increase not decrease)
      - Gold (Increase not decrease)
      - Tokens (Increase not decrease)
      • 5 replies
    • Mob Empire: City Gang Wars v2.4.0 [ +3 Jailed ] Currency Max
      Modded/Hacked App: Mob Empire: City Gang Wars By Atari, Interactive
      Bundle ID: com.atari.mobile.krys
      App Store Link: https://apps.apple.com/ph/app/mob-empire-city-gang-wars/id1488481638?uo=4

      🤩 Hack Features

      - Cash (Increase not decrease)
      - Gold (Increase not decrease)
      - Tokens (Increase not decrease)
      • 2 replies
    • Era Merge v1.0.1 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Era Merge By ANLOFT YAZILIM LIMITED SIRKETI
      Bundle ID: com.anloft.eramerge
      App Store Link: https://apps.apple.com/us/app/era-merge/id6783998492?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Gems
      - Unlimited Coins
      - Unlimited Ticket
      • 0 replies
    • Era Merge v1.0.1 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Era Merge By ANLOFT YAZILIM LIMITED SIRKETI
      Bundle ID: com.anloft.eramerge
      App Store Link: https://apps.apple.com/us/app/era-merge/id6783998492?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Gems
      - Unlimited Coins
      - Unlimited Ticket
      • 1 reply
    • Merge Cat Cafe: Decorate v1.1.50 [ +11 Cheats ] Currency Max
      Modded/Hacked App: Merge Cat Cafe: Decorate By StandEgg Co., Ltd
      Bundle ID: com.standegg.mergecatcafe2
      App Store Link: https://apps.apple.com/us/app/merge-cat-cafe-decorate/id6670415194?uo=4

      🤩 Hack Features

      - Gems Freeze
      - Coins Freeze
      - Booster Freeze
      - Box Items Freeze
      - Energy 0 Play Unlimited
      :::: VIP ::::
      - ADS NO
      - Unlimited Gems
      - Unlimited Coins
      - Unlimited Energy
      - Unlimited Booster
      - Unlimited Box Items
      • 0 replies
    • Merge Cat Cafe: Decorate v1.1.50 [ +11 Jailed ] Currency Max
      Modded/Hacked App: Merge Cat Cafe: Decorate By StandEgg Co., Ltd
      Bundle ID: com.standegg.mergecatcafe2
      App Store Link: https://apps.apple.com/us/app/merge-cat-cafe-decorate/id6670415194?uo=4

      🤩 Hack Features

      - Gems Freeze
      - Coins Freeze
      - Booster Freeze
      - Box Items Freeze
      - Energy 0 Play Unlimited
      :::: VIP ::::
      - ADS NO
      - Unlimited Gems
      - Unlimited Coins
      - Unlimited Energy
      - Unlimited Booster
      - Unlimited Box Items
      • 0 replies
    • Crossword Master - Word Puzzle v2.1.0 [ +3 Cheats  ] Currency Max
      Modded/Hacked App: Crossword Master - Word Puzzle By Easybrain Ltd
      Bundle ID: com.easybrain.crossword.puzzles
      App Store Link: https://apps.apple.com/us/app/crossword-master-word-puzzle/id6547858927?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Coins
      - Unlimited Booster
      • 0 replies
    • Crossword Master - Word Puzzle v2.1.0 [ +3 Jailed ] Currency Max
      Modded/Hacked App: Crossword Master - Word Puzzle By Easybrain Ltd
      Bundle ID: com.easybrain.crossword.puzzles
      App Store Link: https://apps.apple.com/us/app/crossword-master-word-puzzle/id6547858927?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Coins
      - Unlimited Booster
      • 1 reply
    • ZakuzakuSlash +5 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: ZakuzakuSlash By nekosuko
      Bundle ID: jp.nekosuko.zakuzakuslash
      App Store Link: https://apps.apple.com/us/app/zakuzakuslash/id6749934570?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - XP Multiplier
      - Unlimited Gold -> Will increase instead of decrease.
      • 2 replies
    • Piggy Land 3D v1.2.2 [ +4 Jailed ] Currency Max
      Modded/Hacked App: Piggy Land 3D By PIXON PTE. LTD.
      Bundle ID: farm.piggy.animal.jam.away
      App Store Link: https://apps.apple.com/us/app/piggy-land-3d/id6762121301?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Coin
      - Unlimited Booster
      - Custom Level
      • 1 reply
    • Piggy Land 3D v1.2.2 [ +4 Cheats ] Currency Max
      Modded/Hacked App: Piggy Land 3D By PIXON PTE. LTD.
      Bundle ID: farm.piggy.animal.jam.away
      App Store Link: https://apps.apple.com/us/app/piggy-land-3d/id6762121301?uo=4

      🤩 Hack Features

      - Auto ADS No
      - Unlimited Coin
      - Unlimited Booster
      - Custom Level
      • 0 replies
    • Dwarfs Diggers: Idle Master v0.7.4 [ +4 Jailed ] Currency Freeze
      Modded/Hacked App: Dwarfs Diggers: Idle Master By BLACK BOX DIGITAL LLP
      Bundle ID: com.bbdigital.idle.dwarfs.master
      App Store Link: https://apps.apple.com/us/app/dwarfs-diggers-idle-master/id6769121279?uo=4

      🤩 Hack Features

      - Currency Freeze
      - Resources Freeze
      - Energy Freeze
      - Troop Drop Unlimited
      • 3 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines